lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0fe5680d-a41b-3c03-72a4-1a505788a9cc@sholland.org>
Date:   Mon, 7 Nov 2022 08:33:27 -0600
From:   Samuel Holland <samuel@...lland.org>
To:     Dmitry Osipenko <dmitry.osipenko@...labora.com>,
        Chen-Yu Tsai <wens@...e.org>, Lee Jones <lee@...nel.org>
Cc:     Michał Mirosław <mirq-linux@...e.qmqm.pl>,
        "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
        "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mfd: axp20x: Do not sleep in the power off handler

On 11/6/22 16:40, 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@...lland.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.

Yes, you're right. Then the correct tag is

Fixes: 179dc63d06c5 ("mfd: axp20x: Add a 500ms delay at the end of
axp20x_power_off")

Regards,
Samuel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ