]> asedeno.scripts.mit.edu Git - linux.git/commit
net: dsa: mv88e6xxx: Poll when no interrupt defined
authorAndrew Lunn <andrew@lunn.ch>
Thu, 22 Feb 2018 21:58:32 +0000 (22:58 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Feb 2018 16:28:10 +0000 (11:28 -0500)
commit294d711ee8c04fb2baa704cae15a7d039bb50615
tree74bf028c686927603c36dba79e2eda0b9e72cc70
parent65b53bfd497b052277f89afb3839ace38190974c
net: dsa: mv88e6xxx: Poll when no interrupt defined

Not all boards have the interrupt output from the switch connected to
a GPIO line. In such cases, phylib has to poll the internal PHYs,
rather than receive an interrupt when there is a change in the link
state. phylib polls once per second, and per PHY reads around 4
words. With a switch typically having 4 internal PHYs, this means 16
MDIO transactions per second.

Rather than performing this phylib level polling, have the driver poll
the interrupt status register. If the status register indicates an
interrupt condition processing of interrupts in the same way as if a
GPIO was used.

Polling 10 times a second places less load on the MDIO bus. But rather
than taking on average 0.5s to detect a link change, it takes less
than 0.05s. Additionally, other interrupts, such as the watchdog, ATU
and VTU violations will be reported.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.c
drivers/net/dsa/mv88e6xxx/chip.h