From patchwork Wed Jan 3 16:06:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liming Sun X-Patchwork-Id: 1881994 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T4vkv34tZz1ydb for ; Thu, 4 Jan 2024 03:07:51 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rL3mQ-0001Vj-Ga; Wed, 03 Jan 2024 16:07:42 +0000 Received: from mail-dm6nam10on2056.outbound.protection.outlook.com ([40.107.93.56] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rL3mK-0001UJ-HY for kernel-team@lists.ubuntu.com; Wed, 03 Jan 2024 16:07:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Flu661CHUcWS/UAAnue1V/PbbXybbiNQKwf8r+JYliIP0G+xahJX3Z+ihaMjaGueWv5FahDD1y5CTaxxOYvzN9Dcfl/YNPHxr7Dh5JNxqHTSKiB/m3n1U8dMYl1Z1Mff6VedMsUX89Mbkgga+XZwdrLZTXuXXJ3VMKSRUXIZUWCog7zggrTx1opmQL55BPh9v/yG+vevDh9KAeNousz9Wcxlbc9dkxvEy5PS9DlIrxw3efXVErF8B2LVxLHN5GX62zDZwm7Xg2A7s7NoJ0vFFlof+GLpxFfCI3+xSiK2GHJhxJoXb/yYtCbl8woVrXd0O/5zNUR7dJF2z4+SmVKqpw== 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=SVsUWDecY0JTxbQYIo57UGbXCpSEZmTsmCR8aM8kqwY=; b=H3xBKe4YZdSZoQoQSXsVS/xHunDx68BVlNhnJfPwuQK8Mx9Q1c4hzYHN1IJjRcDeogXxNAmC4S+RywFIKq4I7e2+BOqhTOTjIRY/X5vJu1UoM6YusljwRLEd5nzBs71tOQAuIrik4CqpXY901qNCuQs6P40ozcnzBsMqcM3AelNdCQJUNaB2NGRvCjX4o8sSAJNWTDHD8Fvat/d2rNPvnF+BUJ36neYXsQbX07JVRaEHn78i4jZsqYqzeyBskk/KtavCyLfSyq2rW9Jl3j3DwFCBOtgIDL8h3LBwd40KF1wAZbChlEoD3ctQCcUCiCpI09b9vSd8mEjgC1sHgMWmHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=lists.ubuntu.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) Received: from CYZPR12CA0008.namprd12.prod.outlook.com (2603:10b6:930:8b::9) by MN2PR12MB4237.namprd12.prod.outlook.com (2603:10b6:208:1d6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.25; Wed, 3 Jan 2024 16:07:31 +0000 Received: from CY4PEPF0000EE3C.namprd03.prod.outlook.com (2603:10b6:930:8b:cafe::b0) by CYZPR12CA0008.outlook.office365.com (2603:10b6:930:8b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.14 via Frontend Transport; Wed, 3 Jan 2024 16:07:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by CY4PEPF0000EE3C.mail.protection.outlook.com (10.167.242.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.9 via Frontend Transport; Wed, 3 Jan 2024 16:07:30 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 3 Jan 2024 08:07:20 -0800 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 3 Jan 2024 08:07:20 -0800 Received: from vdi.nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Wed, 3 Jan 2024 08:07:19 -0800 From: Liming Sun To: Subject: [PATCH v3 1/7] [SRU][J:linux-bluefield][PATCH v3 1/7] Revert UBUNTU: SAUCE: mmc: sdhci-of-dwcmshc: Add runtime PM operations for BlueField-3 Date: Wed, 3 Jan 2024 11:06:53 -0500 Message-ID: <20240103160659.144149-2-limings@nvidia.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <7315e47661ea7ae98ccffaee3c4d921c8de7ef07.1702924774.git.limings@nvidia.com> References: <7315e47661ea7ae98ccffaee3c4d921c8de7ef07.1702924774.git.limings@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3C:EE_|MN2PR12MB4237:EE_ X-MS-Office365-Filtering-Correlation-Id: 0a5d47ad-bceb-4191-53e3-08dc0c7616f9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7mFsA/eHv3+LNdiWDDhKUYsJJe30U9DfCWRucZm/bOOFIzFdl0IEmNmT3/Kg1j4e2MDPStZ1glZG8to3m7OQJ638U7puo77cIEr4b4yhDrqRoJj9B+wD/FKWFKV7m29zP5nziwAUAXXa/OR10SaMMiW+7uSkduuE5Td0VW0HJZlsZtleD9inATrYc7/QEa8gMx5w43+jFymh5wYZvQaVNp9PKLn0O332O+vp1vuVMWxxAmsLwB8dbj7/AvAD8WyxVpConT0I9SJRBabmTpt3PWm9TpK+ys2JFdLtbkevInq35c4tei3Bi9eb7wolD6ygv7Bil505b1pnIwJfMiBRKX6cSqS+NcihFb7w3je2yMIZovXGBjxak+3JvgoVll3RWgwBacOSIaNOn70N+0CSS1McEPjO6Jfdl5ohDjQj/E/cKTxgxfXLJF3a4njMF/x766bI16jwyOqune8nypY8XZ+JIo7+M7iDAeMMze4Bdo/AyDybDLMi7y8kzlnvGfiHTmG1ui+21zVc/DMouwS+xzMM2UPViPKPiZmyh4hzxzNv39g80GsCc9mq+Re2+enmCXctIGhFTr4i0n/ozQTFHH2H9VeruTJzfaaM1gtF4BnftBBMHifaFsQhzxZpYknpiyb55iM7MXEFuvdCsYi5x5SJYhtNQMRhx7W8LaZkNOz5Ixu8ABeIyQIjdkaFsi4etY6dI/6KhFYfXGG5RdQnT+xF6A7VJ5ukw7KcwxyXxJe8W2wqY4R5RfGrgjkpWEVLaZ5kioiP0J9MUpVjsU33BjGPbA//crrFYOYc+MMW1E185KfAaVZDAuJcI+qmrN1X X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(136003)(396003)(376002)(39860400002)(346002)(230922051799003)(451199024)(82310400011)(186009)(64100799003)(1800799012)(40470700004)(36840700001)(46966006)(2616005)(336012)(83380400001)(26005)(1076003)(107886003)(426003)(6666004)(70206006)(36860700001)(7696005)(47076005)(5660300002)(4326008)(41300700001)(478600001)(2906002)(966005)(316002)(8936002)(8676002)(6916009)(54906003)(86362001)(70586007)(36756003)(82740400003)(356005)(7636003)(40480700001)(40460700003)(133343001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2024 16:07:30.9943 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0a5d47ad-bceb-4191-53e3-08dc0c7616f9 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE3C.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4237 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Sun , David Thompson Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2046657 This reverts commit 3ec050f4050f804ad65d051796c95c49feb15efa. Signed-off-by: Liming Sun --- drivers/mmc/host/sdhci-of-dwcmshc.c | 103 +--------------------------- 1 file changed, 1 insertion(+), 102 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c index 188c5ae7efc5..87a831a752fd 100644 --- a/drivers/mmc/host/sdhci-of-dwcmshc.c +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include @@ -75,22 +74,6 @@ struct dwcmshc_priv { void *priv; /* pointer to SoC private stuff */ }; -/* Last jiffies when entering idle state */ -static uint64_t idle_last_jiffies; - -/* Total jiffies in idle state */ -static uint64_t idle_total_jiffies; - -/* Total idle time */ -static int idle_time; -module_param(idle_time, int, 0444); -MODULE_PARM_DESC(idle_time, "idle time (seconds)"); - -/* The current idle state */ -static int idle_state; -module_param(idle_state, int, 0444); -MODULE_PARM_DESC(idle_state, "idle state (0: not idle, 1: idle)"); - /* * If DMA addr spans 128MB boundary, we split the DMA transfer into two * so that each DMA transfer doesn't exceed the boundary. @@ -474,7 +457,6 @@ static int dwcmshc_probe(struct platform_device *pdev) #ifdef CONFIG_ACPI if (pltfm_data == &sdhci_dwcmshc_bf3_pdata) { sdhci_enable_v4_mode(host); - pm_runtime_enable(dev); } #endif @@ -569,90 +551,7 @@ static int dwcmshc_resume(struct device *dev) } #endif -#ifdef CONFIG_PM - -#ifdef CONFIG_ACPI -static void dwcmshc_enable_card_clk(struct sdhci_host *host) -{ - u16 ctrl; - - ctrl = sdhci_readw(host, SDHCI_CLOCK_CONTROL); - ctrl |= SDHCI_CLOCK_CARD_EN; - sdhci_writew(host, ctrl, SDHCI_CLOCK_CONTROL); -} - -static void dwcmshc_disable_card_clk(struct sdhci_host *host) -{ - u16 ctrl; - - ctrl = sdhci_readw(host, SDHCI_CLOCK_CONTROL); - ctrl &= ~SDHCI_CLOCK_CARD_EN; - sdhci_writew(host, ctrl, SDHCI_CLOCK_CONTROL); -} -#endif - -static int dwcmshc_runtime_suspend(struct device *dev) -{ - struct sdhci_host *host = dev_get_drvdata(dev); - const struct sdhci_pltfm_data *pltfm_data; - int ret = 0; - - pltfm_data = device_get_match_data(dev); - if (!pltfm_data) - return -ENODEV; - -#ifdef CONFIG_ACPI - if (pltfm_data == &sdhci_dwcmshc_bf3_pdata) { - ret = sdhci_runtime_suspend_host(host); - if (!ret) { - dwcmshc_disable_card_clk(host); - - if (!idle_state) { - idle_state = 1; - idle_last_jiffies = jiffies; - } - } - } -#endif - - return ret; -} - -static int dwcmshc_runtime_resume(struct device *dev) -{ - struct sdhci_host *host = dev_get_drvdata(dev); - const struct sdhci_pltfm_data *pltfm_data; - int ret = 0; - - pltfm_data = device_get_match_data(dev); - if (!pltfm_data) - return -ENODEV; - -#ifdef CONFIG_ACPI - if (pltfm_data == &sdhci_dwcmshc_bf3_pdata) { - dwcmshc_enable_card_clk(host); - - if (idle_state) { - idle_state = 0; - idle_total_jiffies = jiffies - idle_last_jiffies; - idle_time += jiffies_to_msecs( - idle_total_jiffies) / 1000; - } - - ret = sdhci_runtime_resume_host(host, 0); - } -#endif - - return ret; -} - -#endif - -static const struct dev_pm_ops dwcmshc_pmops = { - SET_SYSTEM_SLEEP_PM_OPS(dwcmshc_suspend, dwcmshc_resume) - SET_RUNTIME_PM_OPS(dwcmshc_runtime_suspend, - dwcmshc_runtime_resume, NULL) -}; +static SIMPLE_DEV_PM_OPS(dwcmshc_pmops, dwcmshc_suspend, dwcmshc_resume); static struct platform_driver sdhci_dwcmshc_driver = { .driver = {