Browse Source

net: dsa: mv88e6xxx: Hold the mutex while freeing g1 interrupts

Freeing interrupts requires switch register access to mask the
interrupts. Hence we must hold the register mutex.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Andrew Lunn 8 years ago
parent
commit
61f7c3f803
1 changed files with 4 additions and 1 deletions
  1. 4 1
      drivers/net/dsa/mv88e6xxx/chip.c

+ 4 - 1
drivers/net/dsa/mv88e6xxx/chip.c

@@ -3916,8 +3916,11 @@ out_g2_irq:
 	if (mv88e6xxx_has(chip, MV88E6XXX_FLAG_G2_INT) && chip->irq > 0)
 		mv88e6xxx_g2_irq_free(chip);
 out_g1_irq:
-	if (chip->irq > 0)
+	if (chip->irq > 0) {
+		mutex_lock(&chip->reg_lock);
 		mv88e6xxx_g1_irq_free(chip);
+		mutex_unlock(&chip->reg_lock);
+	}
 out:
 	return err;
 }