From patchwork Fri Apr 22 08:15:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 66417 Delivered-To: patches@linaro.org Received: by 10.140.93.198 with SMTP id d64csp584781qge; Fri, 22 Apr 2016 01:16:07 -0700 (PDT) X-Received: by 10.25.213.210 with SMTP id m201mr8686925lfg.116.1461312967291; Fri, 22 Apr 2016 01:16:07 -0700 (PDT) Return-Path: Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com. [2a00:1450:4010:c07::236]) by mx.google.com with ESMTPS id rc4si4064457lbb.8.2016.04.22.01.16.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Apr 2016 01:16:07 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::236 as permitted sender) client-ip=2a00:1450:4010:c07::236; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::236 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x236.google.com with SMTP id e190so74918607lfe.0 for ; Fri, 22 Apr 2016 01:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=s9zeaFNgMr7jbLhtx80TOzjbRWCPGORdsgxurdmu24M=; b=MW4XfSxs2QiavS+SKyGk/2uf9+wVIYFKku5Q+jKE7+clnEwhfxzbmZStDMZyK6Br2o WlN25EIN4bZTdbIiTmIr+H9BeDnUTIbbNq1rPZ3+Kwc+dcdNekYRiyxiC+EDw2qulT3N 1DjFMXsFEj8oU7PRY8Bh78B1bSTyoMopArfZ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=s9zeaFNgMr7jbLhtx80TOzjbRWCPGORdsgxurdmu24M=; b=CnuObFJnhIHGYO4UCBSLxkdxwrXEt4ke45N7Olnt5TKWSolswhuejOuP/7AuucQEuZ NLSLaF18YXLBleuyQQrwIIZfMFpHaptdFPPzYVPa/DtAlf5btaYKtuXAeTkIYMFCIjki a0ElvkwbtJyXcZoERLHR+4zZAspemnCFyllcCizcWjaO8f6/MoyRfbZG/RXnlTEPwNBz 0hHpLDcY+RTM4KHwXRQ0GSKLut5cOpKVm989wpuiC2ae4e/xo2QwLf9KpeeQq5KR6nCb 2lEFrCjU81Y6FBqNAF1pY+/OPFpYUQJLY3+mhVex5lHTwDGDSB75WmN+1syHCpqrN07Y fFtQ== X-Gm-Message-State: AOPr4FV+V7/nyzljXnmUqu79msP4AK1s7/JpKe2kXniFID/YEl4AGoWjyzffaSqE6Oi1O5QnLg0= X-Received: by 10.25.73.212 with SMTP id w203mr7085602lfa.22.1461312967005; Fri, 22 Apr 2016 01:16:07 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-155-4-128-67.na.cust.bahnhof.se. [155.4.128.67]) by smtp.gmail.com with ESMTPSA id v4sm1317109lbi.20.2016.04.22.01.16.05 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Apr 2016 01:16:05 -0700 (PDT) From: Ulf Hansson To: "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , linux-pm@vger.kernel.org Cc: Len Brown , Pavel Machek , Geert Uytterhoeven , Lina Iyer , Axel Haslam , Marek Szyprowski , Jon Hunter , Andy Gross , Laurent Pinchart Subject: [PATCH 1/2] PM / Domains: Remove redundant pm_runtime_get|put*() in pm_genpd_prepare() Date: Fri, 22 Apr 2016 10:15:54 +0200 Message-Id: <1461312955-8547-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461312955-8547-1-git-send-email-ulf.hansson@linaro.org> References: <1461312955-8547-1-git-send-email-ulf.hansson@linaro.org> The PM core increases the runtime PM usage count in the system PM prepare phase. This makes some of the pm_runtime_get|put*() calls in pm_gendp_prepare() redundant, so let's remove them. Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- 1.9.1 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 4ce4ce0..60a3573 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -730,14 +730,11 @@ static int pm_genpd_prepare(struct device *dev) * at this point and a system wakeup event should be reported if it's * set up to wake up the system from sleep states. */ - pm_runtime_get_noresume(dev); if (pm_runtime_barrier(dev) && device_may_wakeup(dev)) pm_wakeup_event(dev, 0); - if (pm_wakeup_pending()) { - pm_runtime_put(dev); + if (pm_wakeup_pending()) return -EBUSY; - } if (resume_needed(dev, genpd)) pm_runtime_resume(dev); @@ -751,10 +748,8 @@ static int pm_genpd_prepare(struct device *dev) mutex_unlock(&genpd->lock); - if (genpd->suspend_power_off) { - pm_runtime_put_noidle(dev); + if (genpd->suspend_power_off) return 0; - } /* * The PM domain must be in the GPD_STATE_ACTIVE state at this point, @@ -776,7 +771,6 @@ static int pm_genpd_prepare(struct device *dev) pm_runtime_enable(dev); } - pm_runtime_put(dev); return ret; }