Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1634960
| From | Quentin Schulz <quentin.schulz@free-electrons.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 2/2] can: m_can: add deep Suspend/Resume support |
| Date | 2017-05-03 14:50 +0200 |
| Message-ID | <tD1Tc-5s5-11@gated-at.bofh.it> (permalink) |
| References | <tD1Jv-5or-5@gated-at.bofh.it> <tD1Jv-5or-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hum, forgot the changelog.
On 03/05/2017 14:37, Quentin Schulz wrote:
> This adds Power Management deep Suspend/Resume support for Bosch M_CAN
> chip.
>
> When the system resumes from deep sleep, the chip needs to be fully
> reinitialized (RAM, chip, clocks, irq, candev, ...) to be functional.
>
> Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
> ---
v2:
- fix erroneous commit log,
> drivers/net/can/m_can/m_can.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
> index 3f0445440146..9e0143b528f1 100644
> --- a/drivers/net/can/m_can/m_can.c
> +++ b/drivers/net/can/m_can/m_can.c
> @@ -1670,12 +1670,10 @@ static __maybe_unused int m_can_suspend(struct device *dev)
> struct m_can_priv *priv = netdev_priv(ndev);
>
> if (netif_running(ndev)) {
> - netif_stop_queue(ndev);
> netif_device_detach(ndev);
> + m_can_close(ndev);
> }
>
> - /* TODO: enter low power */
> -
> priv->can.state = CAN_STATE_SLEEPING;
>
> return 0;
> @@ -1686,13 +1684,13 @@ static __maybe_unused int m_can_resume(struct device *dev)
> struct net_device *ndev = dev_get_drvdata(dev);
> struct m_can_priv *priv = netdev_priv(ndev);
>
> - /* TODO: exit low power */
> + m_can_init_ram(priv);
>
> priv->can.state = CAN_STATE_ERROR_ACTIVE;
>
> if (netif_running(ndev)) {
> + m_can_open(ndev);
> netif_device_attach(ndev);
> - netif_start_queue(ndev);
> }
>
> return 0;
>
--
Quentin Schulz, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2 1/2] can: m_can: move Message RAM initialization to function Quentin Schulz <quentin.schulz@free-electrons.com> - 2017-05-03 14:40 +0200
[PATCH v2 2/2] can: m_can: add deep Suspend/Resume support Quentin Schulz <quentin.schulz@free-electrons.com> - 2017-05-03 14:40 +0200
Re: [PATCH v2 2/2] can: m_can: add deep Suspend/Resume support Quentin Schulz <quentin.schulz@free-electrons.com> - 2017-05-03 14:50 +0200
csiph-web