From patchwork Sat May 4 00:48:56 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: 13653705 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2056.outbound.protection.outlook.com [40.107.105.56]) (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 2D325F513 for ; Sat, 4 May 2024 00:41:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714783282; cv=fail; b=VvfqhgUIxjtw3sSSVKo+CGuClhqQONUhuCQMip9V0TEhsbEXaAxMuozZngBQN+VxTxkZp4VHvVFYNDZeTIK0u5StfD8HJi7LtyYg+W1YAyEljGi5IhoKPIkpfYKPrQqWl2nwOapQIU1zVuRzIDsH556ftJxCqLpE87ol2lyK/3Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714783282; 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=RdUaMy1QFY7lgCfPxCqlrCIJ1bDbfdRXXBdV2fnxV3nM6ja+f1+MAZldDhsuB3bA04dV36c56kBxPSPj2h9Z4R5qCI22piMydAczecJdC55qjGYno5RaSLLhsFxEMPcOVYSf9XOXUfL+lykY4qWU+1sqjNmr9vWY2jsprAQMeUg= 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=GLXIn02P; arc=fail smtp.client-ip=40.107.105.56 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="GLXIn02P" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KgSfjn9xeKLa1mYgy0Ww/bUzKlKAcPdJ1xz5RzAEabHWFOEamO1P60yAoPoDjIn9a81ZLrAWD/AfUcViT7gGF9us64QeG1OY6X/trRcLdLq71fHvze+f2RXRRY6iqV3OE1C8qqxaXENr0iPPPqWuDZF12JVAkNJW7BQPJjOdMQxOqDPwkH3njI3jqmwkfTQ+XUrZGXGX9rd3WyxPeocBN8Enbx9lU1vHD/7AVpFfGEWRFQQCzJbr2SSefkNy1sC3hIFYxN1RPVDS1pq+RSH/ll6Nc84YgtnsgBgB8ZKRZ5oZ5/TzNCijNpvN8J2s8R+Q74jhnzOVgUHTbgmZ+ukBbQ== 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=GFyXAI9M4bDH3XQNHd3NzM7rYdTHB2003PUEcDr7ddLEFmuVfP5xGcLibA/unR9ScZpR+JNPwO88CKBcCZhkTqlFtTQDjTXEtIRCaxCMvoIfLCBHBuJ2SyOK7t2xY7h06NIuCVQiiCePTBVeDfyeYaTylxASB3RGFiP1j5iJ8C5jEj51MhVrDmBxDi3WQue86AogSRVYiZKVI2iVHxTn3K+eGCgZmnFxPsOf6W+Hn3dj5ra+WCkfM5+QnGSpvVYk2lnckV+BG+uRh8oQdPyHfhUCod3t4tlT396Bq0aEBSOKF7aX5c5woYcFuLjVOWwPwR0F/McprPz2Y/5C3ColnA== 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=GLXIn02PsN+LwIGw71rduu5txrbSXqha3OTKwm3lRmpyuNh+AKJbxTQ1M9PAtrUndilMJK8TbxC4qm2VKCvxhvVnTjogzAR2xYL74w2MN1fux56uHsQTEEirROSP9iFfzOwpN/Q0IdmheeeHkq0/NVXlsNcIukhPKnMSayqvKcc= 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 PA4PR04MB7726.eurprd04.prod.outlook.com (2603:10a6:102:ea::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.29; Sat, 4 May 2024 00:41:18 +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.029; Sat, 4 May 2024 00:41:18 +0000 From: "Peng Fan (OSS)" Date: Sat, 04 May 2024 08:48:56 +0800 Subject: [PATCH 03/18] clk: imx: composite-7ulp: Check the PCC present bit Message-Id: <20240504-imx-clk-v1-3-f7915489d58d@nxp.com> References: <20240504-imx-clk-v1-0-f7915489d58d@nxp.com> In-Reply-To: <20240504-imx-clk-v1-0-f7915489d58d@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=1714783747; l=1147; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=/EJNZA8jzAtJukHgOj2MT46tK7VZuwWKGrAynGdc6BY=; b=v21z0ZYsAPEAg8oXVf0AFWhYjB7qV1FmF/vTgvU6W7PnYD6JYU+/Ppjyes/fcKEHKD6cxOnNX vAlOSj5j3FzCth6Z+UOmmVZNbAkPR/VhJ+blpuAaiZPGMLjDjCdoeri X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI1PR02CA0055.apcprd02.prod.outlook.com (2603:1096:4:1f5::16) 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_|PA4PR04MB7726:EE_ X-MS-Office365-Filtering-Correlation-Id: 3225de88-7b54-43ad-78d6-08dc6bd2e986 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|7416005|52116005|366007|1800799015|376005|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?EP0W0qKvnukiFOQdDL24+f37u307smf?= =?utf-8?q?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M1GaLl0eGH3rER0OiMnQUhvX33Gc6vd+9s/g7dYqLmxcTujn1DohpcuKmzgtxN6a?= =?utf-8?q?fw8+M83q2w5IXvdwWgvH1E46QKUnTuEjfJpvy0GuP9MMgMSUWEk00UkjYfvva5IRK?= =?utf-8?q?Q4vztSWR8FcFvgeczqCXQT9aeYGnvSVHjg0i5ERPN9Py1Q2j9yQ8BtJ8cJF58pLHP?= =?utf-8?q?Wys9Opkk3Geearf5SNGtuVjS4rEj0xLOQPNio0yJnY7zQ0kNEFuMfa7wPc+pF3US1?= =?utf-8?q?n4CFzJqAewBWXtHYdqpE/IPg/q3UBYEWvM8q4DJJJfKZsYTXZ1zFoZ+LJF4ON8Yt/?= =?utf-8?q?3N5edymOpjBpHSOD7xZ1ek7E8hagE/vvfojdBETgO87koMI2KS2+JM7NaATysz8up?= =?utf-8?q?+/QXqXvwtdasvcyNfDSn8G7wOIcEZDusw00xZZo/3+eG74siph9Q91DU=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)(7416005)(52116005)(366007)(1800799015)(376005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?NryydF4UmiCdTZiMkn4I0lkCziwx?= =?utf-8?q?71Im0TF9ndrxlhdaaHc7l7wKjuWFN09iUee9Y1FEuD0diwnduPXpKJDK5fYV7FDXj?= =?utf-8?q?rTlM+H8q8ZwOanAdYwuKveNePdtxRI7dnJqWCjnu+2zKYWLrUb2o6R5o2Rx94vCP8?= =?utf-8?q?ylmsO9RTfbIl0DzolQBwyR1teGJn3j4AoQacxcGDrGnx2yuOZcIXYT1YUsbL1+EqM?= =?utf-8?q?o1EdLWjEHE3GYcxBUzvIn2KXXdaJ3/nrzMdv/krciuCP4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QEE25LRiy8XWdbRVan+ttRXGVwkLshRtC?= =?utf-8?q?fhgbUmi8S6bZpcBpGnK12yFb0jYmzAqEsKp2+xsXUTue9ne3cbes1fWcLC8UpuynP?= =?utf-8?q?p3W+5Go6zlCKTZkYfhpBmNAZ1t0Pw9rN0hnheDN9DYR1Yzs+SAnG8MLCfPzGsiEon?= =?utf-8?q?RHrkrvfLsXGVjJPVQXu1dvh7u5q+i7Rrv+TW+cMaU+rJire2RA99hMzISZ4c94qgJ?= =?utf-8?q?beE+NopSpuHo9rKPcwr2O0x6NtjzuzlLrJGn7u7YvfXTju56ZcCzHitqPFCEJqTfT?= =?utf-8?q?cr8v/hnBkCkXhNb+4/KV5/GdrkmC5ibMmEYU7Oko50CrI3r4JMjpErf5Mi3W4igCW?= =?utf-8?q?aXQpn3FJhZyGqkqPsFPyR2BEM+mfjImQCDrGRA7Tko0x05I9neZJvRjZMPwKNSXYN?= =?utf-8?q?wTp1/6Rb7Qoz?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3225de88-7b54-43ad-78d6-08dc6bd2e986 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2024 00:41:18.5745 (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: 8JPviVk4r5sNokSbVKuWCiYn4ZcST5W/Ck+3pbR9PzVk1k9bRhkVys0m7wm8zsCwIMz4ak7TQ9tb+5gwAHITHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7726 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)