Received: by 10.223.176.5 with SMTP id f5csp582586wra; Fri, 9 Feb 2018 04:01:09 -0800 (PST) X-Google-Smtp-Source: AH8x226PwQNDDwDjo3XUovev5ksjYXBQY1WqQt3Sk12rm3UrbibD2yQKlKAgKxisBjxkTylJMr9E X-Received: by 10.99.96.206 with SMTP id u197mr2150621pgb.261.1518177668977; Fri, 09 Feb 2018 04:01:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518177668; cv=none; d=google.com; s=arc-20160816; b=Lrh0PyAa/8Duu4AHVI/lrTUIWx3mQTv42w5vZar6TjD+4i9H1mNmLr8I5Cz/1qEeJq hCugnTfAwfUdNGokRAIS73T26ezSwDxUjZPXT3iNQJy3xutXAhJHHiNBBfb1pfzTtciq tMFECGa/5Hgbtfd0k6bhHM5eU3LmifddhvurgwJBHl8piph3NW7ohAiFO62RfTtmAVzQ hE/F3w1hrb8Ciman/Rp2OqQ30DP2H6UYXg5q2p1H9zoX2AlTOAI2isegDC47PQUpGBMp DmVtodYxdgkKRQ++3zEs0Lw3fwchxiDAdkiPVoQF/nOovr4TwsHKbGC6IkZouYwsMEfc p4+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=QURsZJ80iLdp2Dzjnpmuia7p6hDNm/oAeQDauKnFSho=; b=OalGOs33CrOFzPhBvebN8fF7M0h9Z8kSGz2hHvCzhXGl7yqkYQofp2OLECl+mxw1ai hw6gEKCRzddZKmcgmC3jANIOfZueLoyIvSpSE7PpjiluYXTGJA7k8LXQycflngSgw5dv 9Xho/srxgANC/2Lz7PJsUsenf0EklSWzKRWU1puHqIlenv7Kor2+TULrRw6OzWJpYNAb y8SOcb9ZphN1t8am65pc706s2ezs2kgSM6udtxDbRFc+qdm4LZ+zafc5EARJ/PcUn+6a LM+tZNqLgtiDYW6eMjzQ2H2EcyR+IfFfEoFIMT2GfgIuUb6lhxOzTUJNhoZZdexb2ERe gOSw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q7si1302181pgr.526.2018.02.09.04.00.54; Fri, 09 Feb 2018 04:01:08 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751128AbeBIL6f (ORCPT + 99 others); Fri, 9 Feb 2018 06:58:35 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:58682 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895AbeBIL6e (ORCPT ); Fri, 9 Feb 2018 06:58:34 -0500 Received: from 79.184.255.223.ipv4.supernova.orange.pl (79.184.255.223) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83) id 2c844dc5cecc0e11; Fri, 9 Feb 2018 12:58:32 +0100 From: "Rafael J. Wysocki" To: Jia-Ju Bai , khilman@kernel.org, ulf.hansson@linaro.org Cc: len.brown@intel.com, pavel@ucw.cz, gregkh@linuxfoundation.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] base: power: domain: Replace mdelay with msleep Date: Fri, 09 Feb 2018 12:56:50 +0100 Message-ID: <66016771.HTTzQvm2zL@aspire.rjw.lan> In-Reply-To: <1516955899-31810-1-git-send-email-baijiaju1990@gmail.com> References: <1516955899-31810-1-git-send-email-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday, January 26, 2018 9:38:19 AM CET Jia-Ju Bai wrote: > After checking all possible call chains to genpd_dev_pm_detach() and > genpd_dev_pm_attach() here, > my tool finds that these functions are never called in atomic context, > namely never in an interrupt handler or holding a spinlock. > Thus mdelay can be replaced with msleep to avoid busy wait. > > This is found by a static analysis tool named DCNS written by myself. > > Signed-off-by: Jia-Ju Bai > --- > drivers/base/power/domain.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c > index 0c80bea..f84ac72 100644 > --- a/drivers/base/power/domain.c > +++ b/drivers/base/power/domain.c > @@ -2144,7 +2144,7 @@ static void genpd_dev_pm_detach(struct device *dev, bool power_off) > if (ret != -EAGAIN) > break; > > - mdelay(i); > + msleep(i); > cond_resched(); > } > > @@ -2231,7 +2231,7 @@ int genpd_dev_pm_attach(struct device *dev) > if (ret != -EAGAIN) > break; > > - mdelay(i); > + msleep(i); > cond_resched(); > } > mutex_unlock(&gpd_list_lock); > Ulf, Kevin, any concerns or objections?