Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp119909imm; Wed, 29 Aug 2018 15:46:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZq9GvcX2uMkQld8P2ubfuPBvoVhPRD12EVdlU3xNw5W9xiefP7Cmgpgjp8cXJutu3XYEU5 X-Received: by 2002:a62:5d89:: with SMTP id n9-v6mr7842274pfj.102.1535582790934; Wed, 29 Aug 2018 15:46:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535582790; cv=none; d=google.com; s=arc-20160816; b=09/6tVJSyzqET2bOrA0JyWRQvyAolmI9bRwPQpG/o8sdpGhUOYVPJhI1l1GMjvNt5o I9SuppZnUoYDvLX6yUDgszOd1T+E/0zGauiwkpdbdKIrMC1LiAlgyAQZue93+8bEsWNm ZHNCMjgGvvyI6ZHM/Nioe7e7zkYtjXQTYtVwqvYOhpSboH+me7bE14teA1/FLPoHOBcq OTcd1uuTYqUQmjwF9xWuqhPM228mC/aSKShFt5Pgd3YfrZaFy0o9ttm2He4uKEPKG6Fr KdSYkZlGsHvzbiXgvEr1PEY5Jbhf+WoJSg/J+gOM/KeOlNMfrNHypQLVKGFxbB4HNUo5 fuUQ== 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=bbz9ceSIcZyXG/09Xb3n/emitHvY9w5pgN4YY5QsUs8=; b=Ep6ZwfK6wzP6wYU6/fGI526zyHQ4NZo5iH0DEvpRez3QIxXBeCKMddPZozuQ6sYBIa xuBE8m7wg8bmK6BH3HFs4RfrOziUpC3gBTc5X6gew/xTPphdgQvFnheXHY4e3+N3aRcF GJL595PJJSyAadI21j4EcIDCYIfmlQiS1JhmZtto6aUUlaSikoOWLkuhU8lKErbX7Yqv s+7/3F0IKpSyYWkyP6FYg8Auxen+3bppW2s7S+vxwIxttrmToIB7REoNAOrkpvPWJ/lz hyfCpZdDhJ0Z9u0+XGBlAm5WGh7aHvCSNMYXOsDxarzCn5pSjZoXCmqkoQNSiO8kTQV7 xLaA== 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 q197-v6si4790939pgq.526.2018.08.29.15.46.16; Wed, 29 Aug 2018 15:46:30 -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 S1727701AbeH3CnS (ORCPT + 99 others); Wed, 29 Aug 2018 22:43:18 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:60244 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727336AbeH3CnS (ORCPT ); Wed, 29 Aug 2018 22:43:18 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id E99D02723A7 Date: Thu, 30 Aug 2018 00:44:09 +0200 From: Sebastian Reichel To: Jia-Ju Bai Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] power: reset: gpio-poweroff: Replace mdelay() with msleep() in gpio_poweroff_do_poweroff() Message-ID: <20180829224409.buwhrlaxxwtenqh6@earth.universe> References: <20180730134614.9016-1-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="d24bfuwqavo4azyo" Content-Disposition: inline In-Reply-To: <20180730134614.9016-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 --d24bfuwqavo4azyo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon, Jul 30, 2018 at 09:46:14PM +0800, Jia-Ju Bai wrote: > gpio_poweroff_do_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 > --- Please self-review the results from your tool before sending. This is a shutdown driver. -- Sebastian > drivers/power/reset/gpio-poweroff.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/power/reset/gpio-poweroff.c b/drivers/power/reset/gp= io-poweroff.c > index 6273ad3b411d..bbe55cfa87d0 100644 > --- a/drivers/power/reset/gpio-poweroff.c > +++ b/drivers/power/reset/gpio-poweroff.c > @@ -33,16 +33,16 @@ static void gpio_poweroff_do_poweroff(void) > =20 > /* drive it active, also inactive->active edge */ > gpiod_direction_output(reset_gpio, 1); > - mdelay(100); > + msleep(100); > /* drive inactive, also active->inactive edge */ > gpiod_set_value(reset_gpio, 0); > - mdelay(100); > + msleep(100); > =20 > /* drive it active, also inactive->active edge */ > gpiod_set_value(reset_gpio, 1); > =20 > /* give it some time */ > - mdelay(timeout); > + msleep(timeout); > =20 > WARN_ON(1); > } > --=20 > 2.17.0 >=20 --d24bfuwqavo4azyo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAluHIbkACgkQ2O7X88g7 +pqGYw/9HaMKnSUSSWlu/+BT3IKRIzJoiYBLcYT9k/Jkfglz8U4mvVuSV9U6SYc2 c/FBt3598DPiXCa+SL5Ux2op+MSj0yPiKgDo/+ICvItwxVHv6nLp7prOj74AiWil Ib4xPNDtJNhJtnlaz2g14BmtRbFfv8mbG5PxBfh8Pyssp8Asu3pf3PALGJL2R3nG eZ6Fi3ovJ4zJp/czxMv898y7aKqMBpBPV+/eRK94v8AUnNfRwkt12+Ctz5OlWWvc LJ+viv65nOtyntmV52h03iSW1DfiohwbQEmCLN2Rgypl7AEHlbrM+wd6/ZS+RJDd gPZBYOh/d7xLOYwDmQwQCvUVsTu8luMH8TPFTZ449U18x0CL9Cxyh4eRaVWZeNeB K+4Oa2H9kFxW3DJAtXwFLpNLqH9NIoWD0EYkpKiQL8844KoCLWAJ+PPGJKetRL55 ajLAnJuuF+Lq/kQzhGREAEIs9RoajyaEuxE5pWnFS1YQVdutFdJuPMxwzAiVkMmO zm2l1pixR1iMdPsj/mBX7F8lMKw/10UdpayGrNNUpgzahC57rvfQdlnlLla6J3a/ z1R6N2OgcP5I1mqoITD9MMo9tLSBFivmWnUQJI7G5Ju/J5KsRVTuy2wNI8YnS9Fw 9jFlds4sBdiA+OWGjh3tIwew+1+0Ak/J13YW1pKPrKSH3QMN0js= =u4Qt -----END PGP SIGNATURE----- --d24bfuwqavo4azyo--