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

From: Marc Kleine-Budde
Date: Fri Mar 24 2023 - 11:54:41 EST


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 |

Attachment: signature.asc
Description: PGP signature