lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 24 Oct 2008 11:28:17 +1100
From:	Ben Nizette <bn@...sdigital.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	david-b@...bell.net, linux-kernel@...r.kernel.org,
	linux-embedded@...r.kernel.org
Subject: Re: [PATCH v2 RESEND] gpiolib: Add pin change notification


On Tue, 2008-10-21 at 13:31 -0700, Andrew Morton wrote:
> On Tue, 21 Oct 2008 09:50:06 +1100
> Ben Nizette <bn@...sdigital.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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ