From patchwork Mon May 10 04:00:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 12246765 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11BB1C433ED for ; Mon, 10 May 2021 03:34:20 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 63E3C60FE4 for ; Mon, 10 May 2021 03:34:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 63E3C60FE4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=h0v9PGKQC1WfHyD7hRCYjBnXfHAxodnEo86yEdMu3BY=; b=d+VbE1VMFmqIqM6PxH0y/0Zn7 X62IImdilbniPnerg2Uc2RmqaU79bjeTQG/63zk6MP8OpNZKR+xTEtRmfE2MAPgvfaJgztyJfAQ/i wD3/8sqhdVKW7FoQTDydTn3dZk5nXW2cFZ3FrUk8yLyd1MwxMnDlUAXg59J8xbZstKnYUj+wqox7P IxQAyFLU2CqtLKeKcqNElmU9RuB6xBNpbzij4WO4HiXrpWKI/1wAGR93S9+C4nudkbTC7qY+9VdUx jhIUaCKIvqz4MZ244AjdV6d81fkKkb42mSlXaHqXgxe3UC3/yADloK7X2316A/rtb8GTciljAG0wc B09dhz97w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfwdi-00Cyfr-R3; Mon, 10 May 2021 03:31:27 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfwc5-00Cy6P-Cl for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 03:29:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=uZOmLsY6WJNG2s5oD+u9itH2/YPJ0aEHqCR2x9gj644=; b=tfpY6l5qYO5PAsC+fzfmohXXmf KS9T6RowiGqQI5/ZO/JchfaQobS5Si+waFLBK3TOtPAG3rclKVBQn9NOwccEFTtuud5HLamkaRKBv jzZ6ppDJ6VJAGcG8hdyiQuEkbpNxXqsaz3btnII6caLVLphlw3JKjzNVxXTlhku7TWC1MiQeyP8c6 gVYW/d2E03ARLNGwYRu+Khm6ooposSWCjYX54edCUmrsFbG9xOq/q8FYpZyrksq1JtqZkmQrNBRJi y795IDVIOZKiL3HB22Q5h/w2Qh4RlydwRJIipBGYMdZRT0ex6qFVWAQ7KN5F+Z3nDstE6xJRLoH8a FIQik0Zw==; Received: from mail-eopbgr140050.outbound.protection.outlook.com ([40.107.14.50] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfwc2-008Elx-Kt for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 03:29:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lz3EtwVOsyXhInV8/H4Ym7kGSUMhNeTBWorTkTiDEa/8tfkFkjvsretL48uiU+9/IjH+6I4+ZLql1i3jf5bqrZwtWCMM6uPoOY4AVg6/JZAlOx0cNn7SfWH5QwHq3P0HkwDh8188EhXOX+iR3HrmxXUBqdZnfQ6Kniw2QgfMyqiFe6B5gLzLeKw/unvQnS2S3wzGKot0SL8JrUKlHuVTkLNJlSCPgArsdOVh7sAEGtqBWDG8ZZFb8/Dg48jgASq4l2Xfbo1pmfOjlQJrGZ7g/DDGktjot6BWBbKGLRJTzUMs0/uhs5Cp75wAZ0XGMKa2KqTh8RbeeI1O3UIqPPHFKw== 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-SenderADCheck; bh=uZOmLsY6WJNG2s5oD+u9itH2/YPJ0aEHqCR2x9gj644=; b=DpDaNqZ/2mb6cPsH6+PInnz+b3tbsrXshTu2GTt2wGrsclQYTDCj+gSFa7021lvHRycffr97N2W0u+LfL/10tUD9QbMTgJurz6fpKklvPAsnHQvk1BvgttPlLlxpbSyFlmvb2+6z7j94sYzhRvsE+ERq8mCpwRQ1EOGQJvu4fZ+g3/RJG6QrZbJsEx/YAaAGEIhpt++85XTQ7mtQOfFgB272MzFagZyNrEIsbSlyTbMa+SU4e/sfJr6QR2sjzM5EIb+p3YSKZrYYh1s0yjupnPOuE5jxo7CymOynLdYUdhK8bFve6qYFF/+m23H3ppwFzop5FCXL8+UJzfFkxawpcQ== 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=uZOmLsY6WJNG2s5oD+u9itH2/YPJ0aEHqCR2x9gj644=; b=VP2KQt+7TfeKrjTZiEeV++9ZsXLOEQvGVzQ/vNCMVQVUXjrXRIMt+54dxuSjObYXa3avdvarBkHVULERUALaK8X5lY5oq4fPgKBBQ6Z0vxJGWIGMGi41+qSfPJQKNve9az057ZG4yVeEdNRq0FVBmX1dIIaKcyggvspwe/jaNrc= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 03:29:39 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::45b9:c993:87ec:9a64]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::45b9:c993:87ec:9a64%8]) with mapi id 15.20.4108.031; Mon, 10 May 2021 03:29:39 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan Subject: [PATCH V3 07/13] soc: imx: gpcv2: allow domains without power-sequence control Date: Mon, 10 May 2021 12:00:39 +0800 Message-Id: <20210510040045.13225-8-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210510040045.13225-1-peng.fan@oss.nxp.com> References: <20210510040045.13225-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 03:29:33 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 73106864-699a-4e07-1b98-08d91363d7bb X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RrM9j12UgKSok3G8tnWhXlow4UW48buG20lwaiqq118aY3oeoFpN3ni327NS3PnujJHcKE2G+jebYMghHKn5+iPtY0cEXIk0amdEif/SOgMG8x8taDCm+vmri97RCd34VGc2FmyzoPSKBLPDuJMHBj8xI3s8kdu6O5x3jg7Y7sHct61dqcYTcPRQJ9yhWVOW+3eekl28Wny7NzvG7/Vce1/3GynXGo5eScbcQKllDf5DXp7nK+y9dnN7FiHRkyqYpA54xjL3EALwpIwKF8Wux6nMtUBLcl/pgctPpETMGQPK/e+h7QS17mCLHLVtfwb6VibNPQPjr9+s0ZkZfbW9L64repgtrf2p8rsIuhaHUuqW4/6OG50TCLIMRagx4H2kVAmtbFxdjtgTP5meUflsAvfRBFOGqnFyRwy20dI14RHzz7AUCkZFQcIG2X+1Tx2a1U2XxKCUscdKbNpf+UTF5LGQ2R9o0PL5l0SGBg0vceuMHvKFLFt5hTnmDDK8GcOWvcl6n4oZsV3ZFOchj1VrPu5lOn8ViJk16gbTyHrNkVUqoiQtMvCmYtOK8wCdwn+Pu/uR6EfVEpllh2UlrS/UNhI3L89BFqLka9PXyZ9wme4Ae12DSO8/qM45mq6o4g6cmoYVtiaL3tHeJyxZdbB4S/+Hj5fIeTXnRKM0w14x+IA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(136003)(39860400002)(396003)(316002)(86362001)(478600001)(4326008)(1076003)(2616005)(956004)(5660300002)(16526019)(7416002)(66476007)(38100700002)(83380400001)(6506007)(52116002)(26005)(2906002)(38350700002)(6512007)(6486002)(66556008)(8936002)(186003)(8676002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: NT8EQ3kLM0eeriUaPI+BcMy3CP3unBO8/Y5GNUGediHd3NkuNzXgwdAT9DdB6zs2/z8Qrghs5uk7d/lGvxEMM0RqTMRYUQfOsK33HLxtLsU5um4nHXOxDOVBRBhvxw/eSynzuz55Er3cENktfyFEpooYBlxCUJNtMRfMKssYqHTdLLq/aZiQSLIBPu2JD67D1vIIDCxdNESgWprMhQRZaZYPyUAlHE2t7Br8Cd+dW2vPfopOzCzn/COLgfG58eXXKNt2SusBFY0E6zUIZCX0x6KLkIk+LIN/aSiPzzpfSqZDftNILdkDRyHgYAadJnbu6Amt/FgBvbOnfc9ukDVk3mqj0J7kwalsUuAnQQNZPTOQEhid1BCWHkrjM+bjpsz6kMkK7vTIcErLwS1X+EMonQIllzKOMGZVBvubic5KXEOXv6jBSG3zugYYZmBPb1PHFGmJnrWkH7o/dFRxXwFX1jwqyqdoQZ8Vu0sSLESJ0L/zxCurUX45MCTLY0leXWARLCLHRB5ZPnbdjK/Zg6id1NW7yzekw5h2rxyljcUjgMwm7gvhWNhsQfrIX9Fel+vbiV3Cl/2Xckz7FZWUAEjLUx00NZn47hszUHFJu9lNoquinEqz2Gx0Jov9STgjeG39N2qQ0YR0Rcai5EveDft9zRl8YL8QifRMVnJ3ANzP9kUD8ZjOq9TL1vth+yXP9H4O0+66rTUsQi1n8fhYNzUznmnUcUomYDwTUACIaFt/0PWl6IlpN0YkRL5QDqZ0vOv3wSfYJYnpT9viZBnlUGrvjix52TJZMLOGjuEunTkcmjYVVaSDKfchdxDnruHewaoZ8IdSzWyiF0w7vy5cpwy1DZvRUObYn2OnJJB77ptmzNEsk2tqR22WC4mMDgvqZDd9d2ftRYDdPnEA8Sqp44OPxKM81PIfdxtoaFcrTAwVlXsg3WHPKfOccLmz4MSqwd7F0WHc+Zd5VALQxx9PMFR+SEmYIwlY/lb+ajDOyFkRUcdxnc/mXVHddbRpn3ePWDHXRzG+/psI4fKi8dceCjXmq3bjv+Kg8FX5zWksnf7sTi7tSMXMUj4RsVjlVX74rXsGBXfn1eKxAISg2zdV2pYZDmdnfBmz3h66kDvciXk/mtbjPlUTWg4lEIktnAczjgOCWOIXWkI9PEHCqnJ6FvAVMW93Zxu9UL4NMXd1areQtPDei6dLTzlFOrEOEnXoxNb+/1yNeqZpVOuFMy4zC/nUcZc2wRAmaKBhT5bJY/d9CrutCvobBR31n5yZzvOixNFMrxLjTvFyjgN1uJ2Gq+fvUXAo7aHYlNMYjYsCjxcPuDNfNHI9m2U+Y8s72cqpKCD7 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73106864-699a-4e07-1b98-08d91363d7bb X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 03:29:39.4208 (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: 0mepFt0GvAkD3WWnxb5m5YRNrbOCsox2DEIqT3/QjERSBJYSBu+KfA2OyGW/1k8UF92+0w4Pr/G12CJvIPaakA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210509_202942_719485_C645985D X-CRM114-Status: GOOD ( 14.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Lucas Stach Some of the PGC domains only control the handshake with the ADB400 and don't have any power sequence controls. Make such domains work by allowing the pxx and map bits to be empty and skip all actions using those controls. Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf Signed-off-by: Lucas Stach Signed-off-by: Peng Fan --- drivers/soc/imx/gpcv2.c | 89 +++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 40 deletions(-) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index 800287abdbea..fdf759a7c865 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -163,24 +163,27 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd) goto out_regulator_disable; } - /* request the domain to power up */ - regmap_update_bits(domain->regmap, GPC_PU_PGC_SW_PUP_REQ, - domain->bits.pxx, domain->bits.pxx); - /* - * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait - * for PUP_REQ/PDN_REQ bit to be cleared - */ - ret = regmap_read_poll_timeout(domain->regmap, GPC_PU_PGC_SW_PUP_REQ, - reg_val, !(reg_val & domain->bits.pxx), - 0, USEC_PER_MSEC); - if (ret) { - dev_err(domain->dev, "failed to command PGC\n"); - goto out_clk_disable; - } + if (domain->bits.pxx) { + /* request the domain to power up */ + regmap_update_bits(domain->regmap, GPC_PU_PGC_SW_PUP_REQ, + domain->bits.pxx, domain->bits.pxx); + /* + * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait + * for PUP_REQ/PDN_REQ bit to be cleared + */ + ret = regmap_read_poll_timeout(domain->regmap, + GPC_PU_PGC_SW_PUP_REQ, reg_val, + !(reg_val & domain->bits.pxx), + 0, USEC_PER_MSEC); + if (ret) { + dev_err(domain->dev, "failed to command PGC\n"); + goto out_clk_disable; + } - /* disable power control */ - regmap_clear_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), - GPC_PGC_CTRL_PCR); + /* disable power control */ + regmap_clear_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), + GPC_PGC_CTRL_PCR); + } /* request the ADB400 to power up */ if (domain->bits.hskreq) { @@ -245,23 +248,26 @@ static int imx_pgc_power_down(struct generic_pm_domain *genpd) } } - /* enable power control */ - regmap_update_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), - GPC_PGC_CTRL_PCR, GPC_PGC_CTRL_PCR); - - /* request the domain to power down */ - regmap_update_bits(domain->regmap, GPC_PU_PGC_SW_PDN_REQ, - domain->bits.pxx, domain->bits.pxx); - /* - * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait - * for PUP_REQ/PDN_REQ bit to be cleared - */ - ret = regmap_read_poll_timeout(domain->regmap, GPC_PU_PGC_SW_PDN_REQ, - reg_val, !(reg_val & domain->bits.pxx), - 0, USEC_PER_MSEC); - if (ret) { - dev_err(domain->dev, "failed to command PGC\n"); - goto out_clk_disable; + if (domain->bits.pxx) { + /* enable power control */ + regmap_update_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), + GPC_PGC_CTRL_PCR, GPC_PGC_CTRL_PCR); + + /* request the domain to power down */ + regmap_update_bits(domain->regmap, GPC_PU_PGC_SW_PDN_REQ, + domain->bits.pxx, domain->bits.pxx); + /* + * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait + * for PUP_REQ/PDN_REQ bit to be cleared + */ + ret = regmap_read_poll_timeout(domain->regmap, + GPC_PU_PGC_SW_PDN_REQ, reg_val, + !(reg_val & domain->bits.pxx), + 0, USEC_PER_MSEC); + if (ret) { + dev_err(domain->dev, "failed to command PGC\n"); + goto out_clk_disable; + } } /* Disable reset clocks for all devices in the domain */ @@ -536,8 +542,9 @@ static int imx_pgc_domain_probe(struct platform_device *pdev) pm_runtime_enable(domain->dev); - regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, - domain->bits.map, domain->bits.map); + if (domain->bits.map) + regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, + domain->bits.map, domain->bits.map); ret = pm_genpd_init(&domain->genpd, NULL, true); if (ret) { @@ -557,8 +564,9 @@ static int imx_pgc_domain_probe(struct platform_device *pdev) out_genpd_remove: pm_genpd_remove(&domain->genpd); out_domain_unmap: - regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, - domain->bits.map, 0); + if (domain->bits.map) + regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, + domain->bits.map, 0); pm_runtime_disable(domain->dev); return ret; @@ -571,8 +579,9 @@ static int imx_pgc_domain_remove(struct platform_device *pdev) of_genpd_del_provider(domain->dev->of_node); pm_genpd_remove(&domain->genpd); - regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, - domain->bits.map, 0); + if (domain->bits.map) + regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, + domain->bits.map, 0); pm_runtime_disable(domain->dev);