lkml.org 
[lkml]   [2023]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RESEND PATCH v7 5/5] can: bxcan: add support for ST bxCAN controller
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 |
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2023-03-27 01:16    [W:0.203 / U:24.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site