netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Joakim Zhang <qiangqing.zhang@nxp.com>
Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-imx@nxp.com
Subject: Re: [PATCH net-next] net: fec: fix system hang during suspend/resume
Date: Tue, 14 Dec 2021 11:24:24 +0100	[thread overview]
Message-ID: <Ybhw2JBqjRBOlyn1@lunn.ch> (raw)
In-Reply-To: <20211214025350.8985-1-qiangqing.zhang@nxp.com>

On Tue, Dec 14, 2021 at 10:53:50AM +0800, Joakim Zhang wrote:
> 1. During normal suspend (WoL not enabled) process, system has posibility
> to hang. The root cause is TXF interrupt coming after clocks disabled,
> system hang when accessing registers from interrupt handler. To fix this
> issue, disable all interrupts when system suspend.
> 
> 2. System also has posibility to hang with WoL enabled during suspend,
> after entering stop mode, then magic pattern coming after clocks
> disabled, system will be waked up, and interrupt handler will be called,
> system hang when access registers. To fix this issue, disable wakeup
> irq in .suspend(), and enable it in .resume().
> 
> Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
> ---
> Send to net-next although this is a bug fix, since there is no suitable
> commit to be blamed, can be back ported to stable tree if others need.
> ---
>  drivers/net/ethernet/freescale/fec_main.c | 46 +++++++++++++++++------
>  1 file changed, 34 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index 613b8180a1bd..786dcb923697 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -1185,6 +1185,21 @@ static void fec_enet_stop_mode(struct fec_enet_private *fep, bool enabled)
>  	}
>  }
>  
> +static inline void fec_irqs_disable(struct net_device *ndev)

Please don't use inline in .c files. Let the compiler decide.

       Andrew

      reply	other threads:[~2021-12-14 10:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14  2:53 [PATCH net-next] net: fec: fix system hang during suspend/resume Joakim Zhang
2021-12-14 10:24 ` Andrew Lunn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Ybhw2JBqjRBOlyn1@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=qiangqing.zhang@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).