Thread (16 messages) 16 messages, 2 authors, 2021-06-07

Re: [PATCH net-next v1 7/7] usbnet: run unbind() before unregister_netdev()

From: Andrew Lunn <andrew@lunn.ch>
Date: 2021-06-04 23:41:24
Also in: linux-usb, lkml

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.

      Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help