Skip to content

Commit 82b620d

Browse files
committed
can: m_can: m_can_close(): stop clocks after device has been shut down
JIRA: https://issues.redhat.com/browse/RHEL-90130 commit 2c09b50 Author: Marc Kleine-Budde <[email protected]> Date: Mon Sep 9 15:07:41 2024 +0200 can: m_can: m_can_close(): stop clocks after device has been shut down After calling m_can_stop() an interrupt may be pending or NAPI might still be executed. This means the driver might still touch registers of the IP core after the clocks have been disabled. This is not good practice and might lead to aborts depending on the SoC integration. To avoid these potential problems, make m_can_close() symmetric to m_can_open(), i.e. stop the clocks at the end, right before shutting down the transceiver. Fixes: e0d1f48 ("can: m_can: add Bosch M_CAN controller support") Link: https://patch.msgid.link/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]> Signed-off-by: Radu Rendec <[email protected]>
1 parent ef85001 commit 82b620d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/can/m_can/m_can.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1724,7 +1724,6 @@ static int m_can_close(struct net_device *dev)
17241724
napi_disable(&cdev->napi);
17251725

17261726
m_can_stop(dev);
1727-
m_can_clk_stop(cdev);
17281727
free_irq(dev->irq, dev);
17291728

17301729
m_can_clean(dev);
@@ -1737,6 +1736,7 @@ static int m_can_close(struct net_device *dev)
17371736

17381737
close_candev(dev);
17391738

1739+
m_can_clk_stop(cdev);
17401740
phy_power_off(cdev->transceiver);
17411741

17421742
return 0;

0 commit comments

Comments
 (0)