Re: [PATCH 1/2] thermal: qoriq: Use devm_add_action_or_reset() to handle all cleanups

From: Daniel Lezcano
Date: Tue Mar 17 2020 - 05:07:30 EST


On 17/03/2020 02:14, Anson Huang wrote:
> Hi, Daniel
>
>> Subject: RE: [PATCH 1/2] thermal: qoriq: Use devm_add_action_or_reset() to
>> handle all cleanups
>>

[ ... ]

>>>>> 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@xxxxxxxxxxxx>
>> 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@xxxxxxxxxxx>
>> 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@xxxxxxxxxxx>
>>
>> drivers/rtc/rtc-ds2404.c
>
> Any further concern?

No more concerns, I've applied the patches.

Thanks
-- Daniel


--
<http://www.linaro.org/> Linaro.org â Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog