[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB3PR0402MB39168E9B3397BB0E7339802EF5F60@DB3PR0402MB3916.eurprd04.prod.outlook.com>
Date: Tue, 17 Mar 2020 01:14:44 +0000
From: Anson Huang <anson.huang@....com>
To: Daniel Lezcano <daniel.lezcano@...aro.org>,
"rui.zhang@...el.com" <rui.zhang@...el.com>,
"amit.kucheria@...durent.com" <amit.kucheria@...durent.com>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: dl-linux-imx <linux-imx@....com>
Subject: RE: [PATCH 1/2] thermal: qoriq: Use devm_add_action_or_reset() to
handle all cleanups
Hi, Daniel
> Subject: RE: [PATCH 1/2] thermal: qoriq: Use devm_add_action_or_reset() to
> handle all cleanups
>
> 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@...libre.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@...tlin.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@...tlin.com>
>
> drivers/rtc/rtc-ds2404.c
Any further concern?
Thanks,
Anson
Powered by blists - more mailing lists