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: 10841103 X-Patchwork-Delegate: rjw@sisk.pl 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 0E42D1803 for ; Wed, 6 Mar 2019 13:25:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE4A62D95F for ; Wed, 6 Mar 2019 13:25:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E238F2D96E; Wed, 6 Mar 2019 13:25:19 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A4272D95F for ; Wed, 6 Mar 2019 13:25:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728747AbfCFNZT (ORCPT ); Wed, 6 Mar 2019 08:25:19 -0500 Received: from mail-eopbgr00085.outbound.protection.outlook.com ([40.107.0.85]:39492 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726882AbfCFNZS (ORCPT ); Wed, 6 Mar 2019 08:25:18 -0500 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" CC: "linux-arm-kernel@lists.infradead.org" , "dongas86@gmail.com" , dl-linux-imx , "rjw@rjwysocki.net" , "ulf.hansson@linaro.org" , "khilman@kernel.org" , Aisheng Dong 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=3BAM0PR04MB5345=3B23=3A72?= =?iso-8859-1?q?DGiHVjh6UkqnAwPtDJVtHrGMlta7A5rRslJUvayu0LFFpv8GlZ3aOIU3/0H+?= =?iso-8859-1?q?5loeWiJz2OoTyD9qzZthVtKlMhaj/okS+pcxuubyLkz6YwqGOwZPQcYtcfsD?= =?iso-8859-1?q?nhPd0rFBGuo9477Ie85vjKacp5S3IqrtZ9NglTXL6jX1riL+aBDM+WxlWYOd?= =?iso-8859-1?q?TH1n/uoF8GWWKNJrzNY7X5JrBQrL6lo6h9dUTE+zSR2+Yuo+cay54QnO1rvk?= =?iso-8859-1?q?hprfaMY3RV/CUC8ojmEfbiysf1hhzOVa1/N1iuq/C4dsHqNiIJA2Z6uRKmAN?= =?iso-8859-1?q?P7FfpNyc1nV5UPR2j9G1pYAPbnf8QsfVBRMRAoRLvvt3vaySsq7qqy/4923P?= =?iso-8859-1?q?puR4KjKc69JcNwprixpQw7G6DtJYSVn403wQ5rCZyEKp27SFhHymMT3ryJU9?= =?iso-8859-1?q?89spaez4ADasz+Niux+cUdPZlKLA/lbV1OxJ4zk7N/9AMXuVJurHKss1mS6l?= =?iso-8859-1?q?EFwX6P+b3FWQbpCg1V8rDguCWk/XgIiE6oYALFYPgv7U2auDJGGsO+vTnJGd?= =?iso-8859-1?q?RQD2FyEOGZxT3V3lOCthHxvG4xj7DvSlWmW8hX6sV480y6kGLOmxkDP6BM1h?= =?iso-8859-1?q?N0qA3WxMVHAiljNJoV0Vw8Kw6Moaqe2Vb1LnPQwSXMO7FDRyxS61hNmgilz/?= =?iso-8859-1?q?uCJt7M0rJPPnJxxyoBAM2qhGyUK6ko2TNON5+CKfZ45mIvz4YMTJomZMYaRe?= =?iso-8859-1?q?mE/1yOaNsBOtBMu7s4Qly63D9zs36Ik0e/SkAoI5IB6oFCcuhBAmAReopTX1?= =?iso-8859-1?q?ME+HxnIQtMwPhjH029N+YZSZqA7EbIbtZvc5DV/G9ensIhJ3kbcM7fX+hZNY?= =?iso-8859-1?q?fmu4nqTGXREwEDeHJ1gWuzgE0CogCkh+Hx++Pwm1ZSe8ACQtQG7yS0Z1lrGW?= =?iso-8859-1?q?JD4UFdMz2Ac6pvqqWbACZBJjrnSu66LxpCBkJD9dLcle6+ObcyOubWf7CLfI?= =?iso-8859-1?q?2qs9dKBPh6wqJOLDkx/b2O3cbfqjm7EQIPeEj/r/D3aIC/GnOGVIj1R6hyb2?= =?iso-8859-1?q?7m5G+quEwWu7GxSkD1qLvRm2j9VVyotwPR7hWIap5Wq6U47/rgWliAOy8FgS?= =?iso-8859-1?q?j6P+lfaXGKqrxLWpYK5NrUzP4QT3+bPCIgM7nPtAXu0IckPQoaUZchirqrHk?= =?iso-8859-1?q?Mp4x7v3u+et0dpmSEerrGApfdo+Z9Cit1EXusD6/zfGSpKO175RtM2RQf40J?= =?iso-8859-1?q?emOXkPDj15DUPMS+RJQiIrzlG7nySiYnQqAT8XWTtNSiKPyxLYlnKeRkFYvC?= =?iso-8859-1?q?w0qgKjclSNJvUUim9z?= 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 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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; } /**