Skip to contentSkip to conversation

net: dsa: mv88e6xxx: fix lockup on warm boot

PATCH In review Russell King 3 participants 3 messages Feb 28, 2020 – Mar 1, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: mv88e6xxx: fix lockup on warm boot

If the switch is not hardware reset on a warm boot, interrupts can be left enabled, and possibly pending. This will cause us to enter an infinite loop trying to service an interrupt we are unable to handle, thereby preventing the kernel from booting.

Ensure that the global 2 interrupt sources are disabled before we claim the parent interrupt.

Observed on the ZII development revision B and C platforms with reworked serdes support, and using reboot -f to reboot the platform.

Fixes dc30c35be720 ("net: dsa: mv88e6xxx: Implement interrupt support.")
---
 drivers/net/dsa/mv88e6xxx/global2.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/dsa/mv88e6xxx/global2.c +7 -1
index 01503014b1ee..8fd483020c5b 100644
@@ -1099,6 +1099,13 @@ int mv88e6xxx_g2_irq_setup(struct mv88e6xxx_chip *chip)
 {
 	int err, irq, virq;
 
+	chip->g2_irq.masked = ~0;
+	mv88e6xxx_reg_lock(chip);
+	err = mv88e6xxx_g2_int_mask(chip, ~chip->g2_irq.masked);
+	mv88e6xxx_reg_unlock(chip);
+	if (err)
+		return err;
+
 	chip->g2_irq.domain = irq_domain_add_simple(
 		chip->dev->of_node, 16, 0, &mv88e6xxx_g2_irq_domain_ops, chip);
 	if (!chip->g2_irq.domain)
@@ -1108,7 +1115,6 @@ int mv88e6xxx_g2_irq_setup(struct mv88e6xxx_chip *chip)
 		irq_create_mapping(chip->g2_irq.domain, irq);
 
 	chip->g2_irq.chip = mv88e6xxx_g2_irq_chip;
-	chip->g2_irq.masked = ~0;
 
 	chip->device_irq = irq_find_mapping(chip->g1_irq.domain,
 					    MV88E6XXX_G1_STS_IRQ_DEVICE);
Signature · 1 line
2.20.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Russell King

If the switch is not hardware reset on a warm boot, interrupts can be left enabled, and possibly pending. This will cause us to enter an infinite loop trying to service an interrupt we are unable to handle, thereby preventing the kernel from booting.

Quoted 8 lines

Ensure that the global 2 interrupt sources are disabled before we claim the parent interrupt.

Observed on the ZII development revision B and C platforms with reworked serdes support, and using reboot -f to reboot the platform.

Fixes dc30c35be720 ("net: dsa: mv88e6xxx: Implement interrupt support.")

Andrew

maintainer
#2 lore raw
In reply to Russell King

From: Russell King <[email protected]>
Date: Fri, 28 Feb 2020 19:39:41 +0000

Quoted 5 lines

If the switch is not hardware reset on a warm boot, interrupts can be left enabled, and possibly pending. This will cause us to enter an infinite loop trying to service an interrupt we are unable to handle, thereby preventing the kernel from booting.

Quoted 8 lines

Ensure that the global 2 interrupt sources are disabled before we claim the parent interrupt.

Observed on the ZII development revision B and C platforms with reworked serdes support, and using reboot -f to reboot the platform.

Fixes dc30c35be720 ("net: dsa: mv88e6xxx: Implement interrupt support.")

Applied and queued up for -stable, thanks.