can: c_can: don't call pm_runtime_get_sync() from interrupt context
authorMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 24 Nov 2013 22:31:24 +0000 (23:31 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 25 Nov 2013 20:48:51 +0000 (21:48 +0100)
commite35d46adc49b469fd92bdb64fea8af93640e6651
tree450dc5d0e82ae23c24cdd2374ba578f904b81b2f
parent2fea6cd303c0d0cd9067da31d873b6a6d5bd75e7
can: c_can: don't call pm_runtime_get_sync() from interrupt context

The c_can driver contians a callpath (c_can_poll -> c_can_state_change ->
c_can_get_berr_counter) which may call pm_runtime_get_sync() from the IRQ
handler, which is not allowed and results in "BUG: scheduling while atomic".

This problem is fixed by introducing __c_can_get_berr_counter, which will not
call pm_runtime_get_sync().

Reported-by: Andrew Glen <AGlen@bepmarine.com>
Tested-by: Andrew Glen <AGlen@bepmarine.com>
Signed-off-by: Andrew Glen <AGlen@bepmarine.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/c_can/c_can.c