From patchwork Wed Mar 5 09:55:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacky Bai X-Patchwork-Id: 14002472 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 16582C282E3 for ; Wed, 5 Mar 2025 11:08:57 +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:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=mrzNQ6xxO5XMmPy5DdCSSCRGmCtzogcRV3KQzK46K9w=; b=1VkTUywnei0W0x4zSHNoYLIMzD p6uUakMpqHoIOWH2tQ6H2gEgTDhSeIdS6PRcCob+F2PpX7lDVCmiET2TMxcs2bIAPbkexGCQW3XAz k8FdcX92kYAaWjVHGqJ741MGLxgWzyxRjjvjFYYW++NoYHGdk1YbHMupfoQAh34fatKFHB/T7D6OL VHOohPW6ESILq9o4lDA9igAVr083NDQKyJFovphfySIE60CXUIrvc/oImwJMuihDpFUEUX/LD1qhT xqKGubHPA+kyyYLPxE8FJmcMVNI3Ej3A7nsPsgVr3RsidEeyyznMNZU1TQ6AgGaXNLCV+hrwZI9TD NAuOZ6oA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tpmcK-00000007o2j-33pT; Wed, 05 Mar 2025 11:08:48 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tplSJ-00000007Zkp-2pry for linux-arm-kernel@bombadil.infradead.org; Wed, 05 Mar 2025 09:54:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:In-Reply-To:References; bh=mrzNQ6xxO5XMmPy5DdCSSCRGmCtzogcRV3KQzK46K9w=; b=LGZeNf7uVS/FydHqZ/kb4xPBUe hrIKXBPhLXzPbNz5qRC4ZVok1wMBrl7rfDmfZ9XVLUDZtnhVI303O+aLfnYRuGqZ31WVnCIkImuh5 Lf9XY3ZRjaIyJDxomh7Fj+PgiDWYiJUCiBqRU2pbrPqFWEPZYSC8+zkbzwYDZzfDtKQWKBpyMKbs5 LjON+t+Dhda//gh1/qObayQgXFUODAfifbIIDMGJDEG6pZpNZDNg4WG7tLiKXo5hXFGP24aN9SU6o V70GRc3LRGPX/fL8tguvThvqX4jH3eyau483NrecbrAJGrpSj6FphxVxH9M8r3HCmX2k6DNtQPrWi g/53/0zg==; Received: from mail-am7eur03on20602.outbound.protection.outlook.com ([2a01:111:f403:260e::602] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tplSG-00000005Ef7-3txR for linux-arm-kernel@lists.infradead.org; Wed, 05 Mar 2025 09:54:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yWohazJQml9/QPIujT77Y7j8EbMYb5NdSInr8evM1buAgdDvLdbsFSHN9HmSx2xhxTQB3dLqqCC7yAyBKrPrKolmP/Vz8gCG2BCYhNKT4FG7YLD//E2pFOQ5aP/43TXfT17iVLLzSSk6A8wAObODEGy53G6CMZIWJRt3SUGe5DUf0KOIWqyGHOWfgk1b5KBmOJ0VP8naypZVtG+PvHgCLyzWlZKwja4LT/OyVPz4I8Ks1iLHWZtRtj+o29PUWYmis1mJIPrWjjRoLB7GTB+x77Unii9FsbdaxJlixSH+DW1JKJj7N8SWJ/q1VotsDeySzPcOTRUdwXsnb/L/uzJwrw== 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=mrzNQ6xxO5XMmPy5DdCSSCRGmCtzogcRV3KQzK46K9w=; b=ByiA3YNOtStYkaENpKFf6TTM7hBPawTSUJjgUrvtu6rn21Jcc+GKBd02qHV28b4saeu09c+vJSnKTSnGWpHewteIU1xQK7GLeJ6AAklyVSspTOraCg/oOJZkSOERrMVmALRLfotLH7mTgc6MeWmLF+UmCSGdlioGZuC0egHruFCp+o8NoMsANbR8U56ijfWL8CugLhzmCLW6va6GxbN5g4+MWyND25ABCwmSeg9X8unri4zlD9VKCSIEkxN8af+F7TE3mwpWsuYZjHXNYTQLCkwR6OVYFpQxlZhFaurd8Ra+AObXyBfaOov8ZRJSlWaxldV2p/i+cIxV2cgBIGQokg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mrzNQ6xxO5XMmPy5DdCSSCRGmCtzogcRV3KQzK46K9w=; b=ej5AYRDsxAYFdLU8oRUDWy/MWkVdQG/cjcSwznJBLl/sOFRMqfECHw59armiHCvqT3n6NHBD0B6+XHBImuCZamXl8Af+OtNO/1zjkCpGVs4jy3nUyRGCsUmfeB+6dAKHFmfyERKl27J69nkwOT32sHzKkq5MQTIU8Vrpi9UzXmTr7v2DUZm0rtfz0IWt//lErnwmn1ct2Fj546JcMRgpxGprCo9QYFvQWn6akS398+ft9EuCbXyBiH8FkbcwLIglmhzoII+fsKrM7S+9onzIJqcfDjrQssafRiEy2rvWfZ7Y/E9Lr95sQJiJQU7HLGMQajNeEJqblVQwUNIqnLe4Rg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8642.eurprd04.prod.outlook.com (2603:10a6:20b:429::24) by PA4PR04MB7552.eurprd04.prod.outlook.com (2603:10a6:102:ec::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8511.17; Wed, 5 Mar 2025 09:54:15 +0000 Received: from AS8PR04MB8642.eurprd04.prod.outlook.com ([fe80::50d3:c32a:2a83:34bb]) by AS8PR04MB8642.eurprd04.prod.outlook.com ([fe80::50d3:c32a:2a83:34bb%7]) with mapi id 15.20.8511.015; Wed, 5 Mar 2025 09:54:14 +0000 From: Jacky Bai To: tglx@linutronix.de, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, aisheng.dong@nxp.com, peng.fan@nxp.com, frank.li@nxp.com, shengjiu.wang@nxp.com Subject: [PATCH v2] irqchip: irq-imx-irqsteer: Update the CHAN_MAX_OUTPUT_INT to 15 Date: Wed, 5 Mar 2025 17:55:22 +0800 Message-Id: <20250305095522.2177843-1-ping.bai@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SI2PR02CA0022.apcprd02.prod.outlook.com (2603:1096:4:195::23) To AS8PR04MB8642.eurprd04.prod.outlook.com (2603:10a6:20b:429::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8642:EE_|PA4PR04MB7552:EE_ X-MS-Office365-Filtering-Correlation-Id: 2d553762-1e4a-4464-418e-08dd5bcbaffd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: ZPPU6BEywHDu+eAKAENYm8E+UncOREm+9/8Hhb8FppfiLrKCOtsFkmejK63N575wryaxUDuSnfjfBVS0cXhUV5+OFHOxskPNs9KTt10BOreDrszZljXxntqWAzlbwhkHJD2Dol+VmL04yna9euNDYRO7nmYTiru2Qu7+mKcCHU8hUgAT+nvDVySWrFgY7Jonz8VMpJ+TRf9z0+bjseJ5BjbuCMW5Ueg7KL+HGHabyrgskDnCRxNt+9ndVcYN8lDrPcTVYDiTmXjQZR9H7Umcnl8ZLAbTtC/wC2LybbgD85G+znfRdC9wXO+HDRVn77vPqniU3mVnHoHKHNuo7RoQoX+GQIpEdqE3mWjT6F6/oTHZygiNhgY73Uh9oG9/nOdpcZ4fiVQLVFPrCEpNsKLoV8KWSU/7Xus6nc9YzZgN5kQBgk5IEiB727ttsxvV2z6dWBWPloQUvIM6T4zGt7/rlf/fC6QsiAKyN/JZRGl4FOEQ7lQ2R80GUxBYXmXUnfCOuy39ELL71urBN2rgRES5mVzjRo0QtQiFALmDirXOxhSt6/rLAFHlZtv9tAgLq/U4cvGefP/JalsBBeZc//pt1g4zYWSAX1bxE7pi6E6U2Vjq85c26F5Z7x3cGSc+hf9Uxzw6KFuKtW3TJ7idSpd+8xN/F77Vjx9r+CzOZcusIN+xGXgX7m3uNpEpqs0UiIEMSOsblXR7g/7XeV/Fq+0L3UXXo5b4r89H2fOQLuGlcVQiNeagjWDxP9Dca9eDi/GNMh4O/hZtbhUJnMg+8Mufub1IU4LPcC9jEJ4FJ/BQwMYf3l7ppPaEWKpK8DisXUva89H3SgH2qXIC8z6FskAUWz4ZKgz4EoIcsZlHrmjfAwwS2XEOoy2vLzfd+gKGLAKXlecSTeVXwECfhSAATd4xjyS1X/mdqjAlZzQNii5SbIbp6Ce79Rhc8layQWVu/cGVCi2tgRfgN40UjVJ+a6Fl28Fmqp1alJ1YsVtGBoY7sdK3g3OKo/9jf982SGjapPpeFHsmt1jmK7ViXJjpG3JTnmxp8jdZ6Kk/GUTDrkf4HW/eUoXPTm4Vx5BNZWPW4iCcWNZ7aqBuykMU+6fC18RUH/TGFCPwZo8E24/1FJJ/iYmnv7Xn/GcVp5qceNwgQ4abnO+x1fkeeH7x/Sl6pwUmzef1FTDOswHk8WnlRBdMzlRemjtr5aBTnwKy4EMC+L7coYisBsL2+eH2Fsg6HQ6cXlMkqDQctXi56pFpMvTGagNYmEQCYHC83X3C1FZV/u5ZUby4zBxN69QRE7nyeNvUGSyzUARZrKnRt4AZNUeXGMI/wAsuha3+R1m2YGB3kQLMMX5o0J0cy2J40VhE7gIHQ6HBc7G/Xl+R2bLZ5htfTT5MQbk5tKia07jpc7s1FSlNeNTkl4PThXnpacNjXyZH77WjZs/Txgt9D0wdhyipK8HLDitxBoMZOfiORPLYDa7m X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(52116014)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: epsjKApbhPqGJksangejQW9GA8mhk8oBSCGKga3opyhPT8uszrLhoebiG9Mf3BG+rG3rLtxizMyTrEnWbCN/PDymwrM+Uec1y3k2OeXuslp97bv0oJ4w4hEpEOn5fcjj4EtX4JzYj439VJR9QZ3D5KQuXgzY57c+q9QRynOgA+SufZCDRunIkvt6i3qdCGYsxNP2gvM6VKaBffNmVh4Y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r9Hw+tNT9tQsOf/5+YjVVxTVDEhMRvO3SjNo+QaEOT+FgM5XKjTtS5onwfb0svu4qd1hkAdZQqaKBFBm9ICApBx4xWyDP7fBoTTA6JDue9X1hxYyfkXZ+7hIT4+GeTrsNPKhYMZObBYpn8amufXdXsEL0hVTdgTzGu4Q2y2RgWudLQF7VugR9LeVhkHAHl6SpKhqboHYANM28YCBqAMSIMNxDqJytg8l3DXyUiThl6C9IVvk1k3Fo8wbwnrlQaLCBGvO0+jXRj3EEEQe+gwiB1xcn3cLbDRA9EXe8d0ewR68peA1crqrVbObhkGhS X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d553762-1e4a-4464-418e-08dd5bcbaffd X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2025 09:54:14.8756 (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: lWfyraM9uoZTkDve0GAJ3vuX3VObc8acBAplj/n3kk0+dRGBWxRC0bNkMfxBJ3+YchBBodVFVhZ1ZJsAllyh6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7552 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250305_095420_979742_1E496D92 X-CRM114-Status: GOOD ( 14.38 ) 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: Shengjiu Wang For the irqsteer channel, it can support up to 960 interrupt inputs. All the interrupt inputs are divided into groups of 64 each. Each group of interrupts uses one irqsteer interrupt output connected to the parent interrupt controller like GIC. The CHAN_MAX_OUTPUT_INT is used to define the max interrupt outputs from the irqsteer. For previous i.MX SoCs, the irqsteer instance is designed with max 512 interrupt inputs. If the max interrupt inputs is 512, the max interrupt outputs is 512 / 64 = 8. But for i.MX94 family, the irqsteer is design with max 960 interrupt inputs capability, The CHAN_MAX_OUTPUT_INT is 15. Update the CHAN_MAX_OUTPUT_INT to 15 and do necessary code changes to support the max 960 interrupt inputs case. Signed-off-by: Shengjiu Wang Signed-off-by: Jacky Bai Reviewed-by: Ye Li Reviewed-by: Peng Fan Reviewed-by: Frank Li --- - v2 changes: - Improve the changelog --- drivers/irqchip/irq-imx-irqsteer.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/irqchip/irq-imx-irqsteer.c b/drivers/irqchip/irq-imx-irqsteer.c index b0e9788c0045..afbfcce3b1e3 100644 --- a/drivers/irqchip/irq-imx-irqsteer.c +++ b/drivers/irqchip/irq-imx-irqsteer.c @@ -24,7 +24,7 @@ #define CHAN_MINTDIS(t) (CTRL_STRIDE_OFF(t, 3) + 0x4) #define CHAN_MASTRSTAT(t) (CTRL_STRIDE_OFF(t, 3) + 0x8) -#define CHAN_MAX_OUTPUT_INT 0x8 +#define CHAN_MAX_OUTPUT_INT 0xF struct irqsteer_data { void __iomem *regs; @@ -228,10 +228,8 @@ static int imx_irqsteer_probe(struct platform_device *pdev) for (i = 0; i < data->irq_count; i++) { data->irq[i] = irq_of_parse_and_map(np, i); - if (!data->irq[i]) { - ret = -EINVAL; - goto out; - } + if (!data->irq[i]) + break; irq_set_chained_handler_and_data(data->irq[i], imx_irqsteer_irq_handler, @@ -254,9 +252,13 @@ static void imx_irqsteer_remove(struct platform_device *pdev) struct irqsteer_data *irqsteer_data = platform_get_drvdata(pdev); int i; - for (i = 0; i < irqsteer_data->irq_count; i++) + for (i = 0; i < irqsteer_data->irq_count; i++) { + if (!irqsteer_data->irq[i]) + break; + irq_set_chained_handler_and_data(irqsteer_data->irq[i], NULL, NULL); + } irq_domain_remove(irqsteer_data->domain);