From: Andrew Lunn <andrew@lunn.ch>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: David Miller <davem@davemloft.net>, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH v3 net-next 1/2] net: dsa: mv88e6xxx: Add watchdog interrupt handler
Date: Thu, 9 Feb 2017 17:12:31 +0100 [thread overview]
Message-ID: <20170209161231.GC29882@lunn.ch> (raw)
In-Reply-To: <878tpfuztc.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me>
On Thu, Feb 09, 2017 at 10:52:15AM -0500, Vivien Didelot wrote:
> Hi Andrew,
>
> Andrew Lunn <andrew@lunn.ch> 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.
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 &= ~(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
next prev parent reply other threads:[~2017-02-09 16:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-08 23:03 [PATCH v3 net-next 0/2] mv88e6xxx Watchdog support Andrew Lunn
2017-02-08 23:03 ` [PATCH v3 net-next 1/2] net: dsa: mv88e6xxx: Add watchdog interrupt handler Andrew Lunn
2017-02-09 15:52 ` Vivien Didelot
2017-02-09 16:12 ` Andrew Lunn [this message]
2017-02-09 16:33 ` Vivien Didelot
2017-02-08 23:03 ` [PATCH v3 net-next 2/2] net: dsa: mv88e6xxx: Add mv88e6390 watchdog interrupt support Andrew Lunn
2017-02-09 15:46 ` Vivien Didelot
2017-02-09 16:28 ` Andrew Lunn
2017-02-13 14:30 ` [PATCH v3 net-next 0/2] mv88e6xxx Watchdog support David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170209161231.GC29882@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).