]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: Trigger state machine on state change and not polling.
authorAndrew Lunn <andrew@lunn.ch>
Wed, 12 Oct 2016 20:14:53 +0000 (22:14 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Oct 2016 16:03:47 +0000 (12:03 -0400)
commit6e4f088b238d301baa59192185f9366262eb252e
tree8bc84d37da7078197afe2e0fe8baab8e78f1373e
parentbd82a4eca50ac38a800f2bf936a2cb521bb860e8
net: phy: Trigger state machine on state change and not polling.

The phy_start() is used to indicate the PHY is now ready to do its
work. The state is changed, normally to PHY_UP which means that both
the MAC and the PHY are ready.

If the phy driver is using polling, when the next poll happens, the
state machine notices the PHY is now in PHY_UP, and kicks off
auto-negotiation, if needed.

If however, the PHY is using interrupts, there is no polling. The phy
is stuck in PHY_UP until the next interrupt comes along. And there is
no reason for the PHY to interrupt.

Have phy_start() schedule the state machine to run, which both speeds
up the polling use case, and makes the interrupt use case actually
work.

This problems exists whenever there is a state change which will not
cause an interrupt. Trigger the state machine in these cases,
e.g. phy_error().

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Cc: Kyle Roeschley <kyle.roeschley@ni.com>
Tested-by: Kyle Roeschley <kyle.roeschley@ni.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy.c