diff options
author | Sergei Miroshnichenko <sergeimir@emcraft.com> | 2016-09-07 16:51:12 +0300 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2016-10-07 10:03:57 +0200 |
commit | 1ab93b13fe17bbab243148d6b77ed672bd558c53 (patch) | |
tree | b826dacece6752c47c0378a4c1939f35cf0520e9 /include | |
parent | 3d0183af15bdd4d28677e0058645a2183cff7ed8 (diff) |
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: Jiri Slaby <jslaby@suse.cz>
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 fb0ab651a041..fb9fbe2f63e7 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; @@ -42,7 +43,7 @@ struct can_priv { u32 ctrlmode_supported; int restart_ms; - struct timer_list restart_timer; + struct delayed_work restart_work; int (*do_set_bittiming)(struct net_device *dev); int (*do_set_mode)(struct net_device *dev, enum can_mode mode); |