Le 02/04/17 à 12:38, Andrew Lunn a écrit : > The switch contains a watchdog looking for issues with the internal > gubbins of the switch. Hook the interrupt the watchdog triggers and > log the value of the control register indicating why the watchdog > fired. The watchdog can only be cleared with a switch reset, which > will destroy the current configuration. Rather than doing this, just > disable the interrupt. > > Signed-off-by: Andrew Lunn <and...@lunn.ch> > --- > drivers/net/dsa/mv88e6xxx/global2.c | 64 > ++++++++++++++++++++++++++++++++++- > drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 9 +++++ > 2 files changed, 72 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/dsa/mv88e6xxx/global2.c > b/drivers/net/dsa/mv88e6xxx/global2.c > index 50e4e0be4227..8013d8e18e3f 100644 > --- a/drivers/net/dsa/mv88e6xxx/global2.c > +++ b/drivers/net/dsa/mv88e6xxx/global2.c > @@ -649,6 +649,66 @@ int mv88e6xxx_g2_smi_phy_write(struct mv88e6xxx_chip > *chip, > return mv88e6xxx_g2_smi_phy_write_c22(chip, addr, reg, val, external); > } > > +static irqreturn_t mv88e6xxx_g2_watchdog_thread_fn(int irq, void *dev_id) > +{ > + u16 reg; > + > + struct mv88e6xxx_chip *chip = dev_id; > + > + mv88e6xxx_g2_read(chip, GLOBAL2_WDOG_CONTROL, ®); > + > + dev_info(chip->dev, "Watchdog event: %04x", reg);
Should this be 0x%04x just to illustrate the value is hexadecimal? And should this be dev_info_once()? -- Florian