From nobody Sun Oct 5 10:47:20 2025 Received: from TYDPR03CU002.outbound.protection.outlook.com (mail-japaneastazon11013026.outbound.protection.outlook.com [52.101.127.26]) (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 B689525A2DA for ; Tue, 5 Aug 2025 09:30:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.127.26 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754386212; cv=fail; b=gc21TJxmTdrRSUYrHe2ihPBxlh79Yixb0THm/rK9gZ0BO9nXMUUFQOr04b4VogmYqYFCD+Wu0XHArxkNaDI2enmiQSIeSs1x/6hsq4ng7vm6LJOBvo64t/BEzRHJlDr8A8SzisKBBsFP96f86Br8wCDKCH9SnYajs7ODyO5gWjg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754386212; c=relaxed/simple; bh=rtCrdCo9hkr51NCYZk0CA4Q7rDWV5snaWuQuPiAKAhQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=IB8IhBKr9ReNxyMeRubj3c+/M0mSC/rICSNg6Twr/msXHVWTwRq1fP9KrdWm7rFHbzgTf0M64zWfncnkj04yGrGnl+vpo0Ai2OM61SyJPCgwMumErfVb31dF/75GmbDbf/qtye+RJRE089dg6f/R/DqDoUheqzvgWh1ht14J4YY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com; spf=pass smtp.mailfrom=vivo.com; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b=mNm5K03P; arc=fail smtp.client-ip=52.101.127.26 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="mNm5K03P" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SuUzkNiFh7gB1mKAFkJQ1FPkOOqLJF+yCk/NUIf4bzzrDnBDLJXP2M4IfXrjGyykjHsDMBtMEYj/IFnnZKJGxMcxpIxq0KFqM3toAFxZVrw0gXavRccXZxUPohkLuwMF8PfRGDMaOImQSkSBJLAWYF79ocCZI07IpcP48eblKlkpAKtPmSjkQFgUYLFrZHHYkeu3+t4hQsf5wrbKC4v5VjdUQYQjzJkvXnQP/vQoAeegd/V254sowOx+JFhK/XeZJFhSbqlQlVr6gygqbkwiWNa9yOq5w2uMF3EEpo1jaQ6RpqYoM8cOxUB2AgeR3swdDxV4lKKADiuIDfDyWRFM/g== 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=JGhqwtNeSJGv2G1a7aX8CvoNolFBbJZEyBMj2qZXkYM=; b=d+ZNUstgwidRK83lCmafPlM1HbBB5M3uk4FIHyWTy8n7iYX1e8XmhITr1XkOQu92KP9c9S7HeC96d1TBB+Kla/X9kKdUaz09AZ6ScVNe4MWH6Jd3SLh94l9kAI80iUXYMao+gpLimJwct4vnu0jMQ1LYCGwrh6KYt15mH8sI0YuimNy1BCmRimg6J7UQL263EDoGOYvx2sQE1p1ZvaHWWTdOFiPyxTuMRrzaSG039lkZLvrnPW1BzyL/2QXWo0uog11Yhwie3XzecneKubXL3khcbah72nHgkSwieLA2tRWAisJyr7sR6tWcP1sHz91a/i24RuCdqJW2AawHRiLFFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JGhqwtNeSJGv2G1a7aX8CvoNolFBbJZEyBMj2qZXkYM=; b=mNm5K03PY5o1qtnoKxrI5nqmicP92o7r9Lnp4vT0+EVe5zzuduRQgkGpi2e4kXHHFKfAi5/1iz0v6IC2ru1UCHlVRmn1lczcKBNGKkMsGFKc580zo4ZY6OHhNefSPZ2LicZZbxzfb0bmUwyiABQ1mLMyV3ghCuYfhVR7izrTqIMsFIx6YG8Xic0r8gDfs35mNwf96RkCRXfZbSvzKEPKpZBCHaejrtW/P5fNm1mYGX/6qH2KHYb3m+951p4fGnCeR7YWCFDlVgq8+vU+22EsV0wg3euFVqrOThNqpudoT3TuIH5uk14/UOSUQ2VTX9YAfsoR3C+cZImGGZ6Q9rpiig== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEYPR06MB8068.apcprd06.prod.outlook.com (2603:1096:101:2d4::11) by SEZPR06MB5643.apcprd06.prod.outlook.com (2603:1096:101:a7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8989.21; Tue, 5 Aug 2025 09:30:06 +0000 Received: from SEYPR06MB8068.apcprd06.prod.outlook.com ([fe80::e524:973f:e6ef:299b]) by SEYPR06MB8068.apcprd06.prod.outlook.com ([fe80::e524:973f:e6ef:299b%6]) with mapi id 15.20.8989.018; Tue, 5 Aug 2025 09:30:06 +0000 From: Pan Chuang To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, miquel.raynal@bootlin.com, Jonathan.Cameron@Huawei.com, u.kleine-koenig@pengutronix.de, angeg.delregno@collabora.com, krzk@kernel.org, a.fatoum@pengutronix.de, frank.li@vivo.com, christophe.jaillet@wanadoo.fr, Pan Chuang Subject: [PATCH v10 1/1] genirq/devres: Add err handling in devm_request_threaded_irq() and devm_request_any_context_irq() Date: Tue, 5 Aug 2025 17:29:22 +0800 Message-Id: <20250805092922.135500-2-panchuang@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250805092922.135500-1-panchuang@vivo.com> References: <20250805092922.135500-1-panchuang@vivo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: TYCP286CA0325.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3b7::8) To SEYPR06MB8068.apcprd06.prod.outlook.com (2603:1096:101:2d4::11) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR06MB8068:EE_|SEZPR06MB5643:EE_ X-MS-Office365-Filtering-Correlation-Id: 728f6e54-d0d4-46f1-98db-08ddd402aa15 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: =?us-ascii?Q?m1p+o7IlOogRVTkkhTXL8fwPPyi3WmvVjUxLb/GL8+5cApUx74EL4DmgZDrR?= =?us-ascii?Q?Q2gce57OVHxb/DrCK41VDEE4hflWeW0ke2WzjesndWXqUMNHFgpZIB2fH0mA?= =?us-ascii?Q?G9Q3CYBGxt/IUgPKN+UZOZoLo6l9jCQ65uigYq2N2RL+fwPvTWqPO49WdDmN?= =?us-ascii?Q?McabdF8E8t1hRR1NiOd1HWPzM1PNFqMN9gUyM+pQ0NvZvqZtN7zRo481XnYU?= =?us-ascii?Q?E68Mx9nzUZYR221Eo81mFa59I9aBIkwUnnRML8PbZen5Y64HBwXEKD672xN2?= =?us-ascii?Q?YCtAcxArYRub1zahcj35DTMIP4TvqsPJJwxl+XfTEdeg6VuvUIHCzKRtUolw?= =?us-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0wNmU4EbCx6P9+qdWAvyYto4XEQ+TfBpAHrG9h/P?= =?us-ascii?Q?fyOkISncFz9UYYEnXcxrGJYTjIiLnmQiNs7/1GXJ80jQ6B/yWaq2PBfJSmAC?= =?us-ascii?Q?2DjTIryv3Bt6cYEnnjIc49IjUzIezn4ZpMcoyyaDvvqHJpolsvC2uyQV1ZeV?= =?us-ascii?Q?r86FQCEl0pM5CBFsUO1zcpi51NVSQ5VBmMxw6TAM5pxRUE5FrHq5559hg4Uh?= =?us-ascii?Q?ebxfQ73hwWe2CKGsAWNyAPKruE4q0YEgrNCQ+EEZikIDYz8VnYs4qA=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEYPR06MB8068.apcprd06.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: =?us-ascii?Q?G5HRoRNn8wiicgHs8Ej78+6FGY1GBZajtGlcl30ExlLPKOa3qoO7oJCi76yT?= =?us-ascii?Q?72f2LLnlsAyssXcLSolXJb8AsvEXGl/fpqqRY84/KYrFwSubp/OGHQvW8I6D?= =?us-ascii?Q?UMhwycJQrkQoK3g7uvRVg5yZjdrNBb8l4a4aCzoT/cnYq7pa4I9kcX7fV22J?= =?us-ascii?Q?ZYVcPohW0ecHCyvhv7e3nyyb2wFweBlzrOoZNST/qOldqApTr3GZVuWI6t7X?= =?us-ascii?Q?Wz0zuVqqZyFklONikX3TLRQlNYdrx42cuP316B6LVW1iz/dXbqFcJOLfN1ND?= =?us-ascii?Q?tYpt90qsuO91VN13ZF5gSwdfms4Mw8Ns8E0Sukt6l8U528gqZPJ2akn0mB8f?= =?us-ascii?Q?UpX5tilmDuQ34yLOl7fyBBGxT4WTdPCGbtZDvDvEF83VFke/34uEw4v75K5u?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vnv+ttG8wdK89HiMGcV4TSo/hW?= =?us-ascii?Q?/B2XEI8X+NXZ620z6dXomu0hR+ed3iCyIL+yHuG1F42AAbr2JpbkYa7lmntE?= =?us-ascii?Q?p2kNtqef9e3RvuTYUALWSi7BsMe1UIj8INyN4d3GeLGCS5x6NVVJpm4li77A?= =?us-ascii?Q?iMEPctvdyTvX0YMOZGPbcw8vbARUnF7YEj0/v/2LQQA1vZMC1U51kRaHXPPp?= =?us-ascii?Q?XkpDnjErS6m2Dc4KDM4RRtuSbE1SEfQ+n3fSrB2hxHDnoA36gpb9FOWMvMgi?= =?us-ascii?Q?EJbuSnl1vbT3ZXKMTBxwKE/20Ibmwg46W2PRMlR3?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 728f6e54-d0d4-46f1-98db-08ddd402aa15 X-MS-Exchange-CrossTenant-AuthSource: SEYPR06MB8068.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2025 09:30:06.7341 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TtLGoaqNOtUeSPoiokyahV2+vP1+hTR96afPzzzyCFchBu0SyyWWABi3pJr71CUREzgMp9+vQPIwjUfE2BeYnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5643 Content-Type: text/plain; charset="utf-8" The devm_request_threaded_irq() and devm_request_any_context_irq() currently don't print any error when interrupt registration fails. This forces each driver to implement redundant error logging - over 2,000 lines of error messages exist across drivers. Additionally, when upper-layer functions propagate these errors without logging, critical debugging information is l= ost. Add devm_request_result() helper to unify error reporting via dev_err_probe= (), Use it in devm_request_threaded_irq() and devm_request_any_context_irq() printing device name, IRQ number, handler functions, and error code on fail= ure automatically. Co-developed-by: Yangtao Li Signed-off-by: Yangtao Li Signed-off-by: Pan Chuang --- kernel/irq/devres.c | 123 ++++++++++++++++++++++++++++++-------------- 1 file changed, 83 insertions(+), 40 deletions(-) diff --git a/kernel/irq/devres.c b/kernel/irq/devres.c index eb16a58e0322..90290e3b9699 100644 --- a/kernel/irq/devres.c +++ b/kernel/irq/devres.c @@ -30,29 +30,22 @@ static int devm_irq_match(struct device *dev, void *res= , void *data) return this->irq =3D=3D match->irq && this->dev_id =3D=3D match->dev_id; } =20 -/** - * devm_request_threaded_irq - allocate an interrupt line for a managed de= vice - * @dev: device to request interrupt for - * @irq: Interrupt line to allocate - * @handler: Function to be called when the IRQ occurs - * @thread_fn: function to be called in a threaded interrupt context. NULL - * for devices which handle everything in @handler - * @irqflags: Interrupt type flags - * @devname: An ascii name for the claiming device, dev_name(dev) if NULL - * @dev_id: A cookie passed back to the handler function - * - * Except for the extra @dev argument, this function takes the - * same arguments and performs the same function as - * request_threaded_irq(). IRQs requested with this function will be - * automatically freed on driver detach. - * - * If an IRQ allocated with this function needs to be freed - * separately, devm_free_irq() must be used. - */ -int devm_request_threaded_irq(struct device *dev, unsigned int irq, - irq_handler_t handler, irq_handler_t thread_fn, - unsigned long irqflags, const char *devname, - void *dev_id) +static int devm_request_result(struct device *dev, int rc, unsigned int ir= q, + irq_handler_t handler, irq_handler_t thread_fn, + const char *devname) +{ + if (rc >=3D 0) + return rc; + + return dev_err_probe(dev, rc, "request_irq(%u) %ps %ps %s\n", + irq, handler, thread_fn, devname ? : ""); +} + +static int __devm_request_threaded_irq(struct device *dev, unsigned int ir= q, + irq_handler_t handler, + irq_handler_t thread_fn, + unsigned long irqflags, + const char *devname, void *dev_id) { struct irq_devres *dr; int rc; @@ -78,28 +71,46 @@ int devm_request_threaded_irq(struct device *dev, unsig= ned int irq, =20 return 0; } -EXPORT_SYMBOL(devm_request_threaded_irq); =20 /** - * devm_request_any_context_irq - allocate an interrupt line for a managed= device - * @dev: device to request interrupt for - * @irq: Interrupt line to allocate - * @handler: Function to be called when the IRQ occurs - * @irqflags: Interrupt type flags - * @devname: An ascii name for the claiming device, dev_name(dev) if NULL - * @dev_id: A cookie passed back to the handler function + * devm_request_threaded_irq - allocate an interrupt line for a managed de= vice with error logging + * @dev: Device to request interrupt for + * @irq: Interrupt line to allocate + * @handler: Function to be called when the IRQ occurs + * @thread_fn: Function to be called in a threaded interrupt context. NULL + * for devices which handle everything in @handler + * @irqflags: Interrupt type flags + * @devname: An ascii name for the claiming device, dev_name(dev) if NULL + * @dev_id: A cookie passed back to the handler function * - * Except for the extra @dev argument, this function takes the - * same arguments and performs the same function as - * request_any_context_irq(). IRQs requested with this function will be - * automatically freed on driver detach. + * Except for the extra @dev argument, this function takes the same argume= nts + * and performs the same function as request_threaded_irq(). IRQs request= ed + * with this function will be automatically freed on driver detach. + * + * If an IRQ allocated with this function needs to be freed separately, + * devm_free_irq() must be used. * - * If an IRQ allocated with this function needs to be freed - * separately, devm_free_irq() must be used. + * When the request fails, an error message is printed with contextual + * information (device name, interrupt number, handler functions and + * error code). Don't add extra error messages at the call sites. + * + * Return: 0 on success or a negative error number. */ -int devm_request_any_context_irq(struct device *dev, unsigned int irq, - irq_handler_t handler, unsigned long irqflags, - const char *devname, void *dev_id) +int devm_request_threaded_irq(struct device *dev, unsigned int irq, + irq_handler_t handler, irq_handler_t thread_fn, + unsigned long irqflags, const char *devname, + void *dev_id) +{ + int rc =3D __devm_request_threaded_irq(dev, irq, handler, thread_fn, + irqflags, devname, dev_id); + return devm_request_result(dev, rc, irq, handler, thread_fn, devname); +} +EXPORT_SYMBOL(devm_request_threaded_irq); + +static int __devm_request_any_context_irq(struct device *dev, unsigned int= irq, + irq_handler_t handler, + unsigned long irqflags, + const char *devname, void *dev_id) { struct irq_devres *dr; int rc; @@ -124,6 +135,38 @@ int devm_request_any_context_irq(struct device *dev, u= nsigned int irq, =20 return rc; } + +/** + * devm_request_any_context_irq - allocate an interrupt line for a managed= device with error logging + * @dev: Device to request interrupt for + * @irq: Interrupt line to allocate + * @handler: Function to be called when the IRQ occurs + * @irqflags: Interrupt type flags + * @devname: An ascii name for the claiming device, dev_name(dev) if NULL + * @dev_id: A cookie passed back to the handler function + * + * Except for the extra @dev argument, this function takes the same argume= nts + * and performs the same function as request_any_context_irq(). IRQs requ= ested + * with this function will be automatically freed on driver detach. + * + * If an IRQ allocated with this function needs to be freed separately, + * devm_free_irq() must be used. + * + * When the request fails, an error message is printed with contextual + * information (device name, interrupt number, handler functions and + * error code). Don't add extra error messages at the call sites. + * + * Return: IRQC_IS_HARDIRQ or IRQC_IS_NESTED on success, or a negative err= or + * number. + */ +int devm_request_any_context_irq(struct device *dev, unsigned int irq, + irq_handler_t handler, unsigned long irqflags, + const char *devname, void *dev_id) +{ + int rc =3D __devm_request_any_context_irq(dev, irq, handler, irqflags, + devname, dev_id); + return devm_request_result(dev, rc, irq, handler, NULL, devname); +} EXPORT_SYMBOL(devm_request_any_context_irq); =20 /** --=20 2.34.1