Message ID | 20230913-multiple-state-scu-v1-2-9d91c6904ffa@nxp.com (mailing list archive) |
---|---|
State | Handled Elsewhere, archived |
Headers | show
Return-Path: <linux-pm-owner@vger.kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AE35EE49B7 for <linux-pm@archiver.kernel.org>; Wed, 13 Sep 2023 02:01:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238124AbjIMCBZ (ORCPT <rfc822;linux-pm@archiver.kernel.org>); Tue, 12 Sep 2023 22:01:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238110AbjIMCBX (ORCPT <rfc822;linux-pm@vger.kernel.org>); Tue, 12 Sep 2023 22:01:23 -0400 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2044.outbound.protection.outlook.com [40.107.241.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F21D6170A; Tue, 12 Sep 2023 19:01:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fgtoY2xHd0kVfaqaasVZycwYeMWc3iZrtSFfQvNcT9mhx+hhi2/qjvMVGM5zAvx3l6gxlYBTI5lq1wFrNBgrGqTps57uJCPMF9k1z7RKRlS+hiOJruNTLFFRtcthfOiYfc7TqteVFx6TQn0pQmpoYcKN0XtFnHY3zzzIkmuHtLLZCv018Vh3TjMLuvrQM4uZxVRSyGEgVnVWct5D0GmygO3DJ9Ga8hJmw8uPN09KeRAZZKri1swotxWIavUaJvEenibQFy0neYE5MxqJ/9aQRiQaV+tJZHfladkKE+qXzkGwDAHzOFlmA6oYezeL/Zt+8x3VXlB0Y7UAEsePequZNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MK8g8WBtLs1659Dih8bzw/P9yNUtWe4jegDKFUTaTeM=; b=Y0EC53vXuvqD2DNqRblfx06EJW2Oz9HrLATvQetjVAhypRMXRRQPBhZhh9I7vTvvrh5hz6BOOnjWvw919ybNP1f+rU7qsqukxB4SS+beNR81uKRnaKGZ8hAkGXkBY9rXOcmZMKsrgQCoiuLkrUbBCzJe8mSiihqDi0NzuA7ZEIENYiL6DSVMKiNaHabvXNFIIMmXCpi+dyt1a1fqvHAj/MfabLV9UU4PZmvLXTtv7qE27oUuFeQ5uOktRNVRnWCBTayErHELiEdSiohdpa8t1A11flsWYudZc0Ay9kKM1uaoGcj7MyzU7wSYfdZomae1fP7w4sYt6ZFE+OtBEl5p/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MK8g8WBtLs1659Dih8bzw/P9yNUtWe4jegDKFUTaTeM=; b=M5QCDLqulxk0juDn/L4+UK0jvWY9PwRU0uQIpIbRcUD4G22FjZ0m5UKscbi05vaJfWdnT298b1ChrYw4+sRwxgdm20wjxA6/qpCOdU4gW8EfUtwA91x/NS00ltevzO3uo9J5O/2I/JpZfjLEFFfGAQ4ssL/LrjLJoDq7tNOw0uY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by PAXPR04MB8894.eurprd04.prod.outlook.com (2603:10a6:102:20d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.37; Wed, 13 Sep 2023 02:01:16 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::2b3:d8de:95c8:b28b]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::2b3:d8de:95c8:b28b%3]) with mapi id 15.20.6768.029; Wed, 13 Sep 2023 02:01:16 +0000 From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com> Date: Wed, 13 Sep 2023 10:05:37 +0800 Subject: [PATCH 2/3] PM / Domains: Choose the deepest state to enter if no devices using it Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230913-multiple-state-scu-v1-2-9d91c6904ffa@nxp.com> References: <20230913-multiple-state-scu-v1-0-9d91c6904ffa@nxp.com> In-Reply-To: <20230913-multiple-state-scu-v1-0-9d91c6904ffa@nxp.com> To: "Rafael J. Wysocki" <rafael@kernel.org>, Kevin Hilman <khilman@kernel.org>, Ulf Hansson <ulf.hansson@linaro.org>, Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com> Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Dong Aisheng <aisheng.dong@nxp.com>, Peng Fan <peng.fan@nxp.com> X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1694570751; l=915; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=qvVSxMEbUt5msArNvyrVU8YXTGWc1AE9b3pKa/4hFSo=; b=LXguZlHBKDCysSJp4EOPAEoEi7JoxskXTmrfTGVYexYNHJWlpAv+3A8JHrLy62M2z8YmgXBrx K77ryN+kOXZDJy+ERwxsFdc9MQ4cC388Hxj3ykAy4uVzEQnRwThR9By X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR02CA0015.apcprd02.prod.outlook.com (2603:1096:4:194::16) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|PAXPR04MB8894:EE_ X-MS-Office365-Filtering-Correlation-Id: 44053930-43de-4423-e7f4-08dbb3fd5040 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fypPQTHgRqmI+xumNRPuRMZr1vSdDW7s2og5k14AQdXT6fCJ/8yniWHzmHTUEGcspDs/XunedE+tHeF5F/dA4dFF5IvctVGp31S5sMD/z2ruiAJgQlooAZsQ4cN/DKdTvGyTSFhtSY7FUnH8CGTgRe4f/b92uhXrBUKfBnX5aTiRXHtm1BNp/5XaG1V1KcHuGg51bbVHNmuBrzUwplw9yy+TsFBCZb4x38rrGwaUZhu5MRcUxD+AUHBH/Zdy0+DrUhcdlDeynFdtSOPO1hs3Wgx7MC6hHFFnfonFVqvUy2weCoAevTSo7H9yEMG/i1zRJVP/t82I1rDsDnDI/sVt0BmMW7j/qgRvIqM+rJIpmX1DQhA9ERGQEj2/u16ZolqMffns5Tl5T4XgS1X9vFHLIyW3f79625TY4R7dIa7SxfpktGsZGe3Q7nxO8PI1UM9LvUh7H5Z/x7xxzK5sKUYtnX5fpdQDPnNL1NgLqLj87Mx+W+XRo6xifjTGo65WokSbdWEDLZvAom4MM5XOrtN8zxSbvdzjTgfFsNLMZG8h/olev8BdhSVbtEH4vhkd5UAs55pqjBt8iShov3TlcBB6QoPPpCoEDsAOkxdOjTq+3jYufw4R+J8HOQM+m4CUT5JwzOJPzynjfGUqRzxU0EirbQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(39860400002)(396003)(366004)(346002)(136003)(186009)(451199024)(1800799009)(9686003)(6512007)(7416002)(5660300002)(6666004)(52116002)(6486002)(6506007)(26005)(4744005)(478600001)(2906002)(83380400001)(8936002)(8676002)(4326008)(66946007)(921005)(41300700001)(316002)(54906003)(110136005)(38100700002)(36756003)(38350700002)(86362001)(66556008)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?9Ao4iu+Fur6EYrzKaqVDq59gyHVI?= =?utf-8?q?1eH5bQDmdcKnknWdbhUQZx5uxPRaOghUvX4VXRBzeZrQ2S3w+vdRjuRCpQowfYv34?= =?utf-8?q?eM/qzJoalpChZBTtfCubtitY+AHRFfCx2RIQmdvxAArfDqgYEZAuZjA9uMVeSPK82?= =?utf-8?q?sqSuQqV4S/BGr2IaMnc2PcuF8XmISBsO6rAsTGk7y8yqC7UPk6ByjbiHmLqgSGHwi?= =?utf-8?q?1i79S3Wf3dkx6kDNXqIJUHkDrXid0q7qdblRHrY0GwBu4ljoY8IZ1MRLJk2ZewZST?= =?utf-8?q?ha86EaNOuQ8ZCjXr1hpYTvHIjknMiJjqCA7MQQiVFS0oyh7VJnZC2HTUTqkidjFcW?= =?utf-8?q?qK7y65KxrxztlrrOFaalaKWpUbhUdOT8Vs44DsyOQri2UryG1kHQQ8586bxl09loO?= =?utf-8?q?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QZ++aXctoba2s2ssQDpvQDn38PpuIJ+paMQtnTYgM7FW80ePa?= =?utf-8?q?KYkd38oRzhh8e7EXNAxE4LVrv5JxWfHpVsSAJZmOKDSNXLGXLbLv1DKJvRU514v7P?= =?utf-8?q?QUTlPH3Pj44lDzYCEc5oaDrjKRq0tQ8GxCi1DroSWe/Jc97y7c1ynGGmXjv3LqiWD?= =?utf-8?q?2CvQGZn+6eYZlATkZZ5ZFVjXIHCtnAR7qZCpiSEeNm67ZupO3UD3n6fSWlQxN5XHP?= =?utf-8?q?kpqdzqyb9q+y?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 44053930-43de-4423-e7f4-08dbb3fd5040 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2023 02:01:16.0113 (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-CrossTenant-UserPrincipalName: F+nMZG0HvD0HK8rhI2qiLc+EpVFRrnjErs51ZueK78I+yr3W85gmXFMhgxL2WIgV1o7gD2xrqFh1Omb7975mqg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8894 Precedence: bulk List-ID: <linux-pm.vger.kernel.org> X-Mailing-List: linux-pm@vger.kernel.org |
Series |
genpd: imx8: support multiple states
|
expand
|
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 22cfa3020b18..1887eb1b3130 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -730,6 +730,10 @@ static int genpd_power_off(struct generic_pm_domain *genpd, bool one_dev_on, if (atomic_read(&genpd->sd_count) > 0) return -EBUSY; + /* Choose the deepest state if no devices using this domain */ + if (!genpd->device_count) + genpd->state_idx = genpd->state_count - 1; + ret = _genpd_power_off(genpd, true); if (ret) { genpd->states[genpd->state_idx].rejected++;