lkml.org 
[lkml]   [2008]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch for 2.6.25? 3/3] skge napi->poll() locking bug
Date
On 27.3.2008, you wrote:
> From: Marin Mitov <mitov@issp.bas.bg>
>
> According to: Documentation/networking/netdevices.txt:
>
> <cite>
> napi->poll:
> ..........
> Context: softirq
> will be called with interrupts disabled by netconsole.
> </cite>
>
> napi->poll() could be called either with interrupts enabled
> (in softirq context) or disabled (by netconsole), so the irq flag
> should be preserved.
>
> Inspired by Ingo's resent forcedeth patch :-)
>
As far as skge driver has not changed since 2.6.24, the
patch could be applied to the stable 2.6.24.5 release too.

Marin Mitov

> Signed-off-by: Marin Mitov <mitov@issp.bas.bg>
> Acked-by: David S. Miller <davem@davemloft.net>
> Cc: Jeff Garzik <jeff@garzik.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> drivers/net/skge.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff -puN drivers/net/skge.c~skge-napi-poll-locking-bug drivers/net/skge.c
> --- a/drivers/net/skge.c~skge-napi-poll-locking-bug
> +++ a/drivers/net/skge.c
> @@ -3199,12 +3199,14 @@ static int skge_poll(struct napi_struct
> skge_write8(hw, Q_ADDR(rxqaddr[skge->port], Q_CSR), CSR_START);
>
> if (work_done < to_do) {
> - spin_lock_irq(&hw->hw_lock);
> + unsigned long flags;
> +
> + spin_lock_irqsave(&hw->hw_lock, flags);
> __netif_rx_complete(dev, napi);
> hw->intr_mask |= napimask[skge->port];
> skge_write32(hw, B0_IMSK, hw->intr_mask);
> skge_read32(hw, B0_IMSK);
> - spin_unlock_irq(&hw->hw_lock);
> + spin_unlock_irqrestore(&hw->hw_lock, flags);
> }
>
> return work_done;
> _
>




\
 
 \ /
  Last update: 2008-03-27 11:05    [W:0.116 / U:1.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site