summaryrefslogtreecommitdiff
path: root/drivers/net/can/c_can
diff options
context:
space:
mode:
authorViktor Babrian <babrian.viktor@renyi.mta.hu>2015-01-18 22:01:40 +0300
committerMarc Kleine-Budde <mkl@pengutronix.de>2015-01-22 00:43:14 +0300
commit7ffd7b4e169d619e66928fe5d997723f2c6f1056 (patch)
tree821f24f7118485fba220eaac09337adc0c4c45b3 /drivers/net/can/c_can
parent06efe0e54018cb19cf0807447dc3ac747ffcfd1c (diff)
downloadlinux-7ffd7b4e169d619e66928fe5d997723f2c6f1056.tar.xz
can: c_can: end pending transmission on network stop (ifdown)
Put controller into init mode in network stop to end pending transmissions. The issue is observed in cases when transmitted frame is not acked. Signed-off-by: Viktor Babrian <babrian.viktor@renyi.mta.hu> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/c_can')
-rw-r--r--drivers/net/can/c_can/c_can.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index f94a9fa60488..c672c4dcffac 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -615,6 +615,9 @@ static void c_can_stop(struct net_device *dev)
c_can_irq_control(priv, false);
+ /* put ctrl to init on stop to end ongoing transmission */
+ priv->write_reg(priv, C_CAN_CTRL_REG, CONTROL_INIT);
+
/* deactivate pins */
pinctrl_pm_select_sleep_state(dev->dev.parent);
priv->can.state = CAN_STATE_STOPPED;