All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: dsa: mv88e6xxx: fix lockup on warm boot
@ 2020-02-28 19:39 Russell King
  2020-02-28 19:52 ` Andrew Lunn
  2020-03-01  5:46 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Russell King @ 2020-02-28 19:39 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vivien Didelot; +Cc: David S. Miller, netdev

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.")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
 drivers/net/dsa/mv88e6xxx/global2.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx/global2.c b/drivers/net/dsa/mv88e6xxx/global2.c
index 01503014b1ee..8fd483020c5b 100644
--- a/drivers/net/dsa/mv88e6xxx/global2.c
+++ b/drivers/net/dsa/mv88e6xxx/global2.c
@@ -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);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: dsa: mv88e6xxx: fix lockup on warm boot
  2020-02-28 19:39 [PATCH net] net: dsa: mv88e6xxx: fix lockup on warm boot Russell King
@ 2020-02-28 19:52 ` Andrew Lunn
  2020-03-01  5:46 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2020-02-28 19:52 UTC (permalink / raw)
  To: Russell King; +Cc: Florian Fainelli, Vivien Didelot, David S. Miller, netdev

On Fri, Feb 28, 2020 at 07:39:41PM +0000, Russell King wrote:
> 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.")
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: dsa: mv88e6xxx: fix lockup on warm boot
  2020-02-28 19:39 [PATCH net] net: dsa: mv88e6xxx: fix lockup on warm boot Russell King
  2020-02-28 19:52 ` Andrew Lunn
@ 2020-03-01  5:46 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-03-01  5:46 UTC (permalink / raw)
  To: rmk+kernel; +Cc: andrew, f.fainelli, vivien.didelot, netdev

From: Russell King <rmk+kernel@armlinux.org.uk>
Date: Fri, 28 Feb 2020 19:39:41 +0000

> 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.")
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-01  5:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-28 19:39 [PATCH net] net: dsa: mv88e6xxx: fix lockup on warm boot Russell King
2020-02-28 19:52 ` Andrew Lunn
2020-03-01  5:46 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.