Thread (10 messages) 10 messages, 3 authors, 2023-03-27

Re: [RESEND PATCH v7 5/5] can: bxcan: add support for ST bxCAN controller

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: 2023-03-24 15:54:41
Also in: linux-can, lkml

On 15.03.2023 22:10:40, Dario Binacchi wrote:
[...]
+static int __maybe_unused bxcan_suspend(struct device *dev)
+{
+	struct net_device *ndev = dev_get_drvdata(dev);
+	struct bxcan_priv *priv = netdev_priv(ndev);
+
+	if (!netif_running(ndev))
+		return 0;
+
+	netif_stop_queue(ndev);
+	netif_device_detach(ndev);
+
+	bxcan_enter_sleep_mode(priv);
+	priv->can.state = CAN_STATE_SLEEPING;
+	clk_disable_unprepare(priv->clk);
The driver enabled the clock in probe, right? So in case the interface
is down you don't disable the clock and keep it running during
suspend. Is this a problem?

You can disable the clock in probe and enable it in open/disable in
close.
+	return 0;
+}
regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung Nürnberg              | Phone: +49-5121-206917-129  |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help