Message ID | 20240704132116.2865864-3-ciprianmarian.costea@oss.nxp.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010026.outbound.protection.outlook.com [52.101.69.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B7C01AE87A for <imx@lists.linux.dev>; Thu, 4 Jul 2024 13:21:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.26 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720099291; cv=fail; b=LQfTw7dmC05ARtirLISn8NgxDBIMOvtlB5CeU9Bf1hmFxnEdbyyzWqXrPr+FTyDbU8XJ1ej/OHfENkTMBJLZ1C2QA/J5HX7Oej/XJ3SwwSpmOuyTNhe4Xsb5oOjK6Ot0cAbnzv5rZwAXAER9k1eydD7RYE5mvxyghsbsLuuodOo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720099291; c=relaxed/simple; bh=4/UivPtlR60qrSoh3s+mf7nWjTTkNYETFIIUAGpASAk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=pHN4/mL+z8nJk1HlpdO9KRvYlZw1so+7cWhaBsaWfvvHzfTrsTMlW6DFKPeDXuIJ/gD/TqO9Nh0U3xYEDCTbytNwTcHeb5SezBFb2qc/2xa2IBQ9eDWmCp2qkkuZIGikWjvF1oi8+O5c/SsDbA0TcKKx1WnFlUPjz8vB/2yZbOg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=XFQedrG6; arc=fail smtp.client-ip=52.101.69.26 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="XFQedrG6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DRoxbc+KFGS6ibBvEl5UUiExNoj2oAC7hDCxzlpdtee5aNb3zf60QfGwYw4tJhQW66omIsFSWina1TgeaOciV3pQa6xvBnmGeWwHkhW/golAyDHJPk5ICU6bHqNTiLsGFAAjddtUcNLY/BA1M2kAXNKEnkquz5Z29IPOkttRWolwc5yKm78IfPtIjls64CaV0lU+SeDb7lAUwIy2qrHJkd6heN3mXmJ3mwAnsgve73RHKYgobZhfD/wUmjADRaQgY3TWKSMMfGgFwZp2ha+L7SoN+MljWdXBFfWfV0YDxnBK14d3KyoxtSoUryc6V0jRSogt0//TbEEJrD9uaKXKqA== 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=Sf7OPVuzFCVUbxqXMXgjlFlzFPQmuxktVkyKjUGXAQg=; b=l0Q+3aQ7QyaZqebWNvxH8ItA9ZIvjbU6xGVkKbQr0KOGuDMIg4NtATfv4WsDwgsvCE5Z0YPJBlmuwa0HO6XiwMYD0mGJDgr3737X8K5dW5j+BpnIHiCOHPbTWsAQIcvyRpWhiORX7WGitgVsj61iWDrXwrU9UMYLPAOE71CYRkLn2MkOyHrT+unC+h6qOElL16uniVzR3FJ1+BTQnaQy25RD8D7TOZe6NQyr4gCmH9TG39Ps9OAG3XudgSFABpUn4PEBU9kLIadmFHV2o3eAll3zIw9NIXE9t3SVC6uflDKq1FnkH+YfzekpF4eSHkttdKsP7GY8pby49Tm1Bo5TfQ== 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=Sf7OPVuzFCVUbxqXMXgjlFlzFPQmuxktVkyKjUGXAQg=; b=XFQedrG6zTZzhgJ6bFNX5Ws6B+XyTrN5lZe/nstjWkt0moFtER2kjUM+D3fhwc2/ES9TlyMGEkL4v4r1xJ1+2IIbe0ydoIqeAK+lbK1ixVTgfgFvr6Kf+OWIpNART+eYoVYQbzK67dM4pZSsgGs3rvItS7hJy9vlSk/DAX+rGc8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) by PA2PR04MB10422.eurprd04.prod.outlook.com (2603:10a6:102:417::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32; Thu, 4 Jul 2024 13:21:24 +0000 Received: from DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd]) by DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd%5]) with mapi id 15.20.7741.027; Thu, 4 Jul 2024 13:21:24 +0000 From: Ciprian Costea <ciprianmarian.costea@oss.nxp.com> To: Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, Haibo Chen <haibo.chen@nxp.com> Cc: linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, s32@nxp.com, Ciprian Costea <ciprianmarian.costea@oss.nxp.com> Subject: [PATCH 2/4] mmc: sdhci-esdhc-imx: obtain the 'per' clock rate after its enablement Date: Thu, 4 Jul 2024 16:21:14 +0300 Message-ID: <20240704132116.2865864-3-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704132116.2865864-1-ciprianmarian.costea@oss.nxp.com> References: <20240704132116.2865864-1-ciprianmarian.costea@oss.nxp.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: AS4P195CA0025.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:5d6::20) To DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: <imx.lists.linux.dev> List-Subscribe: <mailto:imx+subscribe@lists.linux.dev> List-Unsubscribe: <mailto:imx+unsubscribe@lists.linux.dev> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9251:EE_|PA2PR04MB10422:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b408c50-c8d1-4b45-ec7f-08dc9c2c33e8 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?q?JdCGTMGYjIYaKUJNS5LjUt8lyhXOqgU?= =?utf-8?q?YEkU+wJZaxch2+WHP8avlbQvlCzc85Ee8j60vG0+orulVpcoVDr5byrAtm9GCYNcB?= =?utf-8?q?btCS1NQVV8+y4tExAOjfQIafDu9Dp6MIZXmf0TJVTrXugOezjKRPcSOv4D7y9MsRx?= =?utf-8?q?jRJpaHMI5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7SsJVGb84V1ITQzsseggk3PZYJJGB2OkIW7fK7gyP6LZiDx?= =?utf-8?q?ck+VUEuRl+xNr+hcPpCm2E+zHlWVv7QgIo8Q7xmOFUSarpfdWwp884sxL8bIqVMZZ?= =?utf-8?q?r4CUVCwduI4RE7Sh4bk+vut8VPl504FOzEo85NNC/fPk7Jo8Xf/qqY6pJqls60+Ei?= =?utf-8?q?uVc9f7GzTiAPi34ciADz55E1xdi1MKNseGE9HI/DB7oGuApLmPoU4GZH7tTFnFV7r?= =?utf-8?q?FhVdCXfI7dxu09vcDnwqQil8Za2fVe1hAXQ=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9251.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?IWIzWmm3TPtlFfoebiaaS4i1f38q?= =?utf-8?q?OMoh/2JDiJyQBAKtm+e2pDtX/moWAKI8K6mPqvyIM788p+7z1b3b+Z2hvzagSgLkX?= =?utf-8?q?p6lRBnZfadW+E4ZVeFKkjXDMZKShtyXQdT5AmwZ7sn4JTBhcThxNzbZ3Sd/jQuJ+4?= =?utf-8?q?zsPujCg4tOmX//CDPOLcK0F/6zGzahep04un752bCFoVRgp6lKKHmKoRI16NCuX74?= =?utf-8?q?c9O7ai9HTw/2nTPPVqUY1uhpl01j7XeMAGS+OkcIsu99M30Dejywrx7l3gcDKpGT0?= =?utf-8?q?zqdedWZeiJ6U9llGElaGONpT1xuHwc4iIrpkUtv5zTXX2Irp9VA8SyIMYfS7hRpTf?= =?utf-8?q?em16g4tr+hWn7voQGtNmYsjLn15lYgfXmKAtDby0oHlkwYyCfug4ozjoZKGLYuZom?= =?utf-8?q?EvtEbtU4fBDeMNkA+P1KaXY8nzdc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7AVDu4X0wCVZu3k31/EKOSeW7?= =?utf-8?q?iOSuyJUneBDktptRCtgKdki76uJPPawrqAwomiFb3xh/FcU0AXz8/r+d5k4Vkgh7V?= =?utf-8?q?1zf/v/fVyI1sljeUtC1CL2wSj1i5jzu9Hh7WAkZXZ1p5uav52fa0UVj9ZjqGKDl1n?= =?utf-8?q?w2tlxuc6JitdZUL898bpq4L9UrvmdQo7+ghqR6GkviGCKLkDzofwMqOvdr67r/HLF?= =?utf-8?q?ZEsWQyRXC/eo3Owj3EcnigMar7+EHAcBAQ=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b408c50-c8d1-4b45-ec7f-08dc9c2c33e8 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2024 13:21:24.3985 (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: YmPHeCLJCfr1kQ3KK9pSfbpGF8QFHkB7JvFO5v9dV5sKLnLAq+m4J56w8dV+txHNlUQHrYZksYFzdP7GvH73ERvYaUuVXYP2tA7PFmfi3fE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA2PR04MB10422 |
Series |
address several S32G2/S32G3 SoC based boards particularities
|
expand
|
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 21d984a77be8..8f0bc6dca2b0 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1709,7 +1709,6 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) } pltfm_host->clk = imx_data->clk_per; - pltfm_host->clock = clk_get_rate(pltfm_host->clk); err = clk_prepare_enable(imx_data->clk_per); if (err) goto free_sdhci; @@ -1720,6 +1719,13 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) if (err) goto disable_ipg_clk; + pltfm_host->clock = clk_get_rate(pltfm_host->clk); + if (!pltfm_host->clock) { + dev_err(mmc_dev(host->mmc), "could not get clk rate\n"); + err = -EINVAL; + goto disable_ahb_clk; + } + imx_data->pinctrl = devm_pinctrl_get(&pdev->dev); if (IS_ERR(imx_data->pinctrl)) dev_warn(mmc_dev(host->mmc), "could not get pinctrl\n");
The I.MX SDHCI driver assumes that the frequency of the 'per' clock can be obtained even on disabled clocks, which is not always the case. According to 'clk_get_rate' documentation, it is only valid once the clock source has been enabled. Signed-off-by: Ciprian Costea <ciprianmarian.costea@oss.nxp.com> --- drivers/mmc/host/sdhci-esdhc-imx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)