lkml.org 
[lkml]   [2022]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] mfd: axp20x: Do not sleep in the power off handler
From
On 11/7/22 12:39, Lee Jones wrote:
> On Mon, 07 Nov 2022, Dmitry Osipenko wrote:
>
>> On 11/6/22 00:29, Samuel Holland wrote:
>>> Since commit 856c288b0039 ("ARM: Use do_kernel_power_off()"), the
>>> function axp20x_power_off() now runs inside a RCU read-side critical
>>> section, so it is not allowed to call msleep(). Use mdelay() instead.
>>>
>>> Fixes: 856c288b0039 ("ARM: Use do_kernel_power_off()")
>>> Signed-off-by: Samuel Holland <samuel@sholland.org>
>>> ---
>>>
>>> drivers/mfd/axp20x.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
>>> index 88a212a8168c..880c41fa7021 100644
>>> --- a/drivers/mfd/axp20x.c
>>> +++ b/drivers/mfd/axp20x.c
>>> @@ -842,7 +842,7 @@ static void axp20x_power_off(void)
>>> AXP20X_OFF);
>>>
>>> /* Give capacitors etc. time to drain to avoid kernel panic msg. */
>>> - msleep(500);
>>> + mdelay(500);
>>> }
>>>
>>> int axp20x_match_device(struct axp20x_dev *axp20x)
>>
>> ARM was doing local_irq_disable() on power-off before
>> do_kernel_power_off() was introduced, so this should've been incorrect
>> for a couple years at least. If I'm not missing anything.
>
> Is that a review? Care to provide a tag?

It's a review and my point was that the "Fixes" tag in this patch
doesn't look correct. But this is minor comment, otherwise patch looks
okay. Hope that the relevant I2C controller driver supports atomic
transfer that are required for power-off to work.

Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>

--
Best regards,
Dmitry

\
 
 \ /
  Last update: 2022-11-07 12:40    [W:0.050 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site