From patchwork Tue Apr 26 06:47:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 66667 Delivered-To: patches@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1440830qge; Mon, 25 Apr 2016 23:47:30 -0700 (PDT) X-Received: by 10.25.166.76 with SMTP id p73mr545556lfe.15.1461653250400; Mon, 25 Apr 2016 23:47:30 -0700 (PDT) Return-Path: Received: from mail-lf0-x22e.google.com (mail-lf0-x22e.google.com. [2a00:1450:4010:c07::22e]) by mx.google.com with ESMTPS id a16si11733279lfa.109.2016.04.25.23.47.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Apr 2016 23:47:30 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22e as permitted sender) client-ip=2a00:1450:4010:c07::22e; 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::22e as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x22e.google.com with SMTP id c126so6166013lfb.2 for ; Mon, 25 Apr 2016 23:47:30 -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=Ray5nVd63SjvVsMhiEECcw2Zv+p/nzizwpki4iEIqtw=; b=UFL9OkOzEC6T40MGlrFCWadnNgCoyFqiQ5ZeG7Z4Bf4orAsU73fByrOv2HSde8zSYZ 5L3VFEiFONzaUer8NnEOwJ81D4deRF8spXgRY21cctdxDG3UceLVxumWbKCKh1BvgbwL k5bX1y60L9UqMv1kUgDoO+WmRTUpbwl4WqYrE= 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=Ray5nVd63SjvVsMhiEECcw2Zv+p/nzizwpki4iEIqtw=; b=cILmB2dR4DM/V7CRmgpkxW3O1fgg1bTcSJLT0MrsR44TxyWL3OalqJsQ90iTOrNY+x H83NG2D+e1zR7z80+JCq+3Kom+uVuyuTsK8HTZIreEmoC6yb/7Kf2hoGVjwRuNUVNp+F aZ7nPpmei8e5GzrYxwg3EP55HzcEqQHDpo/lVGBKHmj4OakZUpC/1Lf2cn20a0kvn/bd Xj8ovtVl9xhwt7zrJ+biN247LUtfz/OltNXl+uhaxmr2NhE3BVU0uf5YdNa0nTkLktU7 uUf6M+H6NB7uiBsuqJDySed8n7SU8Xj8b4/yKtNr4vGbCw2yvCdEFFrFrU3RudEi5vQa jW8Q== X-Gm-Message-State: AOPr4FUYKHhn055bT8uyZE/19D5z+WQNEJJBgjiJ2edQQbCEyAdKZNDX7fZdIQrED2zdylkljUs= X-Received: by 10.25.147.77 with SMTP id v74mr532270lfd.19.1461653250112; Mon, 25 Apr 2016 23:47:30 -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 p199sm2248306lfd.12.2016.04.25.23.47.28 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Apr 2016 23:47:28 -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 v2 1/2] PM / Domains: Remove redundant pm_runtime_get|put*() in pm_genpd_prepare() Date: Tue, 26 Apr 2016 08:47:17 +0200 Message-Id: <1461653238-3891-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461653238-3891-1-git-send-email-ulf.hansson@linaro.org> References: <1461653238-3891-1-git-send-email-ulf.hansson@linaro.org> The PM core increases and decreases 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 Reviewed-by: Kevin Hilman --- Changes in v2: Updated changlog and added Kevin's reviewed by. --- 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; }