via-velocity: Fix races on shared interrupts

Previous thread: via-velocity: Remove unused IRQ status parameter from rx_srv and tx_srv by Linux Kernel Mailing List on Tuesday, February 16, 2010 - 6:59 pm. (1 message)

Next thread: b43: Fix throughput regression by Linux Kernel Mailing List on Tuesday, February 16, 2010 - 6:59 pm. (1 message)
From: Linux Kernel Mailing List
Date: Tuesday, February 16, 2010 - 6:59 pm

Gitweb:     http://git.kernel.org/linus/3f2e8d9f13246382fbda6f03178eef867a9bfbe2
Commit:     3f2e8d9f13246382fbda6f03178eef867a9bfbe2
Parent:     39c2ff43ea3830ccc693f965abdace96e514b1c5
Author:     Simon Kagstrom <simon.kagstrom@netinsight.net>
AuthorDate: Tue Feb 9 23:38:25 2010 +0000
Committer:  David S. Miller <davem@davemloft.net>
CommitDate: Wed Feb 10 10:55:02 2010 -0800

    via-velocity: Fix races on shared interrupts
    
    This patch fixes two potential races in the velocity driver:
    
    * Move the ACK and error handler to the interrupt handler. This fixes a
      potential race with shared interrupts when the other device interrupts
      before the NAPI poll handler has finished. As the velocity driver hasn't
      acked it's own interrupt, it will then steal the interrupt from the
      other device.
    
    * Use spin_lock_irqsave in velocity_poll. In the current code, the
      interrupt handler will deadlock if e.g., the NAPI poll handler is
      executing when an interrupt (for another device) comes in since it
      tries to take the already held lock.
    
      Also unlock the spinlock only after enabling the interrupt in
      velocity_poll.
    
    The error path is moved to the interrupt handler since this is where the
    ISR is checked now.
    
    Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
    Signed-off-by: Anders Grafstrom <anders.grafstrom@netinsight.net>
    Signed-off-by: David S. Miller <davem@davemloft.net>
---
 drivers/net/via-velocity.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index 54bafda..317aa34 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -2148,16 +2148,9 @@ static int velocity_poll(struct napi_struct *napi, int budget)
 	struct velocity_info *vptr = container_of(napi,
 			struct velocity_info, napi);
 	unsigned int rx_done;
-	u32 ...
Previous thread: via-velocity: Remove unused IRQ status parameter from rx_srv and tx_srv by Linux Kernel Mailing List on Tuesday, February 16, 2010 - 6:59 pm. (1 message)

Next thread: b43: Fix throughput regression by Linux Kernel Mailing List on Tuesday, February 16, 2010 - 6:59 pm. (1 message)