Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1629704rwb; Mon, 7 Nov 2022 04:05:08 -0800 (PST) X-Google-Smtp-Source: AMsMyM7xY0oYPmvQ7BokBgS/mzcl1d2fS/CUOgNwGYqz0TsSPWudEY7GOT/OHoPkbzgdl9Yofh0g X-Received: by 2002:a05:6402:2893:b0:461:59fd:9b4 with SMTP id eg19-20020a056402289300b0046159fd09b4mr49882976edb.389.1667822707791; Mon, 07 Nov 2022 04:05:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667822707; cv=none; d=google.com; s=arc-20160816; b=eU735bg0TQlzyRqFQIFBYTMQoU0VyVaIO4HJFu7pLpHCzuh0zVkD5k6AWquXlk1ezz UM9/Z38xIvDkFRghw+UzTUCSXuqX++JNScjLrNNv31mqf3Vk+tyPW6uhhipXMwOJkNMn 0EF85lsxnxDOr4fMhJxSG9IQfXIQHwS4FUeTs/4q2QCu6QpqIWka89pkfg7ZrMqS6Esx ZLjdeX2Z9uAdD/x/OtDMaz6odYv73UDModfVl7rNMgRlY1secoohCpFBQSzIqQx0WdAQ diXA4BLoHzspBYGFRpIK+MLnlAqQXTYgrrijNJJ/CMh+colbjLabmCN2yj+0cnFqYuzA KGqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=4h2Hj7N170ceB1VvtdfDuIDuYEHDnrUKCkIpiz1XkYc=; b=X66Mr+zxRq8EnrCFxi9bhhqVy5DdTfB4RhbJqlNYYf0hsQUeZSBUtT3byEu/55HYdA U2wjUTlaFDsqZ19kDez6QynZkODfFle8UokIBlpYB+WxM9KrkwMhVx5szY9hzMyA0Upd V1XRUIiNN4VANsv4mvK6FyUQzrf6j6hLbSHo89fpZHVFmE/BeiBbhQgPCOHt/tEqWioE TI1J+zH/nViQiByg+ZJykucldsfJ54GlkgWB4qxzuyJh38+2PJwvMwOC0+Xv5Kem1xRW BQc28LmHB5/r3AJC5VF+W/Sop2pypCNo6ZGYJk0t74lPl9yrzM3jKfMhzSjzokZy4sTu 6cXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Svd21x4k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w15-20020a05640234cf00b00461ed1fe6ffsi11844911edc.85.2022.11.07.04.04.34; Mon, 07 Nov 2022 04:05:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Svd21x4k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231701AbiKGLjS (ORCPT + 93 others); Mon, 7 Nov 2022 06:39:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231918AbiKGLjQ (ORCPT ); Mon, 7 Nov 2022 06:39:16 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D93917073 for ; Mon, 7 Nov 2022 03:39:16 -0800 (PST) Received: from [192.168.2.123] (109-252-117-140.nat.spd-mgts.ru [109.252.117.140]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id 77C1A6601FAA; Mon, 7 Nov 2022 11:39:14 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1667821155; bh=I8DXdlPi9UbfKxSyEPU3xTALuZKpaODNsptb3jwRyak=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Svd21x4kj6L2Ggai70WTI7KBeA1Smj1YXYgqRX0Y3ckaSXgZvt4x+7OcJl2Ol9P2z 831YOtdLbYbr7kJc9Kf1YsNrcNghD0UbZlgAnKbH24w8H9rLAENyhBX8iUBP8R+BoX f8lQM/wcGBqPkd1BDPsLP7DKUOu/c/0/ceuZXTxThIeIp0xW4RoVVDeWHOktbvmz8X EoiG/L6raU5m0GTv1D8ysx89T2aui4ENbyJKtj/aEh0vEaVRlOqpm+IbrYyESF9aqk BR2tyVAiyvtLCmb6KF6KEKRiurCYwRsCA5evDCR27Z0VvHwF9Zv0BmmlxH2aQcjd3N AjcyMr1QJ6XSQ== Message-ID: Date: Mon, 7 Nov 2022 14:39:11 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH] mfd: axp20x: Do not sleep in the power off handler To: Lee Jones Cc: Samuel Holland , Chen-Yu Tsai , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , "Rafael J. Wysocki" , "Russell King (Oracle)" , linux-kernel@vger.kernel.org References: <20221105212909.6526-1-samuel@sholland.org> Content-Language: en-US From: Dmitry Osipenko In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >>> --- >>> >>> 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 -- Best regards, Dmitry