From patchwork Wed Mar 6 13:25:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 10841109 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 004E3180E for ; Wed, 6 Mar 2019 13:25:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCE132D96D for ; Wed, 6 Mar 2019 13:25:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D14252D976; Wed, 6 Mar 2019 13:25:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D61C12D96D for ; Wed, 6 Mar 2019 13:25:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zYXAQqtTC4rZhQWyDyL/9NdZlGuulr6ibBZo7Sglsjk=; b=ZAD4R5go48TET0 neXcaUqcd3Q4NAaZLjROgKVm0QOll89pzw1Sb5CF1nBlQVgJPXAh1hvvxynEyjTYFwtqXxDIC02I3 LMhowOd66wRTi43A10IuY7b2QNE1HzoS2yMHlKzMBxE2W1nAw7xpl1cWp22fSpNvZ/qPP/sUIKVhe J/fsr5nxRtl0JVI+r6xpoqdy21E9e6MozS9KVkikfKr5xh4V87JfViW8zoL0zQNLIwbdMXid6Foha xcXG2X3cztuGWq3rLoq0unxoYm2ceVGBiaA6/1DSVaXMKAIaJzoX/HngiWrmSeMbdvh1m1TIp0dXa ZeCkeHlPPyAEPy0tgSBA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1WYF-0005Vr-E0; Wed, 06 Mar 2019 13:25:39 +0000 Received: from mail-am5eur02on0609.outbound.protection.outlook.com ([2a01:111:f400:fe07::609] helo=EUR02-AM5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1WXv-0004wD-Do for linux-arm-kernel@lists.infradead.org; Wed, 06 Mar 2019 13:25:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7nkgWBuioz+922pJOcaiisSpu1jNZ4+FFA1b2Hk11gs=; b=LYlu9ROgnsrqoJ2eTZH8Us/wjuUJsuGOh7jJ+Kc9b3AoyE7XnCWgs44ZVl99Pq6VZ9d2Nz1bBYmD6MBoswEdzugikqGfLzyOxVSsICbWHFYiEWxjSltUcecrymEL5apsRK9/HsEAr2vnfzghimguBtQO4qKOxAAbJh+rj2oT740= Received: from AM0PR04MB4211.eurprd04.prod.outlook.com (52.134.92.158) by AM0PR04MB5345.eurprd04.prod.outlook.com (20.178.112.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Wed, 6 Mar 2019 13:25:15 +0000 Received: from AM0PR04MB4211.eurprd04.prod.outlook.com ([fe80::50ed:d1b5:c043:3b79]) by AM0PR04MB4211.eurprd04.prod.outlook.com ([fe80::50ed:d1b5:c043:3b79%2]) with mapi id 15.20.1686.016; Wed, 6 Mar 2019 13:25:15 +0000 From: Aisheng Dong To: "linux-pm@vger.kernel.org" Subject: [PATCH 2/6] PM / Domains: Return for all error cases in _genpd_power_off Thread-Topic: [PATCH 2/6] PM / Domains: Return for all error cases in _genpd_power_off Thread-Index: AQHU1CAJEYbz4lRmTECgXbYWCDIjjQ== Date: Wed, 6 Mar 2019 13:25:15 +0000 Message-ID: <1551878302-8146-3-git-send-email-aisheng.dong@nxp.com> References: <1551878302-8146-1-git-send-email-aisheng.dong@nxp.com> In-Reply-To: <1551878302-8146-1-git-send-email-aisheng.dong@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK0P153CA0009.APCP153.PROD.OUTLOOK.COM (2603:1096:203:18::21) To AM0PR04MB4211.eurprd04.prod.outlook.com (2603:10a6:208:5b::30) authentication-results: spf=none (sender IP is ) smtp.mailfrom=aisheng.dong@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 832138c6-98b5-4365-e3d8-08d6a2372b3b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB5345; x-ms-traffictypediagnostic: AM0PR04MB5345: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM0PR04MB5345; 23:72DGiHVjh6UkqnAwPtDJV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hx++Pwm1ZSe8ACQtQG7y?= =?iso-8859-1?q?S0Z1lrGWJD4UFdMz2Ac6pvqqWbACZBJjrnSu66LxpCBkJD9dLcle6+ObcyOu?= =?iso-8859-1?q?bWf7CLfI2qs9dKBPh6wqJOLDkx/b2O3cbfqjm7EQIPeEj/r/D3aIC/GnOGVI?= =?iso-8859-1?q?j1R6hyb27m5G+quEwWu7GxSkD1qLvRm2j9VVyotwPR7hWIap5Wq6U47/rgWl?= =?iso-8859-1?q?iAOy8FgSj6P+lfaXGKqrxLWpYK5NrUzP4QT3+bPCIgM7nPtAXu0IckPQoaUZ?= =?iso-8859-1?q?chirqrHkMp4x7v3u+et0dpmSEerrGApfdo+Z9Cit1EXusD6/zfGSpKO175Rt?= =?iso-8859-1?q?M2RQf40JemOXkPDj15DUPMS+RJQiIrzlG7nySiYnQqAT8XWTtNSiKPyxLYln?= =?iso-8859-1?q?KeRkFYvCw0qgKjclSNJvUUim9z?= x-microsoft-antispam-prvs: x-forefront-prvs: 0968D37274 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(136003)(366004)(376002)(346002)(199004)(189003)(316002)(4326008)(44832011)(386003)(446003)(486006)(2906002)(2616005)(54906003)(476003)(11346002)(6506007)(68736007)(36756003)(52116002)(186003)(105586002)(2351001)(14454004)(86362001)(26005)(5660300002)(106356001)(50226002)(71200400001)(71190400001)(25786009)(102836004)(8936002)(305945005)(478600001)(6916009)(6436002)(7736002)(99286004)(8676002)(66066001)(5640700003)(76176011)(256004)(6486002)(81156014)(97736004)(3846002)(6116002)(53936002)(2501003)(81166006)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5345; H:AM0PR04MB4211.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 54rfaafomUOU8hxbHFq97xXkaobDK7uHThB81gCJg7fxorkTZiVXfIa/zGklP3nEmgTmArYVJK35QFSDQOc/TM6oQdpikgbsOIUEZBWZ/Hl13b57hoJnWlgFf7RmxitTVSr+H8g3M++T3il3MF4gZ5+ZQrwhHwzisL9JAw1Lp5q4W8YGRYovopxHEsplTvIWxyNzHlBP1el8zF4ANV6CLPx3b7VAVQrAaDK+4Z6Vy/Kiext0+i8DDZcz4vmKx5x+BV9ae+9NvGj5HtkmC9kfu9SOH9ZWHhIL8yaIBB6qPkr8eEWpqra3gmgK+LsSAcSYPUtoHODGIs68AlVP9yd2emD6RBzodRe8nnT4yyE6QId1PMDGzTLtsFjq1lnL3nf72mPWYMwiRHsXLiiedgFGMBc6CwRbBueX9fjKYLAsWPI= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 832138c6-98b5-4365-e3d8-08d6a2372b3b X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Mar 2019 13:25:15.7183 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5345 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190306_052519_765122_4AA4BCC9 X-CRM114-Status: GOOD ( 13.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aisheng Dong , "ulf.hansson@linaro.org" , "dongas86@gmail.com" , "khilman@kernel.org" , "rjw@rjwysocki.net" , dl-linux-imx , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP It is strange to only return early for -EBUSY state and left other errors to be still measured execution time. As for error cases, the elapsed_ns computed actually is not quite accurate and meaningful for governor to use. So let's simply return for all error cases. Signed-off-by: Dong Aisheng Reviewed-by: Ulf Hansson --- drivers/base/power/domain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 394f9da..f012576 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -457,19 +457,19 @@ static int _genpd_power_off(struct generic_pm_domain *genpd, bool timed) time_start = ktime_get(); ret = genpd->power_off(genpd); - if (ret == -EBUSY) + if (ret) return ret; elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start)); if (elapsed_ns <= genpd->states[state_idx].power_off_latency_ns) - return ret; + return 0; genpd->states[state_idx].power_off_latency_ns = elapsed_ns; genpd->max_off_time_changed = true; pr_debug("%s: Power-%s latency exceeded, new value %lld ns\n", genpd->name, "off", elapsed_ns); - return ret; + return 0; } /**