From: Anson Huang <anson.huang@nxp.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>,
"rui.zhang@intel.com" <rui.zhang@intel.com>,
"amit.kucheria@verdurent.com" <amit.kucheria@verdurent.com>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: dl-linux-imx <linux-imx@nxp.com>
Subject: RE: [PATCH 1/2] thermal: qoriq: Use devm_add_action_or_reset() to handle all cleanups
Date: Thu, 12 Mar 2020 12:19:37 +0000 [thread overview]
Message-ID: <DB3PR0402MB39169041ED7CDA2C4DBD4833F5FD0@DB3PR0402MB3916.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <831cd71d-04dc-834f-fa28-6091a186dce3@linaro.org>
Hi, Daniel
> Subject: Re: [PATCH 1/2] thermal: qoriq: Use devm_add_action_or_reset() to
> handle all cleanups
>
> On 12/03/2020 12:47, Anson Huang wrote:
> > Hi, Daniel
> >
> >> Subject: Re: [PATCH 1/2] thermal: qoriq: Use
> >> devm_add_action_or_reset() to handle all cleanups
> >>
> >> On 11/03/2020 06:07, Anson Huang wrote:
> >>> Use devm_add_action_or_reset() to handle all cleanups of failure in
> >>> .probe and .remove, then .remove callback can be dropped.
> >>
> >> Is this change compatible with the tristate?
> >
> > I think so, any concern need me to double confirm?
>
> TBH, I discovered the function with your patch. My concern is if the callback
> is called when unloading the module.
I think so as per my memory, see similar patches as below:
commit 19ec11a2233d24a7811836fa735203aaccf95a23
Author: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Date: Thu Jul 11 10:29:35 2019 +0200
gpio: em: remove the gpiochip before removing the irq domain
In commit 8764c4ca5049 ("gpio: em: use the managed version of
gpiochip_add_data()") we implicitly altered the ordering of resource
freeing: since gpiochip_remove() calls gpiochip_irqchip_remove()
internally, we now can potentially use the irq_domain after it was
destroyed in the remove() callback (as devm resources are freed after
remove() has returned).
Use devm_add_action_or_reset() to keep the ordering right and entirely
kill the remove() callback in the driver.
commit d9aa5ca429ad30dde96e5966173d18004f16f312
Author: Alexandre Belloni <alexandre.belloni@bootlin.com>
Date: Fri Apr 19 10:25:01 2019 +0200
rtc: ds2404: simplify .probe and remove .remove
Use devm_add_action_or_reset to simplify .probe and remove .remove
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-ds2404.c
Thanks,
Anson
next prev parent reply other threads:[~2020-03-12 12:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 5:07 [PATCH 1/2] thermal: qoriq: Use devm_add_action_or_reset() to handle all cleanups Anson Huang
2020-03-11 5:07 ` [PATCH 2/2] thermal: qoriq: Sort includes alphabetically Anson Huang
2020-03-11 8:57 ` Amit Kucheria
2020-03-11 8:59 ` [PATCH 1/2] thermal: qoriq: Use devm_add_action_or_reset() to handle all cleanups Amit Kucheria
2020-03-12 11:24 ` Daniel Lezcano
2020-03-12 11:47 ` Anson Huang
2020-03-12 11:56 ` Daniel Lezcano
2020-03-12 12:19 ` Anson Huang [this message]
2020-03-17 1:14 ` Anson Huang
2020-03-17 9:07 ` Daniel Lezcano
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=DB3PR0402MB39169041ED7CDA2C4DBD4833F5FD0@DB3PR0402MB3916.eurprd04.prod.outlook.com \
--to=anson.huang@nxp.com \
--cc=amit.kucheria@verdurent.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).