[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120717165346.GH4477@opensource.wolfsonmicro.com>
Date: Tue, 17 Jul 2012 17:53:46 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Laxman Dewangan <ldewangan@...dia.com>
Cc: "grant.likely@...retlab.ca" <grant.likely@...retlab.ca>,
"linus.walleij@...ricsson.com" <linus.walleij@...ricsson.com>,
"sameo@...ux.intel.com" <sameo@...ux.intel.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Stephen Warren <swarren@...dia.com>
Subject: Re: [PATCH V2 1/6] mfd: tps6586x:use devm managed resources
On Tue, Jul 17, 2012 at 10:12:39AM +0530, Laxman Dewangan wrote:
> On Tuesday 17 July 2012 01:31 AM, Mark Brown wrote:
> >On Mon, Jul 16, 2012 at 12:21:45PM +0530, Laxman Dewangan wrote:
> >>- ret = request_threaded_irq(irq, NULL, tps6586x_irq, IRQF_ONESHOT,
> >>- "tps6586x", tps6586x);
> >>+ ret = devm_request_threaded_irq(tps6586x->dev, irq, NULL, tps6586x_irq,
> >>+ IRQF_ONESHOT, "tps6586x", tps6586x);
> >Are you sure this is safe - what guarantees that we can't get an
> >interrupt while tearing the device down?
> I think device_remove will get called before the managed resource
> get freed.
> So do we need to call disable_irq() in remove() to avoid any interrupts?
That would be very rude if the IRQ happened to get shared, though that's
not possible at the moment. In general it's pretty hard to use devm_
IRQs safely, it's normally safest to avoid them due to the issues with
ensuring that the interrupt handler is safe to be called even while the
device is being torn down.
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists