Re: [PATCH net] ravb: Fix int mask value overwritten issue

2015-11-16 Thread David Miller
From: Yoshihiro Kaneko 
Date: Fri, 13 Nov 2015 19:24:49 +0900

> From: Masaru Nagai 
> 
> When RX/TX interrupt for Network Control queue and Best Effort queue
> is issued at the same time, the interrupt mask of Network Control
> queue will be reset when the mask of Best Effort queue is set.
> This patch fixes this problem.
> 
> Signed-off-by: Masaru Nagai 
> Signed-off-by: Yoshihiro Kaneko 

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net] ravb: Fix int mask value overwritten issue

2015-11-13 Thread Simon Horman
On Fri, Nov 13, 2015 at 11:45:28AM +0100, Geert Uytterhoeven wrote:
> Hi Kaneko-san,
> 
> On Fri, Nov 13, 2015 at 11:24 AM, Yoshihiro Kaneko
>  wrote:
> > From: Masaru Nagai 
> >
> > When RX/TX interrupt for Network Control queue and Best Effort queue
> > is issued at the same time, the interrupt mask of Network Control
> > queue will be reset when the mask of Best Effort queue is set.
> 
> Nice catch!
> 
> At first I was a bit puzzled why this would make a difference, but
> the key is "will be reset in the next iteration of the for loop", which
> falls outside of the visible context.
> 
> > This patch fixes this problem.
> >
> > Signed-off-by: Masaru Nagai 
> > Signed-off-by: Yoshihiro Kaneko 
> 
> Acked-by: Geert Uytterhoeven 

Acked-by: Simon Horman 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net] ravb: Fix int mask value overwritten issue

2015-11-13 Thread Yoshihiro Kaneko
From: Masaru Nagai 

When RX/TX interrupt for Network Control queue and Best Effort queue
is issued at the same time, the interrupt mask of Network Control
queue will be reset when the mask of Best Effort queue is set.
This patch fixes this problem.

Signed-off-by: Masaru Nagai 
Signed-off-by: Yoshihiro Kaneko 
---

This patch is based on the master branch of David Miller's networking tree.

 drivers/net/ethernet/renesas/ravb_main.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/renesas/ravb_main.c 
b/drivers/net/ethernet/renesas/ravb_main.c
index aa7b208..7180e26 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -733,8 +733,10 @@ static irqreturn_t ravb_interrupt(int irq, void *dev_id)
((tis  & tic)  & BIT(q))) {
if (napi_schedule_prep(>napi[q])) {
/* Mask RX and TX interrupts */
-   ravb_write(ndev, ric0 & ~BIT(q), RIC0);
-   ravb_write(ndev, tic  & ~BIT(q), TIC);
+   ric0 &= ~BIT(q);
+   tic &= ~BIT(q);
+   ravb_write(ndev, ric0, RIC0);
+   ravb_write(ndev, tic, TIC);
__napi_schedule(>napi[q]);
} else {
netdev_warn(ndev,
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net] ravb: Fix int mask value overwritten issue

2015-11-13 Thread Geert Uytterhoeven
Hi Kaneko-san,

On Fri, Nov 13, 2015 at 11:24 AM, Yoshihiro Kaneko
 wrote:
> From: Masaru Nagai 
>
> When RX/TX interrupt for Network Control queue and Best Effort queue
> is issued at the same time, the interrupt mask of Network Control
> queue will be reset when the mask of Best Effort queue is set.

Nice catch!

At first I was a bit puzzled why this would make a difference, but
the key is "will be reset in the next iteration of the for loop", which
falls outside of the visible context.

> This patch fixes this problem.
>
> Signed-off-by: Masaru Nagai 
> Signed-off-by: Yoshihiro Kaneko 

Acked-by: Geert Uytterhoeven 

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html