From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] net: fec: don't ack masked interrupt events
Date: Fri, 26 Aug 2016 17:18:12 +0100 [thread overview]
Message-ID: <20160826161812.GV1041@n2100.armlinux.org.uk> (raw)
In-Reply-To: <1472226818.27333.22.camel@pengutronix.de>
On Fri, Aug 26, 2016 at 05:53:38PM +0200, Lucas Stach wrote:
> Sorry, please ignore the FEC patches. Those are test patches still
> residing in my to-send folder. Sorry for the noise.
This patch actually looks correct: you are indeed correct that the
driver can end up with a packet sitting waiting to be received.
All it will take is a correctly timed MII interrupt event with a
NAPI just coming to the end of its processing.
So, I'd encourage this to be applied - but obviously when sent to
netdev rather than the DRI mailing list!
>
> Am Freitag, den 26.08.2016, 17:49 +0200 schrieb Lucas Stach:
> > The FEC doesn't have a real interrupt status register, that takes
> > into account the mask status of the IRQ. The driver reads the raw
> > interrupt event register, which also reports events for masked
> > IRQs.
> >
> > The driver needs to apply the current mask itself, to avoid acking
> > IRQs that are currently masked, as NAPI relies on the masking to
> > hide the IRQs. The current behavior of just acking all interrupts
> > regardless of their mask status opens the driver up the "rotting
> > packet" race-window, as described in the original NAPI-HOWTO, which
> > has been observed in the wild.
> >
> > Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> > ---
> > drivers/net/ethernet/freescale/fec_main.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> > index 01f7e811739b..498264969e89 100644
> > --- a/drivers/net/ethernet/freescale/fec_main.c
> > +++ b/drivers/net/ethernet/freescale/fec_main.c
> > @@ -1572,7 +1572,8 @@ fec_enet_interrupt(int irq, void *dev_id)
> > uint int_events;
> > irqreturn_t ret = IRQ_NONE;
> >
> > - int_events = readl(fep->hwp + FEC_IEVENT);
> > + int_events = readl_relaxed(fep->hwp + FEC_IEVENT) &
> > + readl_relaxed(fep->hwp + FEC_IMASK);
> > writel(int_events, fep->hwp + FEC_IEVENT);
> > fec_enet_collect_events(fep, int_events);
> >
>
>
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-08-26 16:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-26 15:49 [PATCH 1/2] drm/etnaviv: fail probe if core or bus clock are absent Lucas Stach
2016-08-26 15:49 ` [PATCH 1/2] net: fec: don't ack masked interrupt events Lucas Stach
2016-08-26 15:53 ` Lucas Stach
2016-08-26 16:18 ` Russell King - ARM Linux [this message]
2016-08-26 15:49 ` [PATCH 2/2] drm/etnaviv: fold various clock enable/disable functions into top ones Lucas Stach
2016-08-26 15:49 ` [PATCH 2/2] net: fec: optimize IRQ handler Lucas Stach
2016-08-26 16:10 ` [PATCH 1/2] drm/etnaviv: fail probe if core or bus clock are absent Russell King - ARM Linux
2016-08-29 10:47 ` Lucas Stach
2016-08-29 10:51 ` Russell King - ARM Linux
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=20160826161812.GV1041@n2100.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=dri-devel@lists.freedesktop.org \
--cc=l.stach@pengutronix.de \
/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