From patchwork Thu May 18 08:20:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bough Chen X-Patchwork-Id: 684225 Return-Path: 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 E1189C77B7D for ; Thu, 18 May 2023 08:17:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229996AbjERIR6 (ORCPT ); Thu, 18 May 2023 04:17:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229970AbjERIR5 (ORCPT ); Thu, 18 May 2023 04:17:57 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2087.outbound.protection.outlook.com [40.107.8.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13D2FDA for ; Thu, 18 May 2023 01:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=loL76uCeo4/UEb1fqLVf0jU94jqOIbbbcZaS0uMbAUByT6XjJJDe/ByyaicF1sVdohHd7aDc2du4klvJ5Agsm0ZgCE/P1vzkB2N6xhObGayQtA6Z/ZLIvV5PkjGtddbVmeS84BsxFFKbkNrkxoiLMaLmJ4i+GBr5+iK67ncEoSBJtU1ne4vozg6Rna7zErsHkibSCkhbUkevlcvxGlM5Aj2jKvnZJz+Ybn24IeXF3iAu6DInNYVGDhBJ/3+oMRNABkBJGOtQBxEmORJzbojDxkBie+NTfgwtieseOkNaYJ+/VoPWL6q7NnHhIEWI8vl240bLlWydG14U7Ah5HditDQ== 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=1aBe02MTKRQOv0Ma1J9LGLTKQzYjbFxTx03arXxe6tY=; b=hRpQ1pkZS+s8jxW228JoI5i8xg6w5nhLrMnfwx6QNYhiycCy7isbDs/MGWwEjXmWwwqHqcpYNP84g29z11uZfWfqnWJB0VJx12f1eZb4jxy/ulgLFGbHyvlwnqDYRiHF6eL+5fxpkkhj9WG0IvHQOjU5FzYOdHlGxhft63RjfU+JyJPSpE2EUewAxQ0rP4ARLwzQImyywGtvxpw8oQe0dcqhoIy5o36s1Nji/cV5ABItIbmFcQ5EgMvWX3NFr1ltWTh0hJ2fLiLlHEcNBNIpxohD4oiEp+VIXXqOeX7xNXErW156mWxkoY3H8Fo2M/201N6pyOFq8DeeTeFXCmr0hA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1aBe02MTKRQOv0Ma1J9LGLTKQzYjbFxTx03arXxe6tY=; b=JdeTsWRysYYHDO18wqCU+wbc9tuKaxaiW2cYLc/RO4U7jByBFuIHUf+CNhfA5pbAlPsnAoLrV0xgMvTEHRzARDDVtiRk4qTppbpGfiUwLTlIIm9IJRS6IVzIuD3ppmoT4aolckD9PVYA1bsz+jI2bsTkKriN0lWalwVM13tUAHY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB7PR04MB4010.eurprd04.prod.outlook.com (2603:10a6:5:21::30) by AS8PR04MB7573.eurprd04.prod.outlook.com (2603:10a6:20b:29e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 08:17:53 +0000 Received: from DB7PR04MB4010.eurprd04.prod.outlook.com ([fe80::60f8:95d:fce9:16cc]) by DB7PR04MB4010.eurprd04.prod.outlook.com ([fe80::60f8:95d:fce9:16cc%6]) with mapi id 15.20.6387.033; Thu, 18 May 2023 08:17:52 +0000 From: haibo.chen@nxp.com To: adrian.hunter@intel.com, ulf.hansson@linaro.org, linux-mmc@vger.kernel.org Cc: linux-imx@nxp.com, haibo.chen@nxp.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Subject: [PATCH 1/2] mmc: sdhci-esdhc-imx: enable IPG clock before register access during suspend/resume Date: Thu, 18 May 2023 16:20:34 +0800 Message-Id: <20230518082035.335112-1-haibo.chen@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SG2PR02CA0127.apcprd02.prod.outlook.com (2603:1096:4:188::7) To DB7PR04MB4010.eurprd04.prod.outlook.com (2603:10a6:5:21::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR04MB4010:EE_|AS8PR04MB7573:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ffdca60-f12d-42f0-1d03-08db57786017 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3wcXBeIywSoebaez/x4kqp5ZtQC7qO83YcssUaSz+WBuCZryDf/dgA2aiZjOdIA02qvVqa5+vrXUxwZ1DCJZ7kxWkiKZXta+MjbRr6F0MTtOhXg1A++dfvAEySCaYc9totSYT5RK1JF8edI/x0upQ0DhMc9EQOzeh6vARLgyjzxg79DeIH2kK4K4kztv8WavlZS5IP16QnHeVt1wik/6AQP0XWfbYWvOTi+AV7T/Jc4JpN5inLxcGi1wHmEYHRe/VIpjYWq8cJh4wYHtJ0nUwc0g0Ggg7QdN8JwQTZNVzAIrCFc+5z50b8zbYfBlWwZmKI2gOr7dfCLKEaO5S6GEcfnzhkjE2jmdNJd5hAarrz+dMx5/fDQ7na6QVZaLXCMQWJemTNsdh7yRBrmHDc1EPNizaMhQMceSPpNZ/FRIz4OwqisnUilvHea0F2eUgveNPzWodY67zrEJ8xGNa/ByqRLSmb3d42DLIWWyv8VzlOJyesuxcfjL8DxlGGqEE1QTClBrerQK7eWiK1uWlsYLX4AMXB3L8yObn2UOITMJ6EiWEgYXkUBrcr0t89YZTTCNmOgt4Qtmu3zyGwGLssLeY3X3wmf2X2FSGwG2oiDZ+rASLLkD3pdTk5+uuAAcVExH X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR04MB4010.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(366004)(376002)(396003)(346002)(136003)(451199021)(86362001)(83380400001)(41300700001)(36756003)(5660300002)(8676002)(38100700002)(316002)(66476007)(4326008)(38350700002)(66556008)(2906002)(66946007)(186003)(6506007)(1076003)(6512007)(9686003)(26005)(8936002)(15650500001)(2616005)(6486002)(6666004)(478600001)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jwT6oXInQugSpRGRy2TpytLMDef5TAvZHLFWMKAHvnKaHgHAo8mtZZvG6jsqCNOz58beCey2pzEwxL0ftlujZCcZrwTUnsWh51dMI9FpXYFUTxwApaPZJQ8faftiX730yTnS4e+Ix7yQ0nR4C9sn0vHcKIZ97aNSnxqMSfYyVk/60nlavqvmyNbGRxedmpo9GXUvWPHoXYrP/rRZIgmHG2jmgwivIiqtgu0VjAyn+P8b3RpB+19t3UgSvXxwO0V5lEp+FzZ6S9JYyVs26vnU7cbBtzqmVxIDaKCFIRSR5bkOQCzzDjd9EGIcyvSP7+tO9XbV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swltgVclbutYV0395LPhfYdEBCO8M8Q+zlqdJ2IfyTomjsptOa2NCbeM1i9HO6H6ALx04sPN51KkbKsZewqwOHq+/kbUtDR/PuyEoCdmbEPc8172exPz3+2BMry34BEiUUT2yVpJfj3y2dYhQbGsb5LE2qt2IZOrgoCza6rd4Zz1M3haPkIf6KhjczH7cA2S6G5WWs7HtAlYz X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ffdca60-f12d-42f0-1d03-08db57786017 X-MS-Exchange-CrossTenant-AuthSource: DB7PR04MB4010.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 08:17:52.4713 (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: mRAHOjvu4JMIvTEpjeUjfdGUN3VJ4cwD0eUUL+wrYOZ6lY3o8MTBcTv4DsNwtlZqXyRm7WPsWhuILNOWMIDpBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7573 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Haibo Chen During suspend/resume, need to access usdhc register, so need to enable IPG clock to avoid bus error. Find this issue when a card slot do not insert a card, so when system suspend, sdhci_esdhc_runtime_resume() will not be called before sdhci_esdhc_suspend(), so will meet system hung or bus err once access usdhc register. Signed-off-by: Haibo Chen --- The first thing I do is try to merge the sdhci_esdhc_suspend() into current sdhci_esdhc_runtime_suspend(), but find some obstacles: 1, sdhci_esdhc_imx_hwinit() is called in original sdhci_esdhc_resume(), it will clear the DLL config, which after remove to sdhci_esdhc_runtime_resume, will finally impact the DDR50 timing. 2, if merge, everytime after sdhci_esdhc_runtime_resume, will do re-tuning, this is unnecessary for the normal runtime PM case without power lost. 3, the CD gpio wakeup. Seems strange to enable the CD gpio wakeup in sdhci_esdhc_runtime_suspend(). So, finally I drop this merge method, and directly add change in the original sdhci_esdhc_suspend()/sdhci_esdhc_resume(). --- drivers/mmc/host/sdhci-esdhc-imx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index eebf94604a7f..4cf42a028bb9 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1836,6 +1836,8 @@ static int sdhci_esdhc_suspend(struct device *dev) struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); int ret; + pm_runtime_get_sync(dev); + if (host->mmc->caps2 & MMC_CAP2_CQE) { ret = cqhci_suspend(host->mmc); if (ret) @@ -1855,6 +1857,8 @@ static int sdhci_esdhc_suspend(struct device *dev) if (ret) return ret; + pm_runtime_force_suspend(dev); + ret = pinctrl_pm_select_sleep_state(dev); if (ret) return ret; @@ -1873,6 +1877,8 @@ static int sdhci_esdhc_resume(struct device *dev) if (ret) return ret; + pm_runtime_force_resume(dev); + /* re-initialize hw state in case it's lost in low power mode */ sdhci_esdhc_imx_hwinit(host); @@ -1886,6 +1892,8 @@ static int sdhci_esdhc_resume(struct device *dev) if (!ret) ret = mmc_gpio_set_cd_wake(host->mmc, false); + pm_runtime_put_autosuspend(dev); + return ret; } #endif From patchwork Thu May 18 08:20:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bough Chen X-Patchwork-Id: 683807 Return-Path: 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 55329C7EE22 for ; Thu, 18 May 2023 08:18:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229998AbjERIR7 (ORCPT ); Thu, 18 May 2023 04:17:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229970AbjERIR6 (ORCPT ); Thu, 18 May 2023 04:17:58 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2087.outbound.protection.outlook.com [40.107.8.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60948A8 for ; Thu, 18 May 2023 01:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y3EQMESeF/DD50M1bzLpnT5PToVO0ciHTSuKNLkiIY2Tr7WOGuma56dYD9DMpcOZ7jmZR9pLq7gaaZLCRhCZ4tdGTDcoCj7Mac4ouz/WCN71SjzIyFrOf6Jp0EpxY3oQ8rGRhsBI3ga34xNaiyB3B2TXHjkH5iwcfZYs5AJ2b9eXGiM6mFnBJB3WKUMm+2G+gjsSqGnnBH2zjYe+U7BV1Q+0SuCKtZ3jCIwuS7Z6eHqKw0YDrL6wKlv2/XvtmyZmMowWipKCmKz1n6GREDRRb7gxAWExFqxsUMlq95whMQ0KtJpfrEQhPUyaXgAvTOFAnYdILaiaoY+pgVfgXtMeFQ== 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=NBDjXeTFbKemiDC3iHjafJ3zXB1c2JX5cJClIPjkxaI=; b=KdXgY43y8vz2h51ZDUE9E+XSgW2TcF+iDFtD3cnfvzHaFUUwgoHBZQoBswcj4ztGo1ZENdEwpUhR3yPz0/cg+c/IyS2y70JzKuEprr7tfYOvPFZo+GxMkLsaPd0hEQ8NlzNPkPW/EPPyEUFpKl0sPEkKX2Bx4KnZUi/eCyJgNRPjWz605USr3O6R3w3j3OekrFjEm2ss9/XAu4UU7zmCi5kWDoodyN1GiHcmszJdqW98lXLScU6GhW9VBunP5TG5xfsyGCpTuLDzHVmTRkeb+p9H2vDllyHiGRaalYf2/74nfKvDQiOmSAOp6hzFl22kfbrmc7wApB1Vg4v2i+vK9w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NBDjXeTFbKemiDC3iHjafJ3zXB1c2JX5cJClIPjkxaI=; b=CKhq1EqBnwTOpPSJJYXpPy8dinaWrh3U9yOerlRwo4ZDNncyKMe8b8ePaieUkPf2HvEVto2Vy7Xqdl3FH/JEgTaPcsEjZlGjoLTlw+3A12g4vxNxUOXWL4xgbELg97tOcGGGbiVwpW3pDobIauW6UrTfV2dpQTIS17hGNoiI9pI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB7PR04MB4010.eurprd04.prod.outlook.com (2603:10a6:5:21::30) by AS8PR04MB7573.eurprd04.prod.outlook.com (2603:10a6:20b:29e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 08:17:55 +0000 Received: from DB7PR04MB4010.eurprd04.prod.outlook.com ([fe80::60f8:95d:fce9:16cc]) by DB7PR04MB4010.eurprd04.prod.outlook.com ([fe80::60f8:95d:fce9:16cc%6]) with mapi id 15.20.6387.033; Thu, 18 May 2023 08:17:55 +0000 From: haibo.chen@nxp.com To: adrian.hunter@intel.com, ulf.hansson@linaro.org, linux-mmc@vger.kernel.org Cc: linux-imx@nxp.com, haibo.chen@nxp.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Subject: [PATCH 2/2] mmc: sdhci-esdhc-imx: use pm_runtime_force_suspend() to optimize remove callback Date: Thu, 18 May 2023 16:20:35 +0800 Message-Id: <20230518082035.335112-2-haibo.chen@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230518082035.335112-1-haibo.chen@nxp.com> References: <20230518082035.335112-1-haibo.chen@nxp.com> X-ClientProxiedBy: SG2PR02CA0127.apcprd02.prod.outlook.com (2603:1096:4:188::7) To DB7PR04MB4010.eurprd04.prod.outlook.com (2603:10a6:5:21::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR04MB4010:EE_|AS8PR04MB7573:EE_ X-MS-Office365-Filtering-Correlation-Id: 5aaf8e1b-249d-4669-e9d2-08db577861f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GAtC66+Vo6oXWrRTRvGuBOUowyAXLVo7bESaKI91d5M29SKWnx3BJZKvzBcfYSB6rgkZdrRmmk1k01KZwe9DQQrFxK+UFnmSCm9EtVjleg/CWm+yayu/k0lNauBzGinq6alcrs50iUbKzjyqcb2rByjGwcdnWJwAT+caoWrxP3s8uKvaINLJCQTmv/BnQBGhDRHPldgKzsyu/0iIOgLxtNgKnRqA+JtVBoCq8acejwdvTknLsIZkILIIDf0/pGJdANIwSggyI7ZJq0rdcEA1mXnocDTLTceTMu7fFu7GF4B2Fo/HgRhBGox2mLZR1YJDXvIR8XTRZpYh+ghn1aKUvryqW2DY19YJxTdv/nFeME4Qavg71MCXEgpmnj/hw5FBQITVwJxVR4epSGfQKciGi+4rwXLRHwKBn6471BS5SWFFA/jHuQwOrz2pECPvfHjz3d0f5qdIwZlSfV64zYPA/SqIeWGYCWm2b4C7QySussl7a07GEKX5MpOlfMEPhWA26sPkc7pKjUMCrzNVnNOVPeP7xtEFBqPmvBCn/p2G34lF9jiOL6jiDnJeRVo2a1PrE1S7GPodfN3a15ZLUNuWXChD3Bm6Vbx8YXWJNCrMZlme2Y1mBt/FXSQDlBg7eleJ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR04MB4010.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(366004)(376002)(396003)(346002)(136003)(451199021)(86362001)(83380400001)(41300700001)(36756003)(5660300002)(8676002)(38100700002)(316002)(66476007)(4326008)(38350700002)(66556008)(2906002)(66946007)(186003)(6506007)(1076003)(6512007)(9686003)(26005)(8936002)(2616005)(6486002)(6666004)(478600001)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: D1mTfseDTOYRf9WdVuxJ8Sllo2/DvRVYBE8awRBtpR3ELVQEa48N6+ozi/hnnoBRcbYZ9xB7n/zB1Q9cTIJiHK3WKicJ5PiI66o+a7ETAVrtMGZfFmRJ6zFutdtI6KSffF4F1W/lu+me2O8phMXIiWhwOHI2oempARRFT9UwovXxVL5QA/s71PrtuEQCyryke/mBBi66RCCir+r7VzM/xEw/H+3DtFXxpkKrfOPbnuGrHhgdRYoDIYyZsyfFo7zr+ifL6NVJY1L4vVZKDI/sfAhEO67AmQkEiN87TSbmSPYSK3ICbhkYxIipGI+Wu2TFEXmMhEWvB3/T+KzBIRuUQWClsYo8ZEU8EpKFUy1PL/JCnfHhbDar6/CRcoRkfrlYNAHYH/kNw1aWaOMzmkq+/tX1zgUGL77aAZEzYk27Su+7zlk/FGPGTzUQkn6oqB45yQgtvpS8UX25KYxZBBZYB+oV6N2pjG6XTvQqqR8Gd9q48y3mZi+j1LXcSu3ygfEdubKw+OBL2kyMxj3h45sRlV11gcUS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change-CrossTenant-Network-Message-Id: 5aaf8e1b-249d-4669-e9d2-08db577861f3 X-MS-Exchange-CrossTenant-AuthSource: DB7PR04MB4010.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 08:17:55.5827 (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: 4TWiUj2fZppvUwH3EngwoW8cnUnreK0nI3ZnmpvokOktmQKM7MkSlI7nbJOGg2WazxXblwbRKClG+j0F0g9klg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7573 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Haibo Chen Currently some code in sdhci_esdhc_imx_remove() duplicate with sdhci_esdhc_runtime_suspend(), so use pm_runtime_force_suspend() instead. Signed-off-by: Haibo Chen --- drivers/mmc/host/sdhci-esdhc-imx.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 4cf42a028bb9..d7588faf52e0 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1805,23 +1805,16 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) static int sdhci_esdhc_imx_remove(struct platform_device *pdev) { struct sdhci_host *host = platform_get_drvdata(pdev); - struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); - struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); int dead; pm_runtime_get_sync(&pdev->dev); dead = (readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff); - pm_runtime_disable(&pdev->dev); - pm_runtime_put_noidle(&pdev->dev); - sdhci_remove_host(host, dead); - - clk_disable_unprepare(imx_data->clk_per); - clk_disable_unprepare(imx_data->clk_ipg); - clk_disable_unprepare(imx_data->clk_ahb); - - if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS) - cpu_latency_qos_remove_request(&imx_data->pm_qos_req); + device_set_wakeup_capable(&pdev->dev, false); + pm_runtime_dont_use_autosuspend(&pdev->dev); + pm_runtime_put_sync(&pdev->dev); + /* Ensure device disabled */ + pm_runtime_force_suspend(&pdev->dev); sdhci_pltfm_free(pdev);