All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: [WARNING] local_bh_enable with irqs disabled:
Date: Tue, 10 Jun 2008 17:15:52 -0700	[thread overview]
Message-ID: <200806101715.52830.david-b@pacbell.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0806060751240.14536@axis700.grange>

On Thursday 05 June 2008, Guennadi Liakhovetski wrote:
> Sorry, this was a 2.6.26-rc3 based kernel with the gpio-sysfs patch from 
> David, e.g., http://marc.info/?l=linux-kernel&m=121107105300923&w=2,
> which introduces a call to device_unregister via gpiochip_unexport(chip); 
> in gpiochip_remove. 

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);


  parent reply	other threads:[~2008-06-11  0:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-03 13:32 [WARNING] local_bh_enable with irqs disabled: Guennadi Liakhovetski
2008-06-06  5:39 ` Andrew Morton
2008-06-06  6:11   ` Guennadi Liakhovetski
2008-06-06  6:41     ` Andrew Morton
2008-06-12 19:00       ` David Brownell
2008-06-12 19:27         ` Andrew Morton
2008-06-11  0:15     ` David Brownell [this message]
2008-06-12  6:28       ` David Brownell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200806101715.52830.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=akpm@linux-foundation.org \
    --cc=g.liakhovetski@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.