From patchwork Fri Nov 1 10:12:51 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: 13859110 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41260E6B242 for ; Fri, 1 Nov 2024 10:16:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:Date:Subject:To:From:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=KIU2ZaS4nLmZHkDkonFZmnunZVFNb6KNBJYkhNR6408=; b=qFYrTMp65eLsZLknCV/RwsB7GD 7ylTd85M36HtCpIDBCWFHNcPMFo1KX8o1pmCq87Oa542CBFqQW4JQ3gMZTrDhIT7JTctfLjWpoM7o zhPstIsOuB0RSNu+/bG7kiMXZ/MJfm3AZDKM3Wi3CHnlKJoIPK2NXkf3ADGe15sS1hBF8LLd9FVAW eKWtEosRwPWAAMEv8xs2q6UxXvLnWIa9BPDUHPrwoTtOxZlgYEEmEEaiLaKhwGX+0QDONjYS04unk 8LvNr7naBlddMLr2bZOMz5I239khx6zGTXRBPGAPlTnwmiRgsQTZzlcbyM1OIdwJhaT+RRzNZAq6p lSN/w1cg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6ohu-00000006XId-1bZJ; Fri, 01 Nov 2024 10:16:42 +0000 Received: from mail-vi1eur03on2060e.outbound.protection.outlook.com ([2a01:111:f403:260c::60e] helo=EUR03-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6oUa-00000006UcC-0orB for linux-arm-kernel@lists.infradead.org; Fri, 01 Nov 2024 10:02:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WIbl7iRwXb6Q40Jd5e+/7vYQtKA6E4OlDqH9xtjGRJAfqawO7k4O+IHKRmZuJpNldvH5QKo71RcvduLzYZsbA7irqgVh41y7QZIShevD6kWIi3clXGDVpQxcKcNQaO4AmRvRmab7u03Vjb3c5YHHLyLgsyyy/mLKtV/UtWUBkpbsFuEpXgyGlt6Jgh4o+hxVUNMXBBh/Llmsqodap/126Mx6+/tHqssEJpngHAJJGy/6l5SC6KwGTF/5SO/fnePjGXeseOYar8AtKiH2hfZrz8IZ7tWJi9UfKZ9r0BZXTgwNQHsgOZmv6FnOWKedPSuR8QFaktiNSU3U7zHM96MZtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=KIU2ZaS4nLmZHkDkonFZmnunZVFNb6KNBJYkhNR6408=; b=XHqHwvK6QMpDEjfSeSj8V/CIY908WGNaL81Ia214086LWNHDCxslTsXzmNe4WWBz5EL2voW98Y+cQ5ZYCawhtciNYLCzv2tMieVtiGp8KU7I9eOF9vUZsc+ET3h+BRGpxT7jFkx8mNy6BQaXBSjqSSuXwIWMcdFPUC1onqaB9NPITqYV7zbzWvIEAPIPs+gh65Sg2YaWLh2ILKXdVaWeqoQkaONSd71b/2bqDtIv7YEmPDVKODy8zeEkwsA7Y/s5+21fDtmmcGTnVacGpkQlqrLHhYMADt/z7fI3EHvWW9NoN594Sa8Jy8x3l3L7hR0tH1Jo0W1FGmhvKb774vBG4g== 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=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KIU2ZaS4nLmZHkDkonFZmnunZVFNb6KNBJYkhNR6408=; b=wGU+26bnSif6XPzXmyi7yTjtv98aF9hXuAP3OamxqcN9ewm04UeyNkKgqDg/XaZnnkXQAz6FQXtAtlVaQdHhBkjfPbQY/pb6OhhpgC5LJAhNIAyO6qxsCNxtUrmH4iHVfGsHuo9oyCPZotdS7CEpdCR9Y6cJswyikKHcfqzx9CnQz3JUNO3b+4Smgu2bYUQFegRM/zYleEfhmXGREH8xvGGwmdohnQmRwY9BRIoo3K+TYMXKOeA0mvU0kjgGHg4TJTWx5wDJsW2hDUdurVIiW0+3lYbQCWszGfk1gUkAhZHQzUklTXnXAobtV4InRLJa4EVcqojE1QHqBHL9xmykUA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by VI1PR04MB7200.eurprd04.prod.outlook.com (2603:10a6:800:12d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Fri, 1 Nov 2024 10:02:50 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8114.015; Fri, 1 Nov 2024 10:02:50 +0000 From: "Peng Fan (OSS)" To: Ulf Hansson , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Peng Fan , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-pm@vger.kernel.org (open list:GENERIC PM DOMAINS), imx@lists.linux.dev (open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] pmdomain: imx93-blk-ctrl: correct remove path Date: Fri, 1 Nov 2024 18:12:51 +0800 Message-Id: <20241101101252.1448466-1-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 X-ClientProxiedBy: SG2PR03CA0092.apcprd03.prod.outlook.com (2603:1096:4:7c::20) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|VI1PR04MB7200:EE_ X-MS-Office365-Filtering-Correlation-Id: 5be43985-741a-4d45-4ba3-08dcfa5c57e7 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|366016|7416014|52116014|1800799024|376014|921020|38350700014; X-Microsoft-Antispam-Message-Info: d7PK6XJxJ3ZuVwIeN4boK7LBwVHNmLej5z6QvEixVr3FUpb+UErJj4eJAuRVU5WYFdL46N1Zku8RevNDdEdjw2dbKV1M5jx+DlKnvkGa3x8uNn7PDBVpfQPX+nF5CDNWqv8ZX8mDAXGOt4Tc+GJJXZwUd+NXAvoaZejsnc/HZt9Pj7tNZto81V5mS7Ps5HG+EMXitGDbXEufGtaYJc+UsVJX4pw+aL3nlrBNgPj5l68i9lSvqy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Yzu+Bv2YWZabBrAHflzKVGE7Qf/NoQCrYkCk8ambzzuEj5x8mFU7NsqdZA931r23EoJBBoe+cULS4 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8459.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(52116014)(1800799024)(376014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EWmp0M3IQmucATG+BzMWm82JdBqw1dvjmG6IStaILW0rpYygIBpHMh+cHxsBXX6dbLcg2wx91N7A63PgMJxdoNgZ3opLtlmmQN8p89S//wXbTfux8Y9ahH3+zhLA7tTp1ZNDmgpmAmH0oDnAdpN4D1mgSCHZMfC/p0j7u2yMlLOvAf/Nsjk5r2SvNUapV0uMN0YAGbFBQxDxkfUQZp+QX8Za0sgOOhbb87E48NbtHSNV4NMwMb8t2IKYsJP0bkoSvjbEkJXyKfbbaUI24KS32tZhAJ0jyhUfnxt2RNJc0oRK5X+LvKMdG6rVl2+MSpbot87uAkGDV7LLdowCzAiUM45JdpTexhaFFi0Kuj5rIw60YaHG0pU3p/Q9MREZV0280oBGno0h9wVgs/LYsUYmG6p20mKa7n0d/bngpm/E5f3H1pCQsMqKWnmB1l/Xa/1kO7se0COJ0KvBeO841eUVx3n07Jhoom6Dl2evnt/Yi9NFtaDjgfZnIU0QA83h+NGXmmZF/QEB5IhwsY3A87ST9fTYONHLY+HivNRLkZ7Ng7M2lMjr7FF0oa5de1usuoy3OZOEdIwLzTU09EcCN9RF4JbXjTTkiWqB5BRuabhM9AlyblFGUbhFww/k4HP1DPMFj8K4pPhUfKrEh6kNqvlOYGrbSvhgwWXda7CYpyIwEqPRQqlbKfHYij+YUnZF/iqaolLKc02v90Ke+qEZhbRkmohfMQSGQqe2ENKHS/Eo7v1h1KQ8jLnsy/A+Ml+KQ+8ZlrT0D/M3sQHFKT7ujHajCWCP1Jjw5iHwVOGeRNdYTunC+xMb3OmwQaYEHPoTFcdfqbJUv89ufgg9mAie9IXGULayezNNBzGqVNN8DGcT/JSoBpBYYeQDra3WuAJlgVEkek0qHHUX+bljwYeXkFuVQlwZ9wDrab2Lthh/dhkOOHnfnLCG99otWVhKv0GPhMN3uzSqx4HBX5GKX4uPgRjQW9JeS3FXx4AdDd2X2569wN2ShCPTOQSdsdx4bWuxl+J87R9Z7HjXaKgeTGACSk4OmADsTAWLyRL5xfK7TMJWhGJyabB5kRQspVgVDu31Joy+WDQ8YWjUfFvaXKtUaLdmNP47zbRP7OR1Fc4tWQJOf6Nat2OLQlZrzQd7MzUhFL5S6LW9hp63rqqxLwGzDB7R/3gsuSLBLT3U+vMqWoc3C7XdbxzCfZNEtfsEOcc+BYiICvJR2BIz4GIwJkAKTkHpr4PJfYz0AV/kSXcC/JzgQAs0laHv6S0aX5rYlqzmXCPXG1argHx9khYY5iL0uxHebV6+3GvOpaV9wkq8flLnbKn3RQ0WeeCAA6qMP+ZXfI+lr7SLshPOUTegeImiAhTJMT4cQIRaP8PlRFzcZB03ZJckxkrMGKvZkiDlLfNluCtqmy4JoJUDak6OTOtuSBAF5kLnBG55fxHCq/2jVi8o1rYRav6GfmGkTVABramVYQB2u85DjzG2zmFzEmxyhsR+s1v1gFh+LMrjbFNYuo5tJBQwGSr858yXn5a5eZkcInZeTs2ciicHfrDNX/8Mck9JK+nfpk9nWHNlxSEEDrfO3fDv0qYdhb9+BdO5WBj3GH7V X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5be43985-741a-4d45-4ba3-08dcfa5c57e7 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2024 10:02:50.1400 (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: XCcZD2InWv37niYAq9+q16dYniDKsKO9QmXhgPYKtFqnd4yBvZm763U2ELuNNL0AwyjGQNZ4/t0xOUtR1n5pyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7200 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241101_030256_265164_B034E4CD X-CRM114-Status: GOOD ( 11.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Peng Fan The check condition should be 'i < bc->onecell_data.num_domains', not 'bc->onecell_data.num_domains' which will make the look never finish and cause kernel panic. Also disable runtime to address "imx93-blk-ctrl 4ac10000.system-controller: Unbalanced pm_runtime_enable!" Fixes: e9aa77d413c9 ("soc: imx: add i.MX93 media blk ctrl driver") Signed-off-by: Peng Fan Reviewed-by: Stefan Wahren --- drivers/pmdomain/imx/imx93-blk-ctrl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pmdomain/imx/imx93-blk-ctrl.c b/drivers/pmdomain/imx/imx93-blk-ctrl.c index 904ffa55b8f4..b10348ac10f0 100644 --- a/drivers/pmdomain/imx/imx93-blk-ctrl.c +++ b/drivers/pmdomain/imx/imx93-blk-ctrl.c @@ -313,7 +313,9 @@ static void imx93_blk_ctrl_remove(struct platform_device *pdev) of_genpd_del_provider(pdev->dev.of_node); - for (i = 0; bc->onecell_data.num_domains; i++) { + pm_runtime_disable(&pdev->dev); + + for (i = 0; i < bc->onecell_data.num_domains; i++) { struct imx93_blk_ctrl_domain *domain = &bc->domains[i]; pm_genpd_remove(&domain->genpd);