mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] net: fec_imx: skip fec_halt if the FEC wasn't started
Date: Fri, 1 Feb 2019 14:31:08 +0100	[thread overview]
Message-ID: <20190201133108.GA14385@ravnborg.org> (raw)
In-Reply-To: <20190201130241.26620-1-l.stach@pengutronix.de>

Hi Lucas.

On Fri, Feb 01, 2019 at 02:02:41PM +0100, Lucas Stach wrote:
> If the FEC driver is enabled, but the ethernet device was never
> opened due to booting from another source the wait for graceful
> transmit stop will always fail. This introduces an unnecessary
> boot delay and prints a distracting warning.
> 
> As there is no point in trying to shut down the FEC if it was
> never started, just skip all of fec_halt in that case.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/net/fec_imx.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
> index 4823b08340c6..36505c529c84 100644
> --- a/drivers/net/fec_imx.c
> +++ b/drivers/net/fec_imx.c
> @@ -395,6 +395,9 @@ static void fec_halt(struct eth_device *dev)
>  	struct fec_priv *fec = (struct fec_priv *)dev->priv;
>  	uint32_t reg;
>  
> +	if (!(readl(fec->regs + FEC_ECNTRL) & FEC_ECNTRL_ETHER_EN))
> +		return;
> +
It would be nice with a small comment in the code that explain why
it is OK to return here, so one does not have to go digging in git
to find out why.

	Sam

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2019-02-01 13:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-01 13:02 Lucas Stach
2019-02-01 13:31 ` Sam Ravnborg [this message]
2019-02-05 11:48   ` Sascha Hauer

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=20190201133108.GA14385@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=barebox@lists.infradead.org \
    --cc=l.stach@pengutronix.de \
    /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