From patchwork Fri May 10 09:18:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13661104 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2042.outbound.protection.outlook.com [40.107.241.42]) (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 13F3316D324 for ; Fri, 10 May 2024 09:11:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715332285; cv=fail; b=AZjfFjbMwbckxqe3KshyH/32sNZiwvZv+y/2MPXIUm+lVJW8pddYozmnwpkSgFtbAlWGLut1c+y9W3jEkwTSj9kO7IB9hd4xnuX/T69n/ffpwLFGTEBqxhZ6CC7QF6gbjYYK0S9qsG4zzw90zfp9ZhS9Vy/O3zSOWXW30i1SCVU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715332285; c=relaxed/simple; bh=q1A0+hU7W4e/wLAiXmKNBgA/x/XkBiviRb5Vkelujko=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=oQpIo3h9EZNPSi7NOl6mRiZuxBbuDVtBnI5e0GonDtqD8UqsKqsWl3BmI79120CpNpVYWEZNGhEPQlm8B9+3zWQHgqRuolpZg297ZFa3pLUbD539YBGEbww1v8GGaPiBjsIplFBO7n3etWBv/P0wzkpPBoz0UFAI9Jy5Cx6DOsM= 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=IX4kXX39; arc=fail smtp.client-ip=40.107.241.42 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="IX4kXX39" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NCsUfQsa8rJH/JKf4GsW9WLxdK7jzgkbol8VFBP9lqcHSa2Wln2fV5S/avW9GmhQBPJRJrr7R9dx48Psm97ijV1WFW8R+KdgwTI48GYm44XjIOZIZoFdTtB27So2vW/owmF3npSm5ht4eMttqYv5tok3+l2lLDhy8uABxbBCMYG2OLt4Kvta0o558+OccAlOgl9MwvPfpOsuE41uglJzn42E9zw0j9bWvvP7csF/hJTK6a0rwkzTzH1Ive96t1mJnQVhaD/d+QeFLeBdeHHuhaniPeb2X3ZAE9lNXwdnbxzyc9Ykhiw1RrsYSvrEHC7u9Xyb74UpPoM4+By5UcyiEw== 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=0IV//EdgGByvRtKbvLoHynbxEW/SMWswnYjQkG4VShQ=; b=UnRYpQRRyg0O7icj+2ntO4J1TTTTd6gEhebTGRGGSLuy+q/qJSolti6Tx8CyndZfSUqY2JPLhDQv/4O47aO/tuFe7xF2U4h0MB32Np5YT1U5btNuunD3IwhMr7b3BILR66ANYCImr7NZCGnwXelmNRz6nMn0bExahz7MTqjfxcEg5Ui4Az6JXSOvk2sQNUqAuDfB93IHcytF9Kn9e2gXIeAfKmZN0z2zBdetgqEQO0RcZCTyovywN/3sIM+hhOdmtaKDpmoucFVHS/iMZY1DrjqBlcvIrNb64A8hXJJXkxt6KpKuXc418lXUDBie2A+CqzZ8lmzSjPabiacgqCCRTQ== 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=0IV//EdgGByvRtKbvLoHynbxEW/SMWswnYjQkG4VShQ=; b=IX4kXX39KdazVCeRZH9MuUUl82FFOoPcVhNWgIrjBSUxz8wKUsIqNGrOEn5A/TFDdlQ54Fzea53KGqzLHmcmsoUDy0c8neKULahD7jyn7sPQOCSCOWorHe41xYuiUlTCKtMNMBv3q0ldVLZAAgUs4F2I8EP7Xe02Oxm2yjx+vog= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by AM9PR04MB8065.eurprd04.prod.outlook.com (2603:10a6:20b:3ee::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.49; Fri, 10 May 2024 09:11:20 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::d30b:44e7:e78e:662d]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::d30b:44e7:e78e:662d%4]) with mapi id 15.20.7544.046; Fri, 10 May 2024 09:11:20 +0000 From: "Peng Fan (OSS)" Date: Fri, 10 May 2024 17:18:58 +0800 Subject: [PATCH v2 03/17] clk: imx: composite-7ulp: Check the PCC present bit Message-Id: <20240510-imx-clk-v2-3-c998f315d29c@nxp.com> References: <20240510-imx-clk-v2-0-c998f315d29c@nxp.com> In-Reply-To: <20240510-imx-clk-v2-0-c998f315d29c@nxp.com> To: Abel Vesa , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Jacky Bai , Ye Li , Dong Aisheng Cc: linux-clk@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Abel Vesa , Peng Fan X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1715332748; l=1147; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=/EJNZA8jzAtJukHgOj2MT46tK7VZuwWKGrAynGdc6BY=; b=BhoYzWzem12RyUlfKIjN1K4C3wb0zCgV1enXgWI10eziSlgjuC0tKyCCVvapVqZBFkW5yxXnH 8eFKXY3BvJyBwIo37YbCjpGdsjoXEvP0BEv/AhMPjF+2BJA5gA8qPTP X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:194::12) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|AM9PR04MB8065:EE_ X-MS-Office365-Filtering-Correlation-Id: b417e008-c4c2-4fe0-e9f5-08dc70d12837 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|52116005|366007|1800799015|376005|7416005|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?JI+lkqJT6EkBhAU2G9D4gV5T0o2zBTQ?= =?utf-8?q?Bu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pQn02WoZQ9//ZXDcf21TeKmUJ6OBV7Sa44or+MmkRrbRgxFlPhZTsBi+eR?= =?utf-8?q?mrwAsd6G2i1DQZnvi2aNqeZ1LYoJt8C7LAaTNvQodFlBJzJw1AkLzacAwrOD0IERI?= =?utf-8?q?Yo35gKdF/mQJ2TvODxMHSnpi1EDiqcWBd5JqpnebAo2NDDNsPvYFijJcuAI8Azoz8?= =?utf-8?q?HJQxBpkty5catLKuyTb34/lczxJUvkznNGWu8BL7DsiJJVZ4d6CZEfewU0M6z4yRC?= =?utf-8?q?nHZWilT/JqqtJT9Om0OKmssMSzZrBGwJtkAxGUFxrAN5cNyHUeP0aFup4Lrsxq9x6?= =?utf-8?q?yZ9EFF4/QpBvCrUZpIL4SDX3PXePJcGFHCi3FEkdjtEEGZreHFxX90zguZk1IW03Y?= =?utf-8?q?lswBcpQVOBBUGGNUbh+7zaIDR4v5pz2ZIjWv/ouimwkMj2wrHptGNK+A=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(52116005)(366007)(1800799015)(376005)(7416005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?DOZxUVbEn2WqMb1mu07fqApGENsn?= =?utf-8?q?WVCUGrgbj8/feCCIHnW4c4PeamdZGvueiuT8DU5gBv4MUdUQohr+ksgLpu78wtyTW?= =?utf-8?q?bl+Rlftbfunnz6TRq53haCnO/h4qrT1gl19tjvM6M8Clp6xBbORDwaK2ovHKRTRQ8?= =?utf-8?q?HQ+6BE1I138KlipSRo+aGRnZE9ZUDPMfKwL/vITCRozXNIRTYxLreF0u+btgij9H4?= =?utf-8?q?KCpp5AXebcmuJER/ObEcai5bftzk3XcsGoMkucq6DFO+C8KxExnsy5Xt9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2chjX?= =?utf-8?q?BwRZxZLMTMWh6zCZzI/2jmK/fEirl3lU/ABK/CWlbTJEfKccnCWzowyYkqgV7JdEp?= =?utf-8?q?6SHBUqpwrnIbfVSnyrtkFHft3oC8c0ixJqniDF3i3u7EubXhdm1e3Aej0/0BTQtV8?= =?utf-8?q?eGG/zRoP6jezZ5ehuxNFCUAlPdhKD6p70ldqllK1NqB+tYcx5Hw4o9fYa+CEu9MZy?= =?utf-8?q?3TpBPgoapi9VBR59mGSMxmDWbihnHYbqTbeQWYRjUoHgdVHiYlsS0QkZfVjIXqYP6?= =?utf-8?q?4Yeex6//yfFnG/dbZEi5tFdaA7fb1uKqmBdZt6ug7Q96+sRQP5VBPMks9N16XAxK4?= =?utf-8?q?yEv/1EWFMnW16jtytU3rZAhhl/nUQJG3oZJWDH6qHNB2++3RZVaf/g5++Ck0l6H9K?= =?utf-8?q?zlbbL5ldo22V?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b417e008-c4c2-4fe0-e9f5-08dc70d12837 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2024 09:11:20.8696 (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: pgUNBs82w59an/CsbVdI2FyDCsB2sPB1cDbtzS24AeYwBOIxznMYE5T3WcnlEon9htKVU2Ob5q/LA7EVvp1Uww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8065 From: Ye Li When some module is disabled by fuse, its PCC PR bit is default 0 and PCC is not operational. Any write to this PCC will cause SError. Fixes: b40ba8065347 ("clk: imx: Update the compsite driver to support imx8ulp") Reviewed-by: Peng Fan Signed-off-by: Ye Li Signed-off-by: Peng Fan --- drivers/clk/imx/clk-composite-7ulp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/clk/imx/clk-composite-7ulp.c b/drivers/clk/imx/clk-composite-7ulp.c index e208ddc51133..e70a03e7299c 100644 --- a/drivers/clk/imx/clk-composite-7ulp.c +++ b/drivers/clk/imx/clk-composite-7ulp.c @@ -14,6 +14,7 @@ #include "../clk-fractional-divider.h" #include "clk.h" +#define PCG_PR_MASK BIT(31) #define PCG_PCS_SHIFT 24 #define PCG_PCS_MASK 0x7 #define PCG_CGC_SHIFT 30 @@ -78,6 +79,10 @@ static struct clk_hw *imx_ulp_clk_hw_composite(const char *name, struct clk_hw *hw; u32 val; + val = readl(reg); + if (!(val & PCG_PR_MASK)) + return ERR_PTR(-ENODEV); + if (mux_present) { mux = kzalloc(sizeof(*mux), GFP_KERNEL); if (!mux)