Message ID | 20230731064746.2717684-5-peng.fan@oss.nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1848170vqg; Mon, 31 Jul 2023 00:20:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlECxp9mQ8uo7yQdkVWdfY86ljWgg59UDKROD6A6r6vY4Abu5kebobtfduuhxDtq9KzIP9hI X-Received: by 2002:a17:902:d2d1:b0:1bb:a55d:c6e7 with SMTP id n17-20020a170902d2d100b001bba55dc6e7mr10365953plc.55.1690788057420; Mon, 31 Jul 2023 00:20:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690788057; cv=pass; d=google.com; s=arc-20160816; b=NNgBxp+azjbKIO4Q6+CDdQwsJjV0cQ9jWQML4ml3KlX1tBrIL3tA42gSzhAus5H/z4 4m/75mjQ7NThNqhoQSzXhB50jDYtxbLg1j0E/H8po6bg5rsxJLw1hAaRc+uwpF38ukyv Jp5xhmCmsCjyton/b5KI0GnzL8dA7wPZtSoQ5B92KilB3f1Z8H09634jmSeoOnV2G76m miLjRugH0HnbAPzg6bU8PjTxKvNgOjPXTwJWFU02tHHeWpaJKTybiOLo0uefDP8Dge1Z Tpp4ATgcZQTNOOSSCX9cSDJlwJnuAs8PrTSMIZzHp9ejQoa2ilnhhqVoa4QLcBYV6wje Y+RQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6kP0lqZJuvmmSdkRT65OTRDCkODncocwe1oExCy4U/A=; fh=TlZEgCjOXNq8CKSnQ5emAFoUhkQr53TmuXUrJtBtV5c=; b=djzWpf9tb4kly/l57bNK4Dm2mRuzI6e3LaFUEI4LR6JpEgnFMC88WBlmIVdi2Nze4i 3jY2Hw0CZimvb+kMt+5/ij2Gv6SpjmMbX8bsZh1mmr2AqGAHs+XKCu5ucDQifB5CRLNh 84EcJDROC1yGKSO96KS2MUHH0vzysjF8up8OI9t/hrPVH8/cffgBW7lEfMYP3Mt4Yhsw i3kfI9VwxHn+fRX+cSGQt0nc0VB+NCrTe15B2bIuMOlzW8EbqdVeNZC8uv4JIKOHL0kZ jFXfPhoLzFI7DhZLoniSUkUrCzRS0ddkO0L15snh3JfvWughZBUhRBQpziK8Pq+fXSx1 Km7w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=HGyEvYpE; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id li11-20020a170903294b00b001bb9333f6a3si6608436plb.582.2023.07.31.00.20.44; Mon, 31 Jul 2023 00:20:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=HGyEvYpE; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230271AbjGaGna (ORCPT <rfc822;dengxinlin2429@gmail.com> + 99 others); Mon, 31 Jul 2023 02:43:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230268AbjGaGn1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 31 Jul 2023 02:43:27 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2081.outbound.protection.outlook.com [40.107.104.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7054010C6; Sun, 30 Jul 2023 23:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IzqHFurjMKJPX5i2w6yRD4hF6F7eoZICpvnd1xX9yrqS8j5XupmhYbEpS/W8fQ0EI09BiPONItmuYJSgjfA7CitmbE426g1OHBz+LgK3tgSB8eZnX886qRGRDspGM1A31s1prxbL/39ner/CacnIj7a+YWYEBMh8VdeBn/bFow7q03vBEfp4WzbT6ndV+13nM0WnN5bGw6DHBlA6J0dEDtWYH8gjxQbbfCagEkQQPuDTZOkMLCwJiredBb80ujyMblxDDeMJU8sSkcjJgquWMBrZ9MWwsDwMpompsikpj3fz1yO56qqGV0PwzrCWXf1vCUWwwGu7hvm1KxHnTFGS0w== 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=6kP0lqZJuvmmSdkRT65OTRDCkODncocwe1oExCy4U/A=; b=oAVyNLT/mN2Uxtinn6N6BEULn6xH8VR6xr3nxyqaywc6ZPuk47Qs04ttYe2SZrljULMjjbVyJH0f+/T6aXq4h1cD6JyGZTEefWHkuBdktBGdXP3s882jE7bs/zAYbTM9ZwjqLnfTt7GDlvNaeaXdCXj9r3KfDYiKg2M/7iKhnkoJCyEMSt2/+ZOPSFZYzNp+YI0amwfUqIcA/8975WN3X91uTupcs9LweFjQQe6M1iRToYZ8QuQLodz1NESp5yxQ/PFTVB2hRaoUjJrxB9i9drwDpnH0ijOZMFlm1kLvYfrTQ8EpNn1zavsCRMSv9ZbRTJakCqaGbJQ6qzK12HlChQ== 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=6kP0lqZJuvmmSdkRT65OTRDCkODncocwe1oExCy4U/A=; b=HGyEvYpE1uy4pEqUGC9AocmJioU4DKuano/1kLDLKf/VbF873nyC/Hu/B6+zfLx1wFkjZ38NXLxlk0KYLFLbBLXeUu0YqVVMTvG9/Zft5mD3LD0OFULyzRmQHsIkzmmNuDoA0YTTqTpopT9v7QidLeIXrnOVlIHqDpxmzQzMVDs= 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 AM0PR04MB6834.eurprd04.prod.outlook.com (2603:10a6:208:17e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul 2023 06:43:16 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::5d6a:ec53:f2a8:5b97]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::5d6a:ec53:f2a8:5b97%6]) with mapi id 15.20.6631.042; Mon, 31 Jul 2023 06:43:16 +0000 From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com> To: ulf.hansson@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Peng Fan <peng.fan@nxp.com> Subject: [PATCH V3 4/8] genpd: imx: scu-pd: do not power off console if no_console_suspend Date: Mon, 31 Jul 2023 14:47:42 +0800 Message-Id: <20230731064746.2717684-5-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230731064746.2717684-1-peng.fan@oss.nxp.com> References: <20230731064746.2717684-1-peng.fan@oss.nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0133.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::13) 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_|AM0PR04MB6834:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c7c132a-d438-40cb-7a4d-08db91916b96 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: xetCxadBqfxIboc5Pzt1rsHIR552LzCqgt5RPEehEh0jD3CNQm/3r086TwduKqNXMOAC6tj7CKOUKyfffntTejH3vYexwe5BOc/la+RF4NtEbNTqKj6zKkUfTTCbz6WHJXpK9eg0bB0CFwAndf1v7Obc4500eXBDqGHj5znpHP9Ulz3mAfoJsFYuIklq46yVNOtreGEXpWIDCksN4WXN4z8vWKhA6XwrMs6KurlzmF2ANmBOx+arK+tATEhX5mBMOO0MUEIyQoHrt2DJ7hID6/esNtZkElKKMQU7v7R2pSFwhksCAiQGljF30b2xO9pWSjJppPXJmGAuvsIyc49nP2NBGxmiggFnauZUtdKBza1e/iQIbFEHLjRcjbdv8AKNX/45GQMbPQr+qDGRBLUzIccMGiloxMLGLxzEkibmb+JqfUkZkdC6E0XifcPKbXEqiI1TcgGt9K0gFKZbIDDnXKTCyNI/mlMXK8BPkF0fgr6BVMVa5GFTiEBj0+CTsmGFQ8Li/PGUPieD2bzQAPN1SHuf3dYc43RFgCHCwEBi8ydSl2ICr3MjPmcU+YQSGmqDz5f2p12TJpEiqvVbsWlgusLNza5AZArflwTuhCXbiuP3jLK1njd5Mx2FIwn2qwEo 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:(13230028)(4636009)(396003)(376002)(136003)(39860400002)(346002)(366004)(451199021)(6512007)(52116002)(6666004)(6486002)(186003)(83380400001)(2616005)(86362001)(38350700002)(38100700002)(26005)(6506007)(1076003)(5660300002)(41300700001)(8936002)(8676002)(66946007)(66556008)(66476007)(2906002)(316002)(478600001)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: H97PuXemyXJI4lwMqj+NonyNwt2L1TPYkpbDRWIcvb8d6dtRJD3JduSSS+FwA6a//YQVCiaXwB3IYlCV+yCT7WqL/kuNV5g2wf7qcWFC19v3xDZQHhKvpESy73XknujjRZekZRoInyqo3tKC6fKuKKp4vR4UC5JtKK3Bfja4GZAxNK9r/+gfetDyCSLr5Eiea0KarxswF+FifGvh97NTtf85cNvnuItVcK2ADcgWVZEUXNLIEkehNop2AOSAnrbaMNrsk+AAW1JtNjESytX8FRqD6ICrTjjqXY5t8CmMHtsmViJhsR6dEXs5DXz+rFDUoJZV4Cqpb2xs0Rp8oCN8i2Vx05uWT00D4ZK51UNxeKayrjTdRtBT23Y4zO9fGSp4puOEltULH1styDlUQjqgK5TGByIiTN3BIwXqVL0ytdNqa54uvkuakjhQ7IF03jWeSDj2UGgSICp7JFRbme6f4iwaS0IS/prs+avDVAq9Ca7pNKERs9nwBFNMZu3KoL7LlkEQWWOnkMU7x8DPS3ddntcMJoNt410n5JatpP2/n8NKBx9+cmpJC2bQToFnZoOufpkDtUufWep2tqk2MLIF0l+wuji0ZKhdC71rxb375uBSjXJBHridBUPv5NAlSEETccoO7j2CL49nNGzIOLhclk0bk45LonhHsnQ/IInBrOZps2MQN5VfVTNcl+Z09TmIwaJ7uZ7VUSpQAKtLdEZ+O2+0LztUntVRkJU3uVak1/GbTnDjWysADCKbXBUYfi3E0hEDMT9rt5n1zyMFMIMNOZafIn2XsHvp2di00arTNrOYPKCf0qLN3PObdUq145Yhnlp9ebVS6rQck83cx2NPLvkseJSW+eGH7m79jfLe8zkQSSo08hGgMSpw3M+JmNAuMKV7nPPwSgVB+PPjNUeNOYOGW2JXMbYaIK4A1sE5HirR1wJsW8LvXdycSKdRbHf+0icI1KIjdY/TCIXL7FXyOFBHmwMmNYgI5UfaryZYVG/qPmWm6Y/sUDV4951MYXjIYDNRXZrvgZKtyAcNG6RLKacAylWF054Mq4WzmG4k4llqzxVAQXmnH/k88EDFu6r4OU7L3S6p0wYBft16ONTrGX8ztHxMBpUxEZzZ3z+HyRnkRPHtVEBiq+D6tfa/9FI59O9wRGM+rGXds4BLsO8hN1prs32x2vgTKwOceKhnPA/lneCLFweJDHf0In5k4fzgOsys1lGEJpmxlFxXSb4z7jRb/rEsveNd5eDU/cXWh6hg/KUhxpcMZ5wBX3hkEIetmCxdBCSoMUmhQFf98IYc/eDNRfvzeDqv4m6pE4fxeA48bUsWXOMVc28AcTR0h3Xs5mw/fKRZIUNy2TtI14GGS3OjVyQKE+N9ygKp9Mvt9taqY6yxKkb/6MXS2F5DgMvrKQZMXeJ4uVITTgTqW6lDqfA7y6Y8s6b5n5vRKX2M+vRy/xXcmmTrQyXghf/l1uwOBHlYA/1sfKJxJ0Q8+TlMBL6LsMqLNSjqYErCv5tT/Dv4wrRXdwaVykallswTipf9L2oTwMOsOM4HeLQpHmFmR+s0QwSaYTItqvMIdHpma/B/4vS8RjBqdLWvbJFwFGZM X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c7c132a-d438-40cb-7a4d-08db91916b96 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 06:43:16.7218 (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: FrnK6cuF7RDzBhA246FybYGW9KU1Ekim0pMEbhhkOK9WnDOkuMMAsJFbv0jZmvFDQgoQ1rpSK0d95XoCiK4TZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6834 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772919778131510635 X-GMAIL-MSGID: 1772919778131510635 |
Series |
genpd: imx: relocate scu-pd and misc update
|
|
Commit Message
Peng Fan (OSS)
July 31, 2023, 6:47 a.m. UTC
From: Peng Fan <peng.fan@nxp.com> Do not power off console if no_console_suspend Signed-off-by: Peng Fan <peng.fan@nxp.com> --- drivers/genpd/imx/scu-pd.c | 5 +++++ 1 file changed, 5 insertions(+)
Comments
On Mon, 31 Jul 2023 at 08:43, Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote: > > From: Peng Fan <peng.fan@nxp.com> > > Do not power off console if no_console_suspend Perhaps extend this a bit to let the reader understand this is about leaving the serial device's corresponding PM domain on. > > Signed-off-by: Peng Fan <peng.fan@nxp.com> A comment below - that doesn't need to stop this from being applied though. > --- > drivers/genpd/imx/scu-pd.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/genpd/imx/scu-pd.c b/drivers/genpd/imx/scu-pd.c > index 08583a10ac62..d69da79d3130 100644 > --- a/drivers/genpd/imx/scu-pd.c > +++ b/drivers/genpd/imx/scu-pd.c > @@ -52,6 +52,7 @@ > */ > > #include <dt-bindings/firmware/imx/rsrc.h> > +#include <linux/console.h> > #include <linux/firmware/imx/sci.h> > #include <linux/firmware/imx/svc/rm.h> > #include <linux/io.h> > @@ -324,6 +325,10 @@ static int imx_sc_pd_power(struct generic_pm_domain *domain, bool power_on) > msg.resource = pd->rsrc; > msg.mode = power_on ? IMX_SC_PM_PW_MODE_ON : IMX_SC_PM_PW_MODE_LP; > > + /* keep uart console power on for no_console_suspend */ > + if (imx_con_rsrc == pd->rsrc && !console_suspend_enabled && !power_on) As I indicated above, I don't mind this, but I also think this is a rather generic problem that you are trying to solve here. In principle, I think it should be the serial driver's responsibility to check the console_suspend_enabled flag. Based upon that, it should inform upper layers (genpd) that its device may need to stay powered on during system suspend. Quite similar to how we deal with system wakeups. To make this work we could do the following instead of $subject patch. 1. The serial driver should call device_set_wakeup_path() (the name of that function is a bit confusing in this regard, but let's discuss that separately) in its ->suspend() callback. 2. Set the GENPD_FLAG_ACTIVE_WAKEUP (again the name is a bit confusing in this regard) for the corresponding genpd provider. In this way, genpd will keep the PM domain powered on during system suspend. > + return -EBUSY; > + > ret = imx_scu_call_rpc(pm_ipc_handle, &msg, true); > if (ret) > dev_err(&domain->dev, "failed to power %s resource %d ret %d\n", > -- > 2.37.1 > Kind regards Uffe
> Subject: Re: [PATCH V3 4/8] genpd: imx: scu-pd: do not power off console if > no_console_suspend > > On Mon, 31 Jul 2023 at 08:43, Peng Fan (OSS) <peng.fan@oss.nxp.com> > wrote: > > > > From: Peng Fan <peng.fan@nxp.com> > > > > Do not power off console if no_console_suspend > > Perhaps extend this a bit to let the reader understand this is about leaving > the serial device's corresponding PM domain on. ok > > > > > Signed-off-by: Peng Fan <peng.fan@nxp.com> > > A comment below - that doesn't need to stop this from being applied > though. > > > --- > > drivers/genpd/imx/scu-pd.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/drivers/genpd/imx/scu-pd.c b/drivers/genpd/imx/scu-pd.c > > index 08583a10ac62..d69da79d3130 100644 > > --- a/drivers/genpd/imx/scu-pd.c > > +++ b/drivers/genpd/imx/scu-pd.c > > @@ -52,6 +52,7 @@ > > */ > > > > #include <dt-bindings/firmware/imx/rsrc.h> > > +#include <linux/console.h> > > #include <linux/firmware/imx/sci.h> > > #include <linux/firmware/imx/svc/rm.h> #include <linux/io.h> @@ > > -324,6 +325,10 @@ static int imx_sc_pd_power(struct > generic_pm_domain *domain, bool power_on) > > msg.resource = pd->rsrc; > > msg.mode = power_on ? IMX_SC_PM_PW_MODE_ON : > > IMX_SC_PM_PW_MODE_LP; > > > > + /* keep uart console power on for no_console_suspend */ > > + if (imx_con_rsrc == pd->rsrc && !console_suspend_enabled && > > + !power_on) > > As I indicated above, I don't mind this, but I also think this is a rather generic > problem that you are trying to solve here. > > In principle, I think it should be the serial driver's responsibility to check the > console_suspend_enabled flag. Based upon that, it should inform upper > layers (genpd) that its device may need to stay powered on during system > suspend. Quite similar to how we deal with system wakeups. To make this > work we could do the following instead of $subject patch. > > 1. The serial driver should call device_set_wakeup_path() (the name of that > function is a bit confusing in this regard, but let's discuss that separately) in > its ->suspend() callback. > 2. Set the GENPD_FLAG_ACTIVE_WAKEUP (again the name is a bit confusing > in this regard) for the corresponding genpd provider. Thanks for your suggestion, I will try it. For the current v3 4/8, I will keep it in V4. For your suggested method, I will post in a separate patch after I finish and verified. Thanks, Peng. > > In this way, genpd will keep the PM domain powered on during system > suspend. > > > + return -EBUSY; > > + > > ret = imx_scu_call_rpc(pm_ipc_handle, &msg, true); > > if (ret) > > dev_err(&domain->dev, "failed to power %s resource %d > > ret %d\n", > > -- > > 2.37.1 > > > > Kind regards > Uffe
diff --git a/drivers/genpd/imx/scu-pd.c b/drivers/genpd/imx/scu-pd.c index 08583a10ac62..d69da79d3130 100644 --- a/drivers/genpd/imx/scu-pd.c +++ b/drivers/genpd/imx/scu-pd.c @@ -52,6 +52,7 @@ */ #include <dt-bindings/firmware/imx/rsrc.h> +#include <linux/console.h> #include <linux/firmware/imx/sci.h> #include <linux/firmware/imx/svc/rm.h> #include <linux/io.h> @@ -324,6 +325,10 @@ static int imx_sc_pd_power(struct generic_pm_domain *domain, bool power_on) msg.resource = pd->rsrc; msg.mode = power_on ? IMX_SC_PM_PW_MODE_ON : IMX_SC_PM_PW_MODE_LP; + /* keep uart console power on for no_console_suspend */ + if (imx_con_rsrc == pd->rsrc && !console_suspend_enabled && !power_on) + return -EBUSY; + ret = imx_scu_call_rpc(pm_ipc_handle, &msg, true); if (ret) dev_err(&domain->dev, "failed to power %s resource %d ret %d\n",