mfd: axp20x: Do not sleep in the power off handler
authorSamuel Holland <samuel@sholland.org>
Sat, 5 Nov 2022 21:29:09 +0000 (16:29 -0500)
committerLee Jones <lee@kernel.org>
Wed, 7 Dec 2022 13:28:10 +0000 (13:28 +0000)
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>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20221105212909.6526-1-samuel@sholland.org
drivers/mfd/axp20x.c

index 88a212a..880c41f 100644 (file)
@@ -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)