All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Marek Vasut <marex@denx.de>,
	netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	Andrew Lunn <andrew@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH] net: phy: Trigger link_change_notify on PHY_HALTED
Date: Tue, 5 Jan 2021 17:05:01 +0000	[thread overview]
Message-ID: <20210105170501.GE1551@shell.armlinux.org.uk> (raw)
In-Reply-To: <06732cde-8614-baa1-891a-b80a35cabcbc@gmail.com>

On Tue, Jan 05, 2021 at 05:58:21PM +0100, Heiner Kallweit wrote:
> On 05.01.2021 17:11, Marek Vasut wrote:
> > @@ -1021,8 +1022,17 @@ void phy_stop(struct phy_device *phydev)
> >  	if (phydev->sfp_bus)
> >  		sfp_upstream_stop(phydev->sfp_bus);
> >  
> > +	old_state = phydev->state;
> >  	phydev->state = PHY_HALTED;
> >  
> > +	if (old_state != phydev->state) {
> 
> This check shouldn't be needed because it shouldn't happen that
> phy_stop() is called from status PHY_HALTED. In this case the
> WARN() a few lines above would have fired already.

That is incorrect. If an error happens with the phy, phy_error() will
be called, which sets phydev->state = PHY_HALTED. If you then
subsequently take the interface down, phy_stop() will be called, but
phydev->state will be set to PHY_HALTED.

This is a long standing bug since you changed the code, and I think is
something I've reported previously, since I've definitely encountered
it.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2021-01-05 17:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05 16:11 [PATCH] net: phy: Trigger link_change_notify on PHY_HALTED Marek Vasut
2021-01-05 16:58 ` Heiner Kallweit
2021-01-05 17:05   ` Russell King - ARM Linux admin [this message]
2021-01-05 21:06     ` Heiner Kallweit
2021-01-05 23:11 ` Heiner Kallweit

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=20210105170501.GE1551@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=marex@denx.de \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.