From nobody Fri Apr 3 08:27:23 2026 Received: from BYAPR05CU005.outbound.protection.outlook.com (mail-westusazon11010041.outbound.protection.outlook.com [52.101.85.41]) (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 ABA9733D4E8 for ; Wed, 18 Feb 2026 09:37:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.85.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771407466; cv=fail; b=f9bzaBAW2Y4L0xYASIMJxaFTEd7VG1xBJVzspSio+lQ0UhelAeielwmUY8uypP47o4n4Rc2QEfKm5kckQO7kgbk7NdZXCb+y3xXdcWRV8e4NqqO+ukMNehYBQ5JEMiQnearjKVYHIWcnLa9AlZQbUkC7GVBsXHKqLGbXW92l+tE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771407466; c=relaxed/simple; bh=e9crfHDtManBjp+O39v1RktC0mrKI1pEzXfvGiYb+Ys=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sqSkjXHG7fQg7AoAH6cXMztqdOXjNiF2rWfQsOoXpbuIzGFs8EpswV9J6JOBRP/dFnzOsad65sBD9bQ4R+kvgykHjoNLCSVk9y3wRgYs9BxHYjaHhhnJXN7Z3T+jYtpCQC9g46YFgVZ2ejry57ehwCAonHHNeHxyrybDHDTMwzU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=mLDsWUWM; arc=fail smtp.client-ip=52.101.85.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="mLDsWUWM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=C7sjrj2VJEDA20UubMq7qMKWqXDLeen3VQ0/AaypIIRYzePI+tFfCWhUpiv02dBWfY34kEygB11HgT5kYYjKG6qqNtiM3h66FFvRjuHZgo1LXWQ/5v+Nna1PW9idWqay/l1FSvIpC54gr3AlRhORALWB29iZj2YcVsjNjZS7Yq7JLO3HDuxGWZHjBEejZmM/uCLO2qmOt5k5lpvEdN31zJxJnHlPb0OYah+5vXcw6WA3ZnsD9bfgLke9y4/rll3frzUPvreq7MrCfUffA+YJ9N93Z3mKCiY+PMqRdlN+azRTwV86pRVJIW2h1Hap4UtdV19PGACJ+CCcPQkPiCXY0A== 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=lQ6xEBAKAiux5ic2fcwnS/O7xTfpDdvsy3nLDOk+yKY=; b=j9WejZKz28l5CEnSxnQhrF9Z6UAaSXlSZx/mjZ3gwDAEZfL/s9ZItnxIke/BsbSe4fwVQgB0ZdHlyusg1lYas5zOzj5pldU1KwECtILHoqALQ+kDhk1GRth53cU5hkfxsrvjMK6ZVALu+zfrkO3s9nymZDBDFzur/L8b+GLVVOON3KPV3Ce2M0aKSkGmwZssYVA+iOwAGV9KQkTAkVYU62bbNSFI1aTGrHC/cm6m8aYeRBLwPMbSGdMt4XEeCVfzFZH5c45CKYvRSBt/w/Eo93tUU2qNII60sqWfOqolEcjW7hHcpt4z+9rIDitEHpKMQhUMzHjcsOhCy2uxgEHXiA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.21.194) smtp.rcpttodomain=linaro.org smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lQ6xEBAKAiux5ic2fcwnS/O7xTfpDdvsy3nLDOk+yKY=; b=mLDsWUWM6c+kifTCIXnIWE1npQn/xFTQ/fZiQh55jd0bnbUVXeHld9qmUJcc8iLwajwCyYrSeir3B+R/pY45Ul/TKNmoc2/P/NzEWgT/v/qZlGOlvMLTB31Cvsm3kAahzTEIFFt4o+6k39VcokW0SFUZhTA7YdJYDudvfKgW9/Y= Received: from MN2PR15CA0060.namprd15.prod.outlook.com (2603:10b6:208:237::29) by MN2PR10MB4381.namprd10.prod.outlook.com (2603:10b6:208:1d3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9632.14; Wed, 18 Feb 2026 09:37:43 +0000 Received: from BL6PEPF00020E61.namprd04.prod.outlook.com (2603:10b6:208:237:cafe::ce) by MN2PR15CA0060.outlook.office365.com (2603:10b6:208:237::29) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9632.14 via Frontend Transport; Wed, 18 Feb 2026 09:37:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.21.194) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.21.194 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.21.194; helo=flwvzet200.ext.ti.com; pr=C Received: from flwvzet200.ext.ti.com (198.47.21.194) by BL6PEPF00020E61.mail.protection.outlook.com (10.167.249.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9632.12 via Frontend Transport; Wed, 18 Feb 2026 09:37:42 +0000 Received: from DFLE206.ent.ti.com (10.64.6.64) by flwvzet200.ext.ti.com (10.248.192.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Wed, 18 Feb 2026 03:37:41 -0600 Received: from DFLE201.ent.ti.com (10.64.6.59) by DFLE206.ent.ti.com (10.64.6.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Wed, 18 Feb 2026 03:37:39 -0600 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DFLE201.ent.ti.com (10.64.6.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Wed, 18 Feb 2026 03:37:39 -0600 Received: from lelv0854.itg.ti.com (lelv0854.itg.ti.com [10.181.64.140]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 61I9bd8P646156; Wed, 18 Feb 2026 03:37:39 -0600 Received: from localhost (meghana-pc.dhcp.ti.com [10.24.69.13] (may be forged)) by lelv0854.itg.ti.com (8.14.7/8.14.7) with ESMTP id 61I9bb3P015750; Wed, 18 Feb 2026 03:37:38 -0600 From: Meghana Malladi To: , , , , , CC: , , Vignesh Raghavendra , Roger Quadros , , , Suman Anna , Grygorii Strashko Subject: [PATCH v2 1/3] irqchip/irq-pruss-intc: Fix enabling of intc events Date: Wed, 18 Feb 2026 15:07:28 +0530 Message-ID: <20260218093730.3123342-2-m-malladi@ti.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260218093730.3123342-1-m-malladi@ti.com> References: <20260218093730.3123342-1-m-malladi@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E61:EE_|MN2PR10MB4381:EE_ X-MS-Office365-Filtering-Correlation-Id: 86f90daf-a812-470e-018d-08de6ed15d21 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?IHSjqZjzX+b5Gcdm4gdEBeOeTE9pwJehzywGtic1FOZYan7+B01cLOx+rj9j?= =?us-ascii?Q?ycXq9bTY35TPRzLIsSFNXtByvhgG8sRY/WNJD3BBO3Hk0dxtCoM+K2ebhxTB?= =?us-ascii?Q?mjX92I3tBQ74NCEwjrrKKURBBR7RZSxauJcT29KQ7+ugYmNYr62WpQKSWGcu?= =?us-ascii?Q?Oh0ROIf8CSfv4wweFVHg1NyB5b1F/veQbXrghapot//YndyNKrJj1CqT7M9V?= =?us-ascii?Q?/KcNNUiohIOxZWJA9JBjE0Pdeky8ySxIstC3ImRdo1c//mqn6n5BcyT0/JPq?= =?us-ascii?Q?rX7mBInic4LAMUg4dyC5yEcAQhBRrHmx6LxGi+pVarPooiSyY2ANa+aqKoqV?= =?us-ascii?Q?+502SbiJt6Q4K2mIBAb4UVFvWhE1320CWNGk/tM1EkptUdlUAjRdns6yXmg2?= =?us-ascii?Q?71K+gc6z5m5w9AdhKeWHGsufivXQZDhKMmJgRdJvnLZ/0m/QWYQtCAuvLw5Z?= =?us-ascii?Q?vv9yOsT3QA0N+iiwSlEk2uhhTKBYZt2OVjcZ3nt0TLoSW/XtazyyKgldw/Sh?= =?us-ascii?Q?aJZAffaEv/WmaiAynnj2+ecgpcoSFvERsvt+FP95JVPfovsYWDFzGQT7k/zM?= =?us-ascii?Q?Gpc8s1a0JEn6D9qETWoA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ii?Q?w1/49Qv6HYpF3QmR4rg12Xh+h5dgmayFWgXpqhl7NLDjl+9rpxS6EnwFBRB3?= =?us-ascii?Q?oWa3MRFMXOCFwIJS6iULbcKCqhATFO4Kd2MZMjQH9mwegtN+O4GjYOKn6gVi?= =?us-ascii?Q?ey1wnSdT5ccFpic8pZIo19r0VO1DXEAcJie9Y4o3Ljg6POO8UYIeMdC1k4AK?= =?us-ascii?Q?2h8c8w=3D=3D?= X-Forefront-Antispam-Report: CIP:198.47.21.194;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:flwvzet200.ext.ti.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QmeLz/dYN886+dWVDDJUMi2Xiii49HxF1ugj8nZXwPMD7pYlY9EkmM2Mle1qeEho2NV4+GluhEFc5zj43Fi/qa8eyRNl40BOT9ijY9yoVD0ptptUy0F47gQEBEMiixkdoKgDERMyjTkW32mqRORtoeFu9HpR0QGxT+mNkbLhuF7VnwXzI/ms6keGK5HGcJDKiMR1NT5qePI1JD2u4olwMaekDedcsxKcVYOuupqXmIsqBY12GiALGZwWKCf5KflDCXGpau9XZFxDk4oZH4rts8e+KM2e6t0zC17mUSkiRA9iqH2xSHY2tjKweVF84I7uV63qNQGTasQYQMcKSam+lfJ4zK47+QBu7QdnFFSSmPrsbY/RgThjMahkUCP6DH28+fDZLIu9K2QVT1NovwGnL4baZm3oUJ3NfmUYF9BNx68jEiQlU3C1Z+gKDG8fR0pV X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2026 09:37:42.1714 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 86f90daf-a812-470e-018d-08de6ed15d21 X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.21.194];Helo=[flwvzet200.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E61.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4381 Content-Type: text/plain; charset="utf-8" From: Suman Anna PRUSS INTC events are enabled by default once IRQ events are mapped to channel:host pair. This may cause issues with undesirable IRQs triggering even before a PRU IRQ is requested which are silently processed by pruss_intc_irq_handler(). Fix it by masking all events by default except those which are routed to various PRU cores (Host IRQs 0, 1; 10 through 19 on K3 SoCs), and any other reserved IRQs routed to other processors. The unmasking of IRQs is the responsibility of Linux IRQ core when IRQ is actually requested. Fixes: 04e2d1e06978 ("irqchip/irq-pruss-intc: Add a PRUSS irqchip driver fo= r PRUSS interrupts") Signed-off-by: Grygorii Strashko Signed-off-by: Suman Anna Link: https://lore.kernel.org/all/20230919061900.369300-2-danishanwar@ti.co= m/ Signed-off-by: MD Danish Anwar Signed-off-by: Vignesh Raghavendra Signed-off-by: Meghana Malladi --- drivers/irqchip/irq-pruss-intc.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/irqchip/irq-pruss-intc.c b/drivers/irqchip/irq-pruss-i= ntc.c index 81078d56f38d..4ec1f4fc491f 100644 --- a/drivers/irqchip/irq-pruss-intc.c +++ b/drivers/irqchip/irq-pruss-intc.c @@ -101,6 +101,7 @@ struct pruss_intc_match_data { * @soc_config: cached PRUSS INTC IP configuration data * @dev: PRUSS INTC device pointer * @lock: mutex to serialize interrupts mapping + * @irqs_reserved: bit-mask of reserved host interrupts */ struct pruss_intc { struct pruss_intc_map_record event_channel[MAX_PRU_SYS_EVENTS]; @@ -111,6 +112,7 @@ struct pruss_intc { const struct pruss_intc_match_data *soc_config; struct device *dev; struct mutex lock; /* PRUSS INTC lock */ + u8 irqs_reserved; }; =20 /** @@ -178,6 +180,7 @@ static void pruss_intc_update_hmr(struct pruss_intc *in= tc, u8 ch, u8 host) static void pruss_intc_map(struct pruss_intc *intc, unsigned long hwirq) { struct device *dev =3D intc->dev; + bool enable_hwirq =3D false; u8 ch, host, reg_idx; u32 val; =20 @@ -187,6 +190,9 @@ static void pruss_intc_map(struct pruss_intc *intc, uns= igned long hwirq) =20 ch =3D intc->event_channel[hwirq].value; host =3D intc->channel_host[ch].value; + enable_hwirq =3D (host < FIRST_PRU_HOST_INT || + host >=3D FIRST_PRU_HOST_INT + MAX_NUM_HOST_IRQS || + intc->irqs_reserved & BIT(host - FIRST_PRU_HOST_INT)); =20 pruss_intc_update_cmr(intc, hwirq, ch); =20 @@ -194,8 +200,10 @@ static void pruss_intc_map(struct pruss_intc *intc, un= signed long hwirq) val =3D BIT(hwirq % 32); =20 /* clear and enable system event */ - pruss_intc_write_reg(intc, PRU_INTC_ESR(reg_idx), val); pruss_intc_write_reg(intc, PRU_INTC_SECR(reg_idx), val); + /* unmask only events going to various PRU and other cores by default */ + if (enable_hwirq) + pruss_intc_write_reg(intc, PRU_INTC_ESR(reg_idx), val); =20 if (++intc->channel_host[ch].ref_count =3D=3D 1) { pruss_intc_update_hmr(intc, ch, host); @@ -204,7 +212,8 @@ static void pruss_intc_map(struct pruss_intc *intc, uns= igned long hwirq) pruss_intc_write_reg(intc, PRU_INTC_HIEISR, host); } =20 - dev_dbg(dev, "mapped system_event =3D %lu channel =3D %d host =3D %d", + dev_dbg(dev, "mapped%s system_event =3D %lu channel =3D %d host =3D %d", + enable_hwirq ? " and enabled" : "", hwirq, ch, host); =20 mutex_unlock(&intc->lock); @@ -268,11 +277,14 @@ static void pruss_intc_init(struct pruss_intc *intc) =20 /* * configure polarity (SIPR register) to active high and - * type (SITR register) to level interrupt for all system events + * type (SITR register) to level interrupt for all system events, + * and disable and clear all the system events */ for (i =3D 0; i < num_event_type_regs; i++) { pruss_intc_write_reg(intc, PRU_INTC_SIPR(i), 0xffffffff); pruss_intc_write_reg(intc, PRU_INTC_SITR(i), 0); + pruss_intc_write_reg(intc, PRU_INTC_ECR(i), 0xffffffff); + pruss_intc_write_reg(intc, PRU_INTC_SECR(i), 0xffffffff); } =20 /* clear all interrupt channel map registers, 4 events per register */ @@ -521,7 +533,7 @@ static int pruss_intc_probe(struct platform_device *pde= v) struct pruss_intc *intc; struct pruss_host_irq_data *host_data; int i, irq, ret; - u8 max_system_events, irqs_reserved =3D 0; + u8 max_system_events; =20 data =3D of_device_get_match_data(dev); if (!data) @@ -542,7 +554,7 @@ static int pruss_intc_probe(struct platform_device *pde= v) return PTR_ERR(intc->base); =20 ret =3D of_property_read_u8(dev->of_node, "ti,irqs-reserved", - &irqs_reserved); + &intc->irqs_reserved); =20 /* * The irqs-reserved is used only for some SoC's therefore not having @@ -561,7 +573,7 @@ static int pruss_intc_probe(struct platform_device *pde= v) return -ENOMEM; =20 for (i =3D 0; i < MAX_NUM_HOST_IRQS; i++) { - if (irqs_reserved & BIT(i)) + if (intc->irqs_reserved & BIT(i)) continue; =20 irq =3D platform_get_irq_byname(pdev, irq_names[i]); --=20 2.43.0