Re: [PATCH v3 net-next 1/2] net: dsa: mv88e6xxx: Add watchdog interrupt handler

2017-02-09 Thread Andrew Lunn
On Thu, Feb 09, 2017 at 10:52:15AM -0500, Vivien Didelot wrote: > Hi Andrew, > > Andrew Lunn writes: > > > +static int mv88e6097_watchdog_action(struct mv88e6xxx_chip *chip, int irq) > > +{ > > + u16 reg; > > + > > + mv88e6xxx_g2_read(chip, GLOBAL2_WDOG_CONTROL, ®); > > We should not ignore

Re: [PATCH v3 net-next 1/2] net: dsa: mv88e6xxx: Add watchdog interrupt handler

2017-02-09 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> > +static int mv88e6097_watchdog_action(struct mv88e6xxx_chip *chip, int irq) >> > +{ >> > + u16 reg; >> > + >> > + mv88e6xxx_g2_read(chip, GLOBAL2_WDOG_CONTROL, ®); >> >> We should not ignore read errors. > > We are in the middle of an interrupt handler. If

Re: [PATCH v3 net-next 1/2] net: dsa: mv88e6xxx: Add watchdog interrupt handler

2017-02-09 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > +static int mv88e6097_watchdog_action(struct mv88e6xxx_chip *chip, int irq) > +{ > + u16 reg; > + > + mv88e6xxx_g2_read(chip, GLOBAL2_WDOG_CONTROL, ®); We should not ignore read errors. > + > + dev_info(chip->dev, "Watchdog event: 0x%04x", reg); > +

[PATCH v3 net-next 1/2] net: dsa: mv88e6xxx: Add watchdog interrupt handler

2017-02-08 Thread Andrew Lunn
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 confi