LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ben Nizette <bn@niasdigital.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: david-b@pacbell.net, linux-kernel@vger.kernel.org,
	linux-embedded@vger.kernel.org
Subject: Re: [PATCH v2 RESEND] gpiolib: Add pin change notification
Date: Fri, 24 Oct 2008 11:28:17 +1100	[thread overview]
Message-ID: <1224808097.7082.3.camel@moss.renham> (raw)
In-Reply-To: <20081021133106.be5cc01c.akpm@linux-foundation.org>


On Tue, 2008-10-21 at 13:31 -0700, Andrew Morton wrote:
> On Tue, 21 Oct 2008 09:50:06 +1100
> Ben Nizette <bn@niasdigital.com> wrote:
> > +static irqreturn_t gpio_irq_handler(int irq, void *dev_id)
> > +{
> > +	struct gpio_desc *desc = dev_id;
> > +	int gpio = desc - gpio_desc;
> > +	int new, old;
> > +
> > +	if (!gpio_is_valid(gpio))
> > +		return IRQ_NONE;
> > +
> > +	new = gpio_get_value(gpio);
> > +	old = desc->val;
> > +
> > +	if ((new && !old && test_bit(ASYNC_RISING, &desc->flags)) ||
> > +	    (!new && old && test_bit(ASYNC_FALLING, &desc->flags)))
> > +		sysfs_notify(&desc->dev->kobj, NULL, "value");
> 
> eekeekeek!  sysfs_notify() does mutex_lock() and will die horridly if
> called from an interrupt handler.
> 
> You should have got a storm of warnings when runtime testing this code.
> Please ensure that all debug options are enabled when testing code. 
> Documentation/SubmitChecklist has help.

0_o yea that isn't great...  Thanks - shall respin and repost shortly.


	--Ben.


  reply	other threads:[~2008-10-24  0:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-20 22:50 Ben Nizette
2008-10-21 20:31 ` Andrew Morton
2008-10-24  0:28   ` Ben Nizette [this message]
2008-10-27 19:46 ` David Brownell
2008-10-27 22:18   ` Ben Nizette

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=1224808097.7082.3.camel@moss.renham \
    --to=bn@niasdigital.com \
    --cc=akpm@linux-foundation.org \
    --cc=david-b@pacbell.net \
    --cc=linux-embedded@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH v2 RESEND] gpiolib: Add pin change notification' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).