All of lore.kernel.org
 help / color / mirror / Atom feed
* Waiting for the PHY to complete auto-negotiation
@ 2017-12-06 16:39 Mason
  2017-12-06 16:59 ` Andrew Lunn
  0 siblings, 1 reply; 14+ messages in thread
From: Mason @ 2017-12-06 16:39 UTC (permalink / raw)
  To: netdev; +Cc: Florian Fainelli, Andrew Lunn, David Miller

Hello,

I've been trying to wrap my head around Ethernet auto-negotiation,
vs actual / real packets seen at the MAC layer. I found the relevant
Wikipedia article to be fairly informative:

    https://en.wikipedia.org/wiki/Autonegotiation

The reason I care is that my Ethernet HW does not allow changing the
flow control setting once the MAC has started (more specifically, once
RX DMA has been enabled).

In nb8800_open(), the code currently works in this order:

	nb8800_start_rx(dev);
	phy_start(phydev);

The first line enables the MAC (and DMA).
The second enables the PHY and starts auto-negotiation.

This is a problem: I would like for PHY auto-negotiation to be
/complete/ before I enable the MAC.

What is the recommended way to wait for the PHY?

AFAICT, the PHY layer calls back into the eth driver through the
adjust_link() callback registered through of_phy_connect().
It seems like this might be a good place to enable the MAC?
(When some other conditions are true.)

Regards.

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

end of thread, other threads:[~2017-12-11 16:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-06 16:39 Waiting for the PHY to complete auto-negotiation Mason
2017-12-06 16:59 ` Andrew Lunn
2017-12-06 18:03   ` Mason
2017-12-06 18:26     ` Andrew Lunn
2017-12-06 19:00       ` Mason
2017-12-06 19:07         ` Andrew Lunn
2017-12-06 19:25           ` Mason
2017-12-06 23:00             ` Florian Fainelli
2017-12-07 16:17               ` Mason
2017-12-09 18:49                 ` Florian Fainelli
2017-12-11 14:29                   ` Mason
2017-12-11 14:36                     ` Måns Rullgård
2017-12-11 14:47                       ` Mason
2017-12-11 16:32                         ` Måns Rullgård

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.