Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, linux-usb@vger.kernel.org,
	Russell King <linux@armlinux.org.uk>,
	linux-kernel@vger.kernel.org, kernel@pengutronix.de,
	Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Heiner Kallweit <hkallweit1@gmail.com>
Subject: Re: [PATCH net-next v1 7/7] usbnet: run unbind() before unregister_netdev()
Date: Mon, 7 Jun 2021 10:04:04 +0200	[thread overview]
Message-ID: <20210607080404.5r2gsmz6w2cnpleq@pengutronix.de> (raw)
In-Reply-To: <YLq6G9luZrXW5vry@lunn.ch>

On Sat, Jun 05, 2021 at 01:41:15AM +0200, Andrew Lunn wrote:
> On Fri, Jun 04, 2021 at 03:42:44PM +0200, Oleksij Rempel wrote:
> > unbind() is the proper place to disconnect PHY, but it will fail if
> > netdev is already unregistered.
> 
> O.K, this partially answers the question i was about to ask for the
> previous patch.
> 
> void phy_start(struct phy_device *phydev)
> {
> 	mutex_lock(&phydev->lock);
> 
> 	if (phydev->state != PHY_READY && phydev->state != PHY_HALTED) {
> 		WARN(1, "called from state %s\n",
> 		     phy_state_to_str(phydev->state));
> 		goto out;
> 	}
> 
> By skipping phy_error(), phydev->state is not set to PHY_HALTED. So if
> you try to start the phy again, without disconnecting it, it looks
> like there could be a problem.
> 
> But with this patch, i assume the PHY will always be disconnected and
> later reconnected when the device is replugged.

Yes. The PHY is disconnected and the PHY driver is unbinded.

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

      reply	other threads:[~2021-06-07  8:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04 13:42 [PATCH net-next v1 0/7] port asix ax88772 to the PHYlib Oleksij Rempel
2021-06-04 13:42 ` [PATCH net-next v1 1/7] net: usb: asix: ax88772_bind: use devm_kzalloc() instead of kzalloc() Oleksij Rempel
2021-06-04 23:05   ` Andrew Lunn
2021-06-04 13:42 ` [PATCH net-next v1 2/7] net: usb: asix: ax88772: add phylib support Oleksij Rempel
2021-06-04 23:18   ` Andrew Lunn
2021-06-04 13:42 ` [PATCH net-next v1 3/7] net: usb/phy: asix: add support for ax88772A/C PHYs Oleksij Rempel
2021-06-04 23:23   ` Andrew Lunn
2021-06-04 13:42 ` [PATCH net-next v1 4/7] net: usb: asix: ax88772: add generic selftest support Oleksij Rempel
2021-06-04 23:24   ` Andrew Lunn
2021-06-04 13:42 ` [PATCH net-next v1 5/7] net: usb: asix: add error handling for asix_mdio_* functions Oleksij Rempel
2021-06-04 23:31   ` Andrew Lunn
2021-06-07  7:55     ` Oleksij Rempel
2021-06-04 13:42 ` [PATCH net-next v1 6/7] net: phy: do not print dump stack if device was removed Oleksij Rempel
2021-06-04 13:42 ` [PATCH net-next v1 7/7] usbnet: run unbind() before unregister_netdev() Oleksij Rempel
2021-06-04 23:41   ` Andrew Lunn
2021-06-07  8:04     ` Oleksij Rempel [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=20210607080404.5r2gsmz6w2cnpleq@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH net-next v1 7/7] usbnet: run unbind() before unregister_netdev()' \
    /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

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).