On Thu, Feb 09, 2017 at 10:52:15AM -0500, Vivien Didelot wrote:
> Hi Andrew,
> 
> Andrew Lunn <and...@lunn.ch> writes:
> 
> > +static int mv88e6097_watchdog_action(struct mv88e6xxx_chip *chip, int irq)
> > +{
> > +   u16 reg;
> > +
> > +   mv88e6xxx_g2_read(chip, GLOBAL2_WDOG_CONTROL, &reg);
> 
> We should not ignore read errors.

Hi Vivien

We are in the middle of an interrupt handler. If we get a read error
here, we are probable one step from a "Kernel Panic -- not syncing:
attempted to kill idle task".

About the only thing which makes sense is to print a warning
message. But that really should happen in one central place,
mv88e6xxx_smi_read(), so it covers all reads everywhere.

> > +   dev_info(chip->dev, "Watchdog event: 0x%04x", reg);
> > +
> > +   return IRQ_HANDLED;
> > +}
> > +
> > +static void mv88e6097_watchdog_free(struct mv88e6xxx_chip *chip)
> > +{
> > +   u16 reg;
> > +
> > +   mv88e6xxx_g2_read(chip, GLOBAL2_WDOG_CONTROL, &reg);
> > +
> > +   reg &= ~(GLOBAL2_WDOG_CONTROL_EGRESS_ENABLE |
> > +            GLOBAL2_WDOG_CONTROL_QC_ENABLE);
> > +
> > +   mv88e6xxx_g2_write(chip, GLOBAL2_WDOG_CONTROL, reg);
> 
> Same here.

Again, and do what? We are in the process of unbinding/unloading the
kernel module. We are going to keep going whatever, and there is no
mechanism to say an error occurred at this point, other than a printk.
Again, such a printk should be in mv88e6xxx_smi_write().

       Andrew

Reply via email to