From patchwork Thu Apr 29 07:30:41 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: 12230545 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.0 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,URIBL_BLOCKED,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 E3FAAC433B4 for ; Thu, 29 Apr 2021 07:04:06 +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 2456360241 for ; Thu, 29 Apr 2021 07:04:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2456360241 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=YY5o+ptGm9kLocYn/se4zuPCRZY572YRmCUlDcBdHlo=; b=RkXiiZn9tlqstgKqMBVX9fNuX tz786UYclFmJVrj+5nXSwC7x7aa1sJ+N1IjM/JiAHPlRqHoyRn51qr3zUx1w/lpGxfQqedtqZB/sl +MxREq2awc63J1K5fbqXVKu/SQVOZhy8lWyz3GKBYHZZllsl4uJ00toDxJ0zCyCydegOP4gq0EjkQ Wf9He3qJdn98dhoqIPMWiY66SBOcBjE3FLvE92Ym7vCXstpfwSswXuHRWUs3Ib6+zDCkeNDc5QDhc SgJzs5HItsjY/naD2AyYg7O6ZErAh3iMQKvuXX1FPjDMNG9H2sdqhfW8vX2d6g4y5GpW1QjzQQI6b Y3zm0O+hQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lc0gH-0057yu-PL; Thu, 29 Apr 2021 07:01:50 +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 1lc0eQ-0057Vp-Up for linux-arm-kernel@desiato.infradead.org; Thu, 29 Apr 2021 06:59:55 +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=O0v8WtcsH4tJtAfSzv4uH4MYuURGDfvKhWs1KvqIGxM=; b=zviqZ/OBrNSSPbyepe0PJUg5iG Mta+ZvDIJadhbTb6H6ctBUKi9FiXypvkza0pmSTPKMwa58JYhtIzlqbb4GLRhBLOYXHeESYDEljsm A5MA+3kh4+LI8g0P9hlDVhE+maFRW/TK0e0R8bvusvHOR3i0GxLojr5buDS+OLTQeMQ7p1FR9GnR8 uNzYjaoyn00l+0Yp0MAPqZYt1E5DO/aCbo0W/5vnuajrlpidw4cE0xizFMhOcDQAYnvQ2htJtpKjO s11z6ZbKIpJz86YOp/1UyqqXU5AAba0tSg8FbtVl4Yiz2K6+r9q5ckNT/8uIv3HhXL6D3own7CSsf 4QbkwTyQ==; Received: from mail-vi1eur05on2059.outbound.protection.outlook.com ([40.107.21.59] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lc0eM-000QKP-OP for linux-arm-kernel@lists.infradead.org; Thu, 29 Apr 2021 06:59:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jRe3RF/TgtVeah6yqR0x03hDHVkEOx/bdgtW0EABDhchc09fE0E84R9j5Js+8GwI6m8wtGOQx3QLXv5+gUKZpMXSO9fAB2OCGjV7Pjlr3mJMpq+KSq9wS0N9sc4QtsznDXvXcaEZ1gXvrptv9lbtf1PnR0nMzG6jTrCtgHJmypkAyUsFsGVzQmvF6suLPPwTRJy/X/DtYt2v+MtGonhEG0s2KRaAn8I1HVb0UTaW6BvpmsMXGDeTEVcs9ZcJ0spw6Ezf20MukCmbeWJlpilFqnWBe7H2BS1Aic7tCc4Hj1UcLhDV4rzifZnhxRvpmVmr1dEdemVTaTNDNxoyqMSnSA== 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=O0v8WtcsH4tJtAfSzv4uH4MYuURGDfvKhWs1KvqIGxM=; b=EuMVWix9OiL9u1BI71lXDjxrWNZ/Pd9Y3bgpFTy26gSTlwm3/How2dmLAhmUwt+ZoMyQUcU0J8gSMelMOrV9T0siHBYl4xraSfwI2KLCh3JLnDoz14YD9gfKA28uxjI4BbmA2pGyA0TVIKKp8INdGiJSUbSiH4bMHFREpj4lKLKDHsmMvAhSJkp2odB5PmGlBPEAuz3IZM6hiWLZ5mZFfxaO3fyLj3tdMHP+PhmiXU19PwNN48AiXabdwYe/l/1WgbCu2zvSX88roEb/IL+0LWnbljkHxhm0fl6wGVYUyF0uAgk+HZPcAYnz57uVZ9QpygOgeltZLOb+mF6p39KZTg== 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=O0v8WtcsH4tJtAfSzv4uH4MYuURGDfvKhWs1KvqIGxM=; b=UutrzkhD+xPnEWtVZFt2VBVAwj139+GbbT9YjzdAnxX/rvNCuw7nzcftNBYyb4XtZOm2J3icGkYJPtQgOEFAOE0ks0ffjlUaJwKHp282mj+kAygHk3R2VZsI+KQcKbbiX0EjvRdWZvleaT6vps8ICHDxZT2W79QbXWt5gz/VxyE= 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 DB7PR04MB5468.eurprd04.prod.outlook.com (2603:10a6:10:86::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.25; Thu, 29 Apr 2021 06:59:45 +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.4065.023; Thu, 29 Apr 2021 06:59:45 +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 Subject: [PATCH 07/16] soc: imx: gpcv2: allow domains without power-sequence control Date: Thu, 29 Apr 2021 15:30:41 +0800 Message-Id: <20210429073050.21039-8-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210429073050.21039-1-peng.fan@oss.nxp.com> References: <20210429073050.21039-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: HK2PR02CA0208.apcprd02.prod.outlook.com (2603:1096:201:20::20) 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 HK2PR02CA0208.apcprd02.prod.outlook.com (2603:1096:201:20::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.29 via Frontend Transport; Thu, 29 Apr 2021 06:59:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c52b9b2b-aac7-44bc-dc04-08d90adc5ec0 X-MS-TrafficTypeDiagnostic: DB7PR04MB5468: 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: YvBA7aqvQuduiUtjeDNhmpUvIJ7F4czEsFpDYXTtInEx1Mq/LcTfxYpBhVgCxb79aN0HyNA8jIFBoPdTIlff8cF22pj7XlgoMu5FOW+0I2Y+XygMfGEMROs4Q31MMCg0eY4OB8dpiR6YAD53qhPSsKizwOIisrWblo1RiLbERE4aJLcY9y76581XeG6hWtMA5GhIegelKSrkdd6ECewNkLtHV2sSX59/8sp/KHzsIZz3ATWeXxppd+39rtnxM9O+HHRKyW6G8I0i/IGsCasb/YbJRELsOLqYaubODnFzWK9pPmmBQjqIgNa9ZmTNeHHSHo/faM0Wbf2j9g/KPW9+9Tv080rReUF1pWz+MLQBCSfkDJLVayrOvQTM7Juf+x1AuU+m5ubXn9VdL2ZWLyUD5Jy/Pyfk40ruWrA07UPsLI+nDW9aap+QxjgWxnRHd1fBILLSAzH2VORqgevqwYQczsePyT/aAXuw4JeNq2nAjj238XrpLVzD1CTktTdNiZMk7tBEa/zv9yqEjhhfW7yVqEVw/XcZ39ggDacSUP58wlkI5HOI4ZNYdW3nN3rfwup7wdvXSP6ydYDN06tb6dF7l4ISI+rnfC8lkQ9ju2Hk+9CEtcAHe342xCZVM1N9RX1ot1TDLsYFl9X947qAEOknm0QiK5+IInhpN2v6barXPPM= 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)(366004)(396003)(376002)(39860400002)(346002)(136003)(2906002)(8936002)(4326008)(52116002)(38100700002)(38350700002)(6666004)(956004)(6512007)(83380400001)(8676002)(66946007)(66476007)(16526019)(2616005)(1076003)(6506007)(186003)(6486002)(66556008)(7416002)(478600001)(5660300002)(26005)(316002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: EhrrDWqyTRw9lzPh7OFdgsM7HesHz1+BFndkyTtDxKVR3TRvbb7s1sgC+GuKjAkP4FTWkKCba0xG7xuAX7ri5bF8Cmw2Xw9cVuGBP3XGA/HXPizBlCG9NCn/5slK6SlX90fF6lRqaCzukr35O1N1XtifLZkheHWGnLINrHGcShBdAjJi+l5PFOH3JezR6ms42l0NmULuuGMgma3Zdq/iA6Y0HWFYJTIjuMziiMXJSdIUAmIy8TiE33MzhnVwYc7H8NqO9TAWLhHOx8yO7jruuTGmS7MLH6fD/0TGqUI6U8r9awItWhSOJ3Quy0KGGqrLMdAiFj6ui8KbT3rnUyOS3+KVx1WgnYMH5epIFotFqC14aeLlkEN7gS7qHZRpR17lacOYRQKir7R3OtA+yhQSv49SDzUG+VzpVUNjULHC4tKAuQz7zVCKvrAD1TR5Ygulw5t+l4DatyO6wsm0P1jQ1IviCtuCAL/rh2vQsn34ZKbCR/ajNnM/lB7i7WQ37fFuA9jVvBXcQgI9KaHnWcYcsjSg049E3ZoGvQ/JoxQPeQhzRolgYt0RgXMtHm3tGA9wY0NKl3WG56Tc7zgQVFoGzvunaHezxmcF/ZGCAl0dgMHA7IrvYGjj+MO0Pbe/n0CJqfUkZr9GU+rR0EO965jqn9IwJhtmuNO/wjztWyMiUNVmYpVPB8P0cAMsiqI6dOgTtO+7e0Y0yRPwt7Q7p5zfyTd2gG6yE4bm3TtlROWm5baHPpZiDC/IQ/4M7Qc87qZM373eV0tkp6UiDZPTBrZVG7b8M0DwQilj0tkWuJckig7ueyc7+Vkxxu6MOc8PQhc4xQ4y09cHM3m9TjuJer9bZ6PbD2XEWcaUOW8h0yoURqiUkhewUKSb7QC9ieDovRHn4yEn81Mjzfq+dKulhkqVnS9MOVJIKvn3cMtfuGY6WoWnymxmr7bGwLEJcOIVlzlSHzFH7vwmDSQBnK7wlInwfjcv3bWyW+FM/PHClYm8T/YvsMvgyffxZ6VEi0zauVoqI+iRX82MhdayPmwyj/wo2HqwfF/M/wMeknTstFbSY2IL5iII/FMZAvzP4zxd+s7SDa71Vqhjlor/FOMVpZRjVSdGg+eudePZyrMiRcC+icGLmFQ8WOr+tgTClh1A8ltvMqgz5NAHQfT0eVEn/q7otRJM7NQ1CXg6ksk6LSuB4Qg4eOQQRJyJz5exq1NmH7vaWHkG0v32ENTCY0qdORhj0ZefW4qFM4qyqkrZudZiavunuvjipFIxnIIn3rXaBo3GautM84l3RGBYZ/atv4J/VCHR+5MmJr+YYY9JkkBsyw1Ww0s3Y5I+7A9fQ+LGkyvv X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c52b9b2b-aac7-44bc-dc04-08d90adc5ec0 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2021 06:59:45.0255 (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: 8lz9bUdaOKbdmJdQRLO/2YH3HvY4wNU+37HLJiqBqeT3Qky674hFczZZwxg2u/XEMVwx7LmfdnBfrU6u1YvLPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB5468 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210428_235950_829209_4E344DE6 X-CRM114-Status: GOOD ( 13.24 ) 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. Signed-off-by: Lucas Stach Reviewed-by: Frieder Schrempf --- 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 87165619a689..640f4165cfba 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_update_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), - GPC_PGC_CTRL_PCR, 0); + /* disable power control */ + regmap_update_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), + GPC_PGC_CTRL_PCR, 0); + } /* request the ADB400 to power up */ if (domain->bits.hskreq) { @@ -241,23 +244,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 */ @@ -532,8 +538,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) { @@ -553,8 +560,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; @@ -567,8 +575,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);