Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eballetbo@iseebcn.com
Cc: netdev@vger.kernel.org, steve.glendinning@shawell.net,
	javier@dowhile0.org, ebutera@gmail.com
Subject: Re: [PATCH] smsc911x: power-up phydev before doing a software reset.
Date: Tue, 11 Nov 2014 18:30:42 -0500 (EST)	[thread overview]
Message-ID: <20141111.183042.469456165241690341.davem@davemloft.net> (raw)
In-Reply-To: <1415643789-5367-1-git-send-email-eballetbo@iseebcn.com>

From: Enric Balletbo i Serra <eballetbo@iseebcn.com>
Date: Mon, 10 Nov 2014 19:23:09 +0100

> With commit be9dad1f9f26604fb ("net: phy: suspend phydev when going
> to HALTED"), the PHY device will be put in a low-power mode using
> BMCR_PDOWN if the the interface is set down. The smsc911x driver does
> a software_reset opening the device driver (ndo_open). In such case,
> the PHY must be powered-up before access to any register and before
> calling the software_reset function. Otherwise, as the PHY is powered
> down the software reset fails and the interface can not be enabled
> again.
> 
> This patch fixes this scenario that is easy to reproduce setting down
> the network interface and setting up again.
> 
>     $ ifconfig eth0 down
>     $ ifconfig eth0 up
>     ifconfig: SIOCSIFFLAGS: Input/output error
> 
> Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
 ...
> +		mdelay(1);

As per Javier's feedback, please convert this to usleep_range()
if you agree that this can only be invoked from process context.

Thanks.

  parent reply	other threads:[~2014-11-11 23:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-10 18:23 [PATCH] smsc911x: power-up phydev before doing a software reset Enric Balletbo i Serra
2014-11-11 11:20 ` Javier Martinez Canillas
2014-11-11 23:30 ` David Miller [this message]
2014-11-13  7:57   ` Enric Balletbo Serra
2014-11-13  8:27     ` Javier Martinez Canillas

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=20141111.183042.469456165241690341.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eballetbo@iseebcn.com \
    --cc=ebutera@gmail.com \
    --cc=javier@dowhile0.org \
    --cc=netdev@vger.kernel.org \
    --cc=steve.glendinning@shawell.net \
    /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