path: root/drivers/net
diff options
authorVivien Didelot <vivien.didelot@gmail.com>2019-08-28 14:55:11 -0400
committerDavid S. Miller <davem@davemloft.net>2019-08-29 17:23:54 -0700
commit42aa15cf05c0a47cc5807c21c7ff471b80cad371 (patch)
tree569e6f1ea2606aaee9a0109f0e4955788ee616ad /drivers/net
parentnet: dsa: mv88e6xxx: keep CMODE writable code private (diff)
net: dsa: mv88e6xxx: fix freeing unused SERDES IRQ
Now mv88e6xxx does not enable its ports at setup itself and let the DSA core handle this, unused ports are disabled without being powered on first. While that is expected, the SERDES powering code was assuming that a port was already set up before powering it down, resulting in freeing an unused IRQ. The patch fixes this assumption. Fixes: b759f528ca3d ("net: dsa: mv88e6xxx: enable SERDES after setup") Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com> Reviewed-by: Marek BehĂșn <marek.behun@nic.cz> Tested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 6525075f6bd3..c648f9fbfa59 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2070,7 +2070,8 @@ static int mv88e6xxx_serdes_power(struct mv88e6xxx_chip *chip, int port,
if (chip->info->ops->serdes_irq_setup)
err = chip->info->ops->serdes_irq_setup(chip, port);
} else {
- if (chip->info->ops->serdes_irq_free)
+ if (chip->info->ops->serdes_irq_free &&
+ chip->ports[port].serdes_irq)
chip->info->ops->serdes_irq_free(chip, port);
err = chip->info->ops->serdes_power(chip, port, false);