diff options
author | Andrew Lunn <andrew@lunn.ch> | 2018-02-22 22:58:32 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-26 11:28:10 -0500 |
commit | 294d711ee8c04fb2baa704cae15a7d039bb50615 (patch) | |
tree | 74bf028c686927603c36dba79e2eda0b9e72cc70 /drivers/net/dsa/mv88e6xxx/chip.h | |
parent | mlxsw: spectrum_switchdev: Allow port enslavement to a VLAN-unaware bridge (diff) | |
download | linux-dev-294d711ee8c04fb2baa704cae15a7d039bb50615.tar.xz linux-dev-294d711ee8c04fb2baa704cae15a7d039bb50615.zip |
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>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx/chip.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h index 97d7915f32c7..d6a1391dc268 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.h +++ b/drivers/net/dsa/mv88e6xxx/chip.h @@ -15,6 +15,7 @@ #include <linux/if_vlan.h> #include <linux/irq.h> #include <linux/gpio/consumer.h> +#include <linux/kthread.h> #include <linux/phy.h> #include <linux/ptp_clock_kernel.h> #include <linux/timecounter.h> @@ -245,6 +246,8 @@ struct mv88e6xxx_chip { int watchdog_irq; int atu_prob_irq; int vtu_prob_irq; + struct kthread_worker *kworker; + struct kthread_delayed_work irq_poll_work; /* GPIO resources */ u8 gpio_data[2]; |