Re: [PATCH/RFC] remove irqs_disabled warning from local_bh_enable

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Michael Buesch
Date: Friday, June 20, 2008 - 9:18 am

On Friday 20 June 2008 18:01:09 Michael Buesch wrote:


However, looking at the driver I think the fix actually is trivial:

Index: wireless-testing/drivers/net/3c59x.c
===================================================================
--- wireless-testing.orig/drivers/net/3c59x.c	2008-05-16 00:26:29.000000000 +0200
+++ wireless-testing/drivers/net/3c59x.c	2008-06-20 18:16:55.000000000 +0200
@@ -1768,9 +1768,10 @@ vortex_timer(unsigned long data)
 	case XCVR_MII: case XCVR_NWAY:
 		{
 			ok = 1;
-			spin_lock_bh(&vp->lock);
+			/* Interrupts are already disabled */
+			spin_lock(&vp->lock);
 			vortex_check_media(dev, 0);
-			spin_unlock_bh(&vp->lock);
+			spin_unlock(&vp->lock);
 		}
 		break;
 	  default:					/* Other media types handled by Tx timeouts. */


vp->lock is also taken in hardware IRQ context, so we _have_ to always
use irqsafe locking. As we run in a timer with IRQs disabled,
we can simply use spin_lock.

-- 
Greetings Michael.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH/RFC] remove irqs_disabled warning from local_bh ..., Michael Buesch, (Fri Jun 20, 9:18 am)