netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problem with PHY state machine when using interrupts
@ 2017-07-24 11:07 Mason
  2017-07-24 15:01 ` Mason
  0 siblings, 1 reply; 15+ messages in thread
From: Mason @ 2017-07-24 11:07 UTC (permalink / raw)
  To: Florian Fainelli, Andrew Lunn, Mans Rullgard; +Cc: netdev, Linux ARM

Hello,

When I set the link down via 'ip link set eth0 down'
(as opposed to pulling the Ethernet cable) things don't happen as expected:

The driver's adjust_link() callback is never called, and doesn't
get a chance make some required changes. And when I set the link
up again, there is no network connectivity.

I get this problem only if I enable interrupts on my PHY.
If I use polling, things work as expected.


When I set the link down, devinet_ioctl() eventually calls
ndo_set_rx_mode() and ndo_stop()

In ndo_stop() the driver calls
phy_stop(phydev);
which disables interrupts and sets the state to HALTED.

In phy_state_machine()
the PHY_HALTED case does call the adjust_link() callback:

		if (phydev->link) {
			phydev->link = 0;
			netif_carrier_off(phydev->attached_dev);
			phy_adjust_link(phydev);
			do_suspend = true;
		}

But it's not called when I use interrupts...

Perhaps because there are no interrupts generated?
Or even if there were, they have been turned off by phy_stop?

Basically, it seems like when I use interrupts,
the phy_state_machine() is not called on link down,
which breaks the MAC driver's expectations.

Am I barking up the wrong tree?

Regards.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-07-25 17:55 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-24 11:07 Problem with PHY state machine when using interrupts Mason
2017-07-24 15:01 ` Mason
2017-07-24 16:49   ` Florian Fainelli
2017-07-24 19:13     ` Mason
2017-07-24 19:32       ` Florian Fainelli
2017-07-24 19:53         ` Florian Fainelli
2017-07-24 21:20           ` Mason
2017-07-24 22:36             ` Florian Fainelli
2017-07-24 22:39               ` Florian Fainelli
2017-07-25 10:51                 ` Mason
2017-07-25 11:41                   ` Mason
2017-07-25 17:55                     ` Florian Fainelli
2017-07-24 22:53               ` Mason
2017-07-24 22:59                 ` Florian Fainelli
2017-07-25  0:30                   ` Florian Fainelli

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