]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
can: dev: fix deadlock reported after bus-off
authorSergei Miroshnichenko <sergeimir@emcraft.com>
Wed, 7 Sep 2016 13:51:12 +0000 (16:51 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Oct 2016 13:21:16 +0000 (15:21 +0200)
commite7e706f6fa5acde7f9a055c460782b7287bae192
treee7b4e3c6820adb3f45f7f7535b2dd60d32208ea6
parent8ff4f41e715a833f8adc90b5c625007d6f027921
can: dev: fix deadlock reported after bus-off

commit 9abefcb1aaa58b9d5aa40a8bb12c87d02415e4c8 upstream.

A timer was used to restart after the bus-off state, leading to a
relatively large can_restart() executed in an interrupt context,
which in turn sets up pinctrl. When this happens during system boot,
there is a high probability of grabbing the pinctrl_list_mutex,
which is locked already by the probe() of other device, making the
kernel suspect a deadlock condition [1].

To resolve this issue, the restart_timer is replaced by a delayed
work.

[1] https://github.com/victronenergy/venus/issues/24

Signed-off-by: Sergei Miroshnichenko <sergeimir@emcraft.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/dev.c
include/linux/can/dev.h