From patchwork Thu Oct 15 15:02:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 55033 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 6B1422301F for ; Thu, 15 Oct 2015 15:02:17 +0000 (UTC) Received: by lbbms9 with SMTP id ms9sf11476385lbb.3 for ; Thu, 15 Oct 2015 08:02:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=8yXTP5SN6Y+Az6ddBA1a9AYuNWnNmJPuszGXWxMIByU=; b=dm5OugB0zde9XRht1LNLzRrV9X1oqiDHydgvsWkuIGvTJ4ki8/q/0ka3bWihwaJbOR l6bE+phYgOQ30TyUnVCzc2Cy1jFT+2sBgk8lnbpyVn8o2Ik+1Yw1XjR1Sg8+YSreS8ei mgPRwMR0dvDAHijvI6lSmym4i9Bo21kVu414X+NWBstwB2TKytLbckqBTpr2yuSKp3dm a+Jd8FWgJmREC42oa6Lw+21a2ZpFbP/ErlPucqTc0L9R4ckcWKzh0gRC1m+dAHTVaRdc eJxkQhv+Ld45oo1psds9+/WB28oAl8rp+Vut7F6fi6hiNe7FzZxrLedp5SxdAsJP6ikJ iJKQ== X-Gm-Message-State: ALoCoQmhkcAn/yyNliAy/qwDJ6j1i93F94cz+59DwdgQ8WKLcWHas3olgPpbNo7peF1UVdgshavs X-Received: by 10.112.169.34 with SMTP id ab2mr2261739lbc.23.1444921336185; Thu, 15 Oct 2015 08:02:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.210.198 with SMTP id j189ls152776lfg.86.gmail; Thu, 15 Oct 2015 08:02:16 -0700 (PDT) X-Received: by 10.112.132.7 with SMTP id oq7mr4966844lbb.32.1444921336051; Thu, 15 Oct 2015 08:02:16 -0700 (PDT) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id h139si9406670lfb.126.2015.10.15.08.02.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2015 08:02:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by lffy185 with SMTP id y185so31143828lff.2 for ; Thu, 15 Oct 2015 08:02:15 -0700 (PDT) X-Received: by 10.25.207.82 with SMTP id f79mr3233960lfg.73.1444921335728; Thu, 15 Oct 2015 08:02:15 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.59.35 with SMTP id w3csp686600lbq; Thu, 15 Oct 2015 08:02:14 -0700 (PDT) X-Received: by 10.25.151.205 with SMTP id z196mr3096308lfd.97.1444921334832; Thu, 15 Oct 2015 08:02:14 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id an1si9409749lbc.68.2015.10.15.08.02.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2015 08:02:14 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbbpp2 with SMTP id pp2so43139856lbb.0 for ; Thu, 15 Oct 2015 08:02:14 -0700 (PDT) X-Received: by 10.112.199.100 with SMTP id jj4mr4900078lbc.122.1444921334470; Thu, 15 Oct 2015 08:02:14 -0700 (PDT) Received: from uffe-Latitude-E6430s.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id o195sm2151343lfo.12.2015.10.15.08.02.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Oct 2015 08:02:13 -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 , Krzysztof Kozlowski Subject: [PATCH 1/2] PM / Domains: Don't measure ->start|stop() latency in system PM callbacks Date: Thu, 15 Oct 2015 17:02:06 +0200 Message-Id: <1444921326-22574-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Measure latency does by itself contribute to an increased latency, thus we should avoid it when it isn't needed. Genpd measures latencies in the system PM phase for the ->start|stop() callbacks and is thus affecting the system PM suspend/resume time. Moreover these latencies are validated only at runtime PM suspend/resume. To this reasoning, let's decide to leave these measurements out of the system PM phase. There should be plenty of occasions during runtime PM to perform these measurements anyway. Signed-off-by: Ulf Hansson Reviewed-by: Lina Iyer Acked-by: Kevin Hilman --- drivers/base/power/domain.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 6e1bcde..a1c3ec4 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -90,8 +90,12 @@ static struct generic_pm_domain *dev_to_genpd(struct device *dev) return pd_to_genpd(dev->pm_domain); } -static int genpd_stop_dev(struct generic_pm_domain *genpd, struct device *dev) +static int genpd_stop_dev(struct generic_pm_domain *genpd, struct device *dev, + bool timed) { + if (!timed) + return GENPD_DEV_CALLBACK(genpd, int, stop, dev); + return GENPD_DEV_TIMED_CALLBACK(genpd, int, stop, dev, stop_latency_ns, "stop"); } @@ -434,7 +438,7 @@ static int pm_genpd_runtime_suspend(struct device *dev) if (ret) return ret; - ret = genpd_stop_dev(genpd, dev); + ret = genpd_stop_dev(genpd, dev, true); if (ret) { genpd_restore_dev(genpd, dev, true); return ret; @@ -779,7 +783,7 @@ static int pm_genpd_suspend_noirq(struct device *dev) || (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev))) return 0; - genpd_stop_dev(genpd, dev); + genpd_stop_dev(genpd, dev, false); /* * Since all of the "noirq" callbacks are executed sequentially, it is @@ -820,7 +824,7 @@ static int pm_genpd_resume_noirq(struct device *dev) pm_genpd_sync_poweron(genpd, true); genpd->suspended_count--; - return genpd_start_dev(genpd, dev, true); + return genpd_start_dev(genpd, dev, false); } /** @@ -928,7 +932,7 @@ static int pm_genpd_freeze_noirq(struct device *dev) if (IS_ERR(genpd)) return -EINVAL; - return genpd->suspend_power_off ? 0 : genpd_stop_dev(genpd, dev); + return genpd->suspend_power_off ? 0 : genpd_stop_dev(genpd, dev, false); } /** @@ -948,7 +952,8 @@ static int pm_genpd_thaw_noirq(struct device *dev) if (IS_ERR(genpd)) return -EINVAL; - return genpd->suspend_power_off ? 0 : genpd_start_dev(genpd, dev, true); + return genpd->suspend_power_off ? + 0 : genpd_start_dev(genpd, dev, false); } /** @@ -1042,7 +1047,7 @@ static int pm_genpd_restore_noirq(struct device *dev) pm_genpd_sync_poweron(genpd, true); - return genpd_start_dev(genpd, dev, true); + return genpd_start_dev(genpd, dev, false); } /**