Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp120767imm; Wed, 29 Aug 2018 15:48:25 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY4dR+j9OYTA1zkTFkZhnv4ZvX11+fKbikmAveZQKxgq3MWdS8onEOvxkXiLnqRoaepwRzJ X-Received: by 2002:a62:cd3:: with SMTP id 80-v6mr7906747pfm.184.1535582905438; Wed, 29 Aug 2018 15:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535582905; cv=none; d=google.com; s=arc-20160816; b=WQhRfjY1jaCoxBqkrR7GnYp6hLWNwjUBoJdDbQs0jksd5VPLjmlN4ZdL2b9RVfp++k Zv49T84vsTJQfTsp3oDVKMtx5qUuXnK/fv+mJQR3f3CJrzOHeLLOU5nJwN71j6tmTAVL 22JmRre7HcXlNjTBRwmYRO3ZgZ76TXO/DVc57XX1IMNkGRwb5Yb7fx159SvXGuomrjQp B1oj9ch3coE8SOjjGvrQKB8HH7ocDu1gqxV/7IxF9fJ/CIbxH4W45/2GwWG6+yjqHkNK ytaRKAPckc+2ncahS1SmuVLcFNROzbEJ+jbkP3jmkpLuN8rP39H/A32Rl3ZkCYJozx8b hlaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=4Cgs1JCrWH02Btj9bDCFRUjOhpjmuM6E/CAnwbEnits=; b=WTrPnFB0snrXqHmVlmU0OFugxZE+rQAOPOgK2uv08s+aNgcLmvZYmNCi+F7+9MDPsc w5w9HIwokRyf9FB3EaKraHnyfNiK2B3AvyXrtfQ5FsxUNSA5IHjRHxa26zteWcje3Bjm vy19leLCvrrOjdKwyNnl35hukKlgsAzdeJq3TlL7v8pPlMWgwgq4fDpC/Aq3HiUVGpq9 7mVX84hM1NR08jgOJrq+K41i+2CJAB96UIG3mOeQrZ1DM83YXat7D66ZZxAj0wxxuttf SunBqTHLSSIJ5ATZL11CyxCoQZKj1ThvWY0vRZ2ip7o4CPLhYTgGe7PTApJjZHcrtZOq T1JA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11-v6si5375088pln.471.2018.08.29.15.48.10; Wed, 29 Aug 2018 15:48:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727416AbeH3Cph (ORCPT + 99 others); Wed, 29 Aug 2018 22:45:37 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:60252 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727187AbeH3Cph (ORCPT ); Wed, 29 Aug 2018 22:45:37 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 33BD826A007 Date: Thu, 30 Aug 2018 00:46:27 +0200 From: Sebastian Reichel To: Jia-Ju Bai Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] power: reset: syscon-poweroff: Replace mdelay() with msleep() in syscon_poweroff() Message-ID: <20180829224627.g42fm5ujzygxi4mp@earth.universe> References: <20180730135029.9228-1-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="juyk23fuxnvgrlxg" Content-Disposition: inline In-Reply-To: <20180730135029.9228-1-baijiaju1990@gmail.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --juyk23fuxnvgrlxg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon, Jul 30, 2018 at 09:50:29PM +0800, Jia-Ju Bai wrote: > syscon_poweroff() is never called in atomic context. > It calls mdelay() to busily wait, which is not necessary. > mdelay() can be replaced with msleep(). >=20 > This is found by a static analysis tool named DCNS written by myself. >=20 > Signed-off-by: Jia-Ju Bai > --- This is also a shutdown driver, not applying. -- Sebastian > drivers/power/reset/syscon-poweroff.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/power/reset/syscon-poweroff.c b/drivers/power/reset/= syscon-poweroff.c > index f9f1cb54fbf9..b8b154606dbe 100644 > --- a/drivers/power/reset/syscon-poweroff.c > +++ b/drivers/power/reset/syscon-poweroff.c > @@ -36,7 +36,7 @@ static void syscon_poweroff(void) > /* Issue the poweroff */ > regmap_update_bits(map, offset, mask, value); > =20 > - mdelay(1000); > + msleep(1000); > =20 > pr_emerg("Unable to poweroff system\n"); > } > --=20 > 2.17.0 >=20 --juyk23fuxnvgrlxg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAluHIkMACgkQ2O7X88g7 +pqQTBAApt7BJKuvQgjBnyZDwc5ndZyjuRXbv13ihfhyl7GTtV7yctPv87Ir6aBK ojnngKXZC44L76XDmrI+5tnmm31XQGt1iCN7Egl+XKh4Mj/8STQlIyY24zT6d6iQ CsEpPhP/L/CBXojQMa3PipqOKe24Mr+izec74ustbSboacUdesYRvygbreFaS3Fe pxqbMBJbKKOhbBIeIvYMcTbHgAAcvj62+pePl5m1H0QQm251UO5FaznZFolE06OF g2EWPwgO/adyHm/s7M57jq1DHiNPIQSZd3ZiDmqxYNb/C54baTyRrUJAbhSpgKZ3 SxKb+iId396CFwWXpR4HVioHTm7nKMCk6BvpcbF2dKwsdI4vUNCapevJuRnne4ll ODlfOivzuFsxM5oqeoCMWkdEHJL2tgyIEeQ8QqY7Hvvvr841NHWUtEKlLoKzXKEA ecW9teJ2fGMUYP8TRcpHwE+PXLYWUmL3hYcaxTcILoiWaMSlMjxDfuv4rwUGnyHY d/LLfs7OeoROV/VXnTkT2L6jhX9tBX63leTgmRF26vRfvYl6aTFyYKdkJKH+JKr9 CdEeHgeRby2Flqs8ec12mNXfipV6hpti8F3LU4Mg7DRtTm9i8oeFweQI7i8g0VVw 7y9T1hHM77UCFdB60LFMsiqwiqc7sPVWqJ8TQH2/auohRJh+h8k= =u/zi -----END PGP SIGNATURE----- --juyk23fuxnvgrlxg--