From: Marc Kleine-Budde <mkl@pengutronix.de> Date: 2015-07-16 08:34:01
Hello David,
this is a pull request of 2 patches by Stefan Agner. He fixes the resume
operation in the mcp251x driver.
regards,
Marc
---
The following changes since commit 15afb10df4a3f1bd781373ffd968e70cc4b21a42:
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth (2015-07-15 21:59:23 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-4.2-20150716
for you to fetch changes up to 69da3f2ac528642acbd06ed14564ac1b9a918394:
can: mcp251x: get regulators optionally (2015-07-16 09:04:22 +0200)
----------------------------------------------------------------
linux-can-fixes-for-4.2-20150716
----------------------------------------------------------------
Stefan Agner (2):
can: mcp251x: fix resume when device is down
can: mcp251x: get regulators optionally
drivers/net/can/spi/mcp251x.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
From: Marc Kleine-Budde <mkl@pengutronix.de> Date: 2015-07-16 08:34:04
From: Stefan Agner <stefan@agner.ch>
The regulators power and transceiver are optional. If those are not
present, the pointer (or error pointer) is correctly handled by the
driver, hence we can use devm_regulator_get_optional safely, which
avoids regulators getting created.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/spi/mcp251x.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Marc Kleine-Budde <mkl@pengutronix.de> Date: 2015-07-16 08:34:06
From: Stefan Agner <stefan@agner.ch>
If a valid power regulator or a dummy regulator is used (which
happens to be the case when no regulator is specified), restart_work
is queued no matter whether the device was running or not at suspend
time. Since work queues get initialized in the ndo_open callback,
resuming leads to a NULL pointer exception.
Reverse exactly the steps executed at suspend time:
- Enable the power regulator in any case
- Enable the transceiver regulator if the device was running, even in
case we have a power regulator
- Queue restart_work only in case the device was running
Fixes: bf66f3736a94 ("can: mcp251x: Move to threaded interrupts instead of workqueues.")
Signed-off-by: Stefan Agner <stefan@agner.ch>
Cc: linux-stable <redacted>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/spi/mcp251x.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)