From: peter.chen@freescale.com (Peter Chen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] chipidea: Use devm_request_irq()
Date: Thu, 1 Aug 2013 09:33:12 +0800 [thread overview]
Message-ID: <20130801013311.GH8540@nchen-desktop> (raw)
In-Reply-To: <20130731141512.GU2810@htj.dyndns.org>
On Wed, Jul 31, 2013 at 10:15:12AM -0400, Tejun Heo wrote:
> hello,
>
> On Wed, Jul 31, 2013 at 09:55:26PM +0800, Peter Chen wrote:
> > I think the main point is we should allocate managed resource which is used
> > at interrupt handler before devm_request_irq, and all resources used
> > at interrupt
> > handler should be managed.
> >
> > If we use non-managed resource at interrupt handler, but using managed interrupt
> > handler, things still will go wrong if there is an odd (unexpected)
> > interrupt after
> > we finish deactivation at removal.
>
> In general, applying devm partially isn't a good idea. It's very easy
> to get into trouble thanks to release order dependency which isn't
> immediately noticeable and there have been actual bugs caused by that.
> The strategies which seem to work are either
>
> * Convert everything over to devm by wrapping deactivation in a devres
> callback too. As long as your init sequence is sane (ie. irq
> shouldn't be request before things used by irq are ready).
>
> * Allocate all resources using devres but shut down the execution
> engine in the remove_one(). Again, as all releases are controlled
> by devres, you won't have to worry about messing up the release
> sequencing.
>
thanks, Tejun. So, Alex and Fabio, this patch may not be suitable currently,
since many resources at both EHCI and device side are non-managed.
--
Best Regards,
Peter Chen
prev parent reply other threads:[~2013-08-01 1:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1375232669-27846-1-git-send-email-festevam@gmail.com>
[not found] ` <1375232669-27846-2-git-send-email-festevam@gmail.com>
[not found] ` <20130731073306.GZ1754@pengutronix.de>
[not found] ` <20130731082054.GF8540@nchen-desktop>
[not found] ` <20130731084645.GB1754@pengutronix.de>
[not found] ` <20130731090512.GD9858@sirena.org.uk>
2013-07-31 9:44 ` [PATCH 2/2] chipidea: Use devm_request_irq() Uwe Kleine-König
2013-07-31 9:54 ` Tejun Heo
2013-07-31 10:28 ` Uwe Kleine-König
2013-07-31 10:41 ` Tejun Heo
2013-07-31 11:18 ` Mark Brown
2013-07-31 11:32 ` Tejun Heo
2013-07-31 11:50 ` Mark Brown
2013-07-31 11:55 ` Tejun Heo
2013-07-31 13:27 ` Mark Brown
2013-07-31 13:42 ` Tejun Heo
2013-07-31 13:57 ` Mark Brown
2013-07-31 14:07 ` Tejun Heo
2013-07-31 15:25 ` Mark Brown
2013-07-31 15:29 ` Tejun Heo
2013-07-31 16:52 ` Mark Brown
2013-07-31 13:55 ` Peter Chen
2013-07-31 14:15 ` Tejun Heo
2013-08-01 1:33 ` Peter Chen [this message]
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=20130801013311.GH8540@nchen-desktop \
--to=peter.chen@freescale.com \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox