diff options
author | Sergei Miroshnichenko <sergeimir@emcraft.com> | 2016-09-07 16:51:12 +0300 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2016-12-23 09:41:16 -0500 |
commit | 5e5920acffa330fabb1a7df2c340d747d2a13e37 (patch) | |
tree | 79f2407d9b46f92e64d30bb7bc385d9a41660e78 /include | |
parent | e1df4c5d40ceb63924167c87421b81fd3818a201 (diff) |
can: dev: fix deadlock reported after bus-off
[ Upstream commit 9abefcb1aaa58b9d5aa40a8bb12c87d02415e4c8 ]
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>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/can/dev.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 71e37afd7290..49093889362c 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h @@ -31,6 +31,7 @@ enum can_mode { * CAN common private data */ struct can_priv { + struct net_device *dev; struct can_device_stats can_stats; struct can_bittiming bittiming, data_bittiming; @@ -46,7 +47,7 @@ struct can_priv { u32 ctrlmode_static; /* static enabled options for driver/hardware */ int restart_ms; - struct timer_list restart_timer; + struct delayed_work restart_work; int (*do_set_bittiming)(struct net_device *dev); int (*do_set_data_bittiming)(struct net_device *dev); |