From patchwork Tue Jan 2 14:21:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liming Sun X-Patchwork-Id: 1881637 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 4T4FXc1fT2z23dJ for ; Wed, 3 Jan 2024 01:26:40 +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 1rKfiz-0005gj-3W; Tue, 02 Jan 2024 14:26:33 +0000 Received: from mail-dm6nam12on2053.outbound.protection.outlook.com ([40.107.243.53] helo=NAM12-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 1rKfif-0005Rf-JW for kernel-team@lists.ubuntu.com; Tue, 02 Jan 2024 14:26:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VtSatSvI+jQKk08McH+RJVfvaGNY9nL46u+X+cK4AOl0fR6IJHrQ9BQfDapQflsDLt7f9YiOCiSXKKB5s5LLbQXVx0Sq0wLqe2EzM8MohCuhfymdgIlA6Cd9Md5SB6RtpYTQ5DtLw4kmeH664IlfaiJGGPt5NUhTBfVdBoxNoarcZp51K4mlnwDMR4SRTOgO4qsnwINTfH6W1/iQGCoi+3FchsUFMP20SWqFn+QjOrX5gjQPIM9tgev5vo+VxusZrlAeVJ8pkD11VTMVxl/f8OPT942O6NyKjfgBQkdFuFKM/CIHjA31VmUQBjV2F7x04EJqxEuMYGjEuktreJ2LzA== 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=MMEk7XssOIJiMqVRI7arq6lZhQmL4YQDaeOWI008uTI=; b=fi0Lc8NABBZ000SrV7fZRw4q18dn6/3KHgZztIfb6GzgKVoo7xkRRz/ZqQW/Mii2KuT4G/7HwV2I4HSnXKA3SI/dOkWLmKk3I2Y+Pl6uVMzyxTDMQkoAPJUtTX33ErEmmOQYtOaHKHwIXzdqElzbZLtmnqrfLs8l9mZApo3yAHU+Njvf0tLVjmPqLLu+PxW643+0VE2AA2jfLvHzMabtEImBx3T1CmlGRmWs+yf0m2uPFAWFY6rDPre2Q6iYbsnQOCwZ4FzlINx2ZJikgDDih7u/wRCjUnFHlqlEv3R7NoeNLF2ERcBEfpwONdEkW9EFYYXJ3H5mnTqpeevz+f/qFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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 MN2PR05CA0035.namprd05.prod.outlook.com (2603:10b6:208:c0::48) by CH3PR12MB7665.namprd12.prod.outlook.com (2603:10b6:610:14a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.25; Tue, 2 Jan 2024 14:26:09 +0000 Received: from BL02EPF0001A103.namprd05.prod.outlook.com (2603:10b6:208:c0:cafe::53) by MN2PR05CA0035.outlook.office365.com (2603:10b6:208:c0::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.8 via Frontend Transport; Tue, 2 Jan 2024 14:26:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL02EPF0001A103.mail.protection.outlook.com (10.167.241.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.9 via Frontend Transport; Tue, 2 Jan 2024 14:26:08 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 2 Jan 2024 06:25:58 -0800 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 2 Jan 2024 06:25:57 -0800 Received: from vdi.nvidia.com (10.127.8.12) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Tue, 2 Jan 2024 06:25:56 -0800 From: Liming Sun To: Subject: [PATCH v2 6/7] [SRU][J:linux-bluefield] mmc: sdhci-of-dwcmshc: Add error handling in dwcmshc_resume Date: Tue, 2 Jan 2024 09:21:27 -0500 Message-ID: <20240102142128.157022-7-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: BL02EPF0001A103:EE_|CH3PR12MB7665:EE_ X-MS-Office365-Filtering-Correlation-Id: 041adef3-12a4-4bf9-7da6-08dc0b9ec32c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: on8s0DVNONJ/WT66af7V4F4NsZXEbtUFpO49prNF3dXt1zXit2jl26bM3J2fIo4ixygVo0XVwfwhm/iNUTs/loyd7jN6bGlp2FNfIm3ehYBJ5puaXMMHri70AYrj+rLgAdqk/iguzuAs6yon+Be4gyn5i+Hy0b1n+jcLH7AsdeMpnuPx+SAnPflWtVk75EBnEHIjZbvBEdRLo3AmJNXjfVGKQNPLf7sPYGStii1YSdPjBcLbDaj597c1bXsq4/L0lGlZcI14OYYiwKmD56/DEPwGurSH/Ym/1r93jRteZMf+Eq29+B7x07F3lcCIp3cbgmKXavmzI7BPWKmtLaEm3QMt5GEqz+Or6J3J67dxOnfZFt7zdgpAOaqURSOMaRVTIWRdVbteE/9YCyZ1mOi3BTHxtulN4C1cBHkqrvUHsUDJrvkDi37zdmHiVZEFqvKYsLkmHi0C2MStlL06CTJ1X2gzIV9XGKuzEecl847s3nOAeHpeOxd/g1wy6VFH48jhz1U1QxXkbYH1LPRsyqK34VMYue65KoAd483hZt9nIb4fbDJLTDLNo5ZKPnCPboVKWzXFPRxO8ja3KyUoSkzrhUQ88dFd7wzMJdrM3MMvFPzqyprqKLG8WN0zbAkKSCT00x9iXqL8c08Gvx3QJGJgHEdY8hYLFdxt+GRn/xE8YjUMOgAJNvFaKEvrfQlxaP/YyCwN6BWWo7wn6CKjRGEBbtGufpePD3ZNObY/+fSe657XWyrrk78UEvRdu1zxAbzo6APJD7F2O18LTtEB+au5rxtnEGXIIoKctSyMkgUTy1GegCBFpcjGQkRaq21vDQ45 X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(39860400002)(136003)(346002)(376002)(396003)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(82310400011)(46966006)(40470700004)(36840700001)(40480700001)(40460700003)(426003)(336012)(1076003)(83380400001)(2616005)(26005)(86362001)(36756003)(36860700001)(356005)(7636003)(82740400003)(4326008)(8676002)(47076005)(5660300002)(6666004)(7696005)(70586007)(70206006)(54906003)(316002)(6916009)(41300700001)(8936002)(966005)(478600001)(2906002)(133343001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jan 2024 14:26:08.5104 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 041adef3-12a4-4bf9-7da6-08dc0b9ec32c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0001A103.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7665 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 , Ulf Hansson , David Thompson , Adrian Hunter Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" This commit adds handling in dwcmshc_resume() for different error cases. Signed-off-by: Liming Sun Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20230822195929.168552-1-limings@nvidia.com Signed-off-by: Ulf Hansson --- drivers/mmc/host/sdhci-of-dwcmshc.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c index 1e78c1e33325..bb0fe18be5dc 100644 --- a/drivers/mmc/host/sdhci-of-dwcmshc.c +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c @@ -536,17 +536,32 @@ static int dwcmshc_resume(struct device *dev) if (!IS_ERR(priv->bus_clk)) { ret = clk_prepare_enable(priv->bus_clk); if (ret) - return ret; + goto disable_clk; } if (rk_priv) { ret = clk_bulk_prepare_enable(RK35xx_MAX_CLKS, rk_priv->rockchip_clks); if (ret) - return ret; + goto disable_bus_clk; } - return sdhci_resume_host(host); + ret = sdhci_resume_host(host); + if (ret) + goto disable_rockchip_clks; + + return 0; + +disable_rockchip_clks: + if (rk_priv) + clk_bulk_disable_unprepare(RK35xx_MAX_CLKS, + rk_priv->rockchip_clks); +disable_bus_clk: + if (!IS_ERR(priv->bus_clk)) + clk_disable_unprepare(priv->bus_clk); +disable_clk: + clk_disable_unprepare(pltfm_host->clk); + return ret; } #endif