Re: [WARNING] local_bh_enable with irqs disabled:

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Guennadi Liakhovetski <g.liakhovetski@...>
Cc: Andrew Morton <akpm@...>, <linux-kernel@...>
Date: Tuesday, June 10, 2008 - 8:15 pm

On Thursday 05 June 2008, Guennadi Liakhovetski wrote:

Right.  Obviously that wasn't tested with "rmmod" of a modular
GPIO expander ... I only have one board which supports such an
expander right now, and it's not been in use recently.

A fix is obvious; any problems with what's below?

- Dave


--- g26.orig/drivers/gpio/gpiolib.c	2008-06-10 16:56:01.000000000 -0700
+++ g26/drivers/gpio/gpiolib.c	2008-06-10 16:55:39.000000000 -0700
@@ -726,12 +726,15 @@ int gpiochip_remove(struct gpio_chip *ch
 		}
 	}
 	if (status == 0) {
-		gpiochip_unexport(chip);
 		for (id = chip->base; id < chip->base + chip->ngpio; id++)
 			gpio_desc[id].chip = NULL;
 	}
 
 	spin_unlock_irqrestore(&gpio_lock, flags);
+
+	if (status == 0)
+		gpiochip_unexport(chip);
+
 	return status;
 }
 EXPORT_SYMBOL_GPL(gpiochip_remove);

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[WARNING] local_bh_enable with irqs disabled:, Guennadi Liakhovetski, (Tue Jun 3, 9:32 am)
Re: [WARNING] local_bh_enable with irqs disabled:, Andrew Morton, (Fri Jun 6, 1:39 am)
Re: [WARNING] local_bh_enable with irqs disabled:, Guennadi Liakhovetski, (Fri Jun 6, 2:11 am)
Re: [WARNING] local_bh_enable with irqs disabled:, David Brownell, (Tue Jun 10, 8:15 pm)
Re: [WARNING] local_bh_enable with irqs disabled:, David Brownell, (Thu Jun 12, 2:28 am)
Re: [WARNING] local_bh_enable with irqs disabled:, Andrew Morton, (Fri Jun 6, 2:41 am)
Re: [WARNING] local_bh_enable with irqs disabled:, David Brownell, (Thu Jun 12, 3:00 pm)
Re: [WARNING] local_bh_enable with irqs disabled:, Andrew Morton, (Thu Jun 12, 3:27 pm)