From nobody Sun May 3 14:24:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1776960723; cv=pass; d=zohomail.com; s=zohoarc; b=APFPY53bwJwcxPNg0rf8BfyupnWikLmbGGWGHjWLHF2vYhqFtVHe+xvrvdZswAxasNcm7f9L9ZyZ18ivTaF4U4H81gMAByS06xEx1FciEiIrK9wEC2Eo7fqZYF4Hecc5k6HhprU99xt6rUrfAey1Nvq9kGuSPSMHQPPyIYDZkxQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1776960723; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8XFlwxcfYZJh/uiCumI4nsPxB8Lb0/HADTO3tOS7JAA=; b=JnABRZtj2l6yJb0IawxpY720cKp61CPFNCTQNXFGvEYiix3yiZdw3i/FxSygL+oCyRLDf58KORrrq+VwXKfnpuqLNuRQq+BqxZTGhG0VIgjPLMglqI3Hn/VCvLilxiyCllV00hEnuz9Ovtrg3uh+Pms0fxD0FRo+EwVooKDwgcI= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1776960723867918.2473555778109; Thu, 23 Apr 2026 09:12:03 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1292400.1570875 (Exim 4.92) (envelope-from ) id 1wFweZ-0000HL-Gp; Thu, 23 Apr 2026 16:11:47 +0000 Received: by outflank-mailman (output) from mailman id 1292400.1570875; Thu, 23 Apr 2026 16:11:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFweZ-0000Fq-A4; Thu, 23 Apr 2026 16:11:47 +0000 Received: by outflank-mailman (input) for mailman id 1292400; Thu, 23 Apr 2026 16:11:46 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFweY-0000D5-Au for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 16:11:46 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wFweX-004X3T-Nq for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 18:11:45 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69ea44be-5cb7-0a2a0a5109dd-0a2a450bafd8-12 for ; Thu, 23 Apr 2026 18:11:45 +0200 Received: from [40.107.159.119] (helo=OSPPR02CU001.outbound.protection.outlook.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 69ea44bf-212f-0a2a450b0019-286b9f772e5a-4 for ; Thu, 23 Apr 2026 18:11:45 +0200 Received: from DU5PR03MB10263.eurprd03.prod.outlook.com (2603:10a6:10:519::5) by PA4PR03MB6752.eurprd03.prod.outlook.com (2603:10a6:102:ea::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9846.21; Thu, 23 Apr 2026 16:11:41 +0000 Received: from DU5PR03MB10263.eurprd03.prod.outlook.com ([fe80::8c9e:b301:61c0:3908]) by DU5PR03MB10263.eurprd03.prod.outlook.com ([fe80::8c9e:b301:61c0:3908%5]) with mapi id 15.20.9846.021; Thu, 23 Apr 2026 16:11:41 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ySiJqrFt3mUe8QGpemROgPJqzREyMdhx2hzmuUbPWi4DrrV1mKOdREChiDvejVo4c1ZTLEBb0+ZZS/vDHgsNahYp8OGSa9yDyu1J9aSn+ru9+q7KK34qbTPenXTovIljm5NeYks0j5eHGVmzHpQWkvYhRVz8/Th2rBtu9dXHZ9VLEMZkVrTiTwtfOedCaOa+L2KBqeqh6t6URyuI/kCkWn25nU1NyOkYCWaKpTv0kuU8mjUsNovsPzIz4W8I+jslXdqYwT4rg7LuOS1WDA8dbgbF7PI19WC7nCbyvDQmSqc3L2JZ6drt4t4MBniIKrnM7cwh7sOrNXyneZfUn0GWgA== 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=8XFlwxcfYZJh/uiCumI4nsPxB8Lb0/HADTO3tOS7JAA=; b=ew9X2biMpn/9tI6QcFwVhShF9GNedAA1ojjhrVVEbp7LwquSb0udP+s9rKJS/ocLoXGcnlvIPLa7vjeOTQsRJ6WfWqZyBx9c8Oh2pxNsjm9HVtAdxwbpM0skyvyYX2SDeD5ijE4cCR9MGlDLGSWpSpYZEVSoCfCcVBqaTKErTnbsOKP2QRZJf5zhwAqBB5CZ/DEWELxbyF0QiE7xWZtn4k/5DZcguu0kKBlJGdf3g1jGThlczdQEWLhmQc8oOPBdryBm51J9CnSWL/kCWVBxcoNiSfq9x8aR41kD9C++/lpx/6KnQNMn+AtqwQpYeF6HmRktwKLnkm0S16tk10sdWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8XFlwxcfYZJh/uiCumI4nsPxB8Lb0/HADTO3tOS7JAA=; b=jkT2csH9lUH45wCurczWDd/HfdnPel5e8WBfF+iu5Ofu8P1upV1AWP7Bjhsyp2G0MaRZfGl+0Hx4Sawpx3S+/3Y1k8O4MyBGhZhk3Ph+PAkVhy5ax9XfaG9jRVwdHmLyQa9sPGLaHE6Mfi3qSVZJO1W8nJtKVu+XH7Z/jlZnTOc2k35hTO8wfVfB6Bm5mWB/unawvy6hXnCALFQo9nYMrtb1wyXd5N+QqOc8EahLfPTLf02WhW8s7fRJdCEQc/0ZjzimTmzL7EokTkMpE4Ybb2WmAbPpUE9roJpcs1XVvMrfvA/VWK5MIh366OQh+1CUmP+PE/uofKEcNmN0Zj4xxQ== From: Oleksii Moisieiev To: "xen-devel@lists.xenproject.org" CC: Bertrand Marquis , Julien Grall , Michal Orzel , Stefano Stabellini , Volodymyr Babchuk , Oleksii Moisieiev Subject: [PATCH v4 1/4] xen/drivers/char: fix SCIF IRQ registration failure propagation Thread-Topic: [PATCH v4 1/4] xen/drivers/char: fix SCIF IRQ registration failure propagation Thread-Index: AQHc0zvf/bLY5rMgLEeCO+A68ZSaAw== Date: Thu, 23 Apr 2026 16:11:41 +0000 Message-ID: <0d39b0fc5ea8351e660b716cd55da2e677538b09.1776960679.git.oleksii_moisieiev@epam.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DU5PR03MB10263:EE_|PA4PR03MB6752:EE_ x-ms-office365-filtering-correlation-id: 41ec653e-e4d1-4ea1-7d66-08dea153019e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|366016|376014|18002099003|38070700021|56012099003|22082099003; x-microsoft-antispam-message-info: NJFWg7eMr9kO4n3/I9Hl1hHOwHN+cbyFhTRcUa8NuFKh7ZxpfjEWMerJXlBnvFDc5iY1aoo0A2p+aRKgSbYkAbkCwT6FNOEubtg2lJi51YSQhJd0x5zOXBNJ5qM6c/BKiHJGFg5uoIaXNCgwqu6ohceGR1AaMNtp6gp45+VRhLH+06Et2qP8V/dpYVtKT+gk9GM3sX9yZFz5UkOXX5OK2BarLmWhhYXhBI9tYRepBT9Q4tm6jvzFdPes2fBs3PXukDPa6JPJYFA1G3bjTfhG1Tj5b0SBLxHmykjuOnBpUMv1Wgaqu5i8q+GRUYKaJHDUsib3CUyk4Wl26wTtaDwzM/QpCBAPr8dscUBs8EmUPcTusiqIOhcFlbdnwHQv/Xky/6OnLuFKBF6t31D7YsXHK/RtGSiVIr7fo8iRFojthqs6YoOUyC/fb0lBX4K6Ntba8wf8xK008ELoq6THGJlGWfpQ7k2UNJ0JYfyP70f0s5qqU16CYPNUnnXhzriQYf8u5ETqFPTOATwMOpoGd8yRZELCvMgQwvDSeHWyK2LAG8Xvz+R+rAUWGzDNaTJTBCTAY31p+Y3d3BXDebj6dBnwyTDFi5ca4Ow8570157EqD2etCK1UT0t1/fuSruhpeWA4cA5Yh3folHuOamYaCMl/MvlavsU5SejYUXGxW+CaiKtF4G2M+VHAhrZL9KAVDTBQg214odpV8XveN5qoKh35B+G0roCy4WY+BEh7StwENuAUF0WK3O8Cu3j0WIMJzuTIXR+/rtSb5av8HkAnpwCnrb/9rI3O7kvPdUr1YR2kZsY= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU5PR03MB10263.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(18002099003)(38070700021)(56012099003)(22082099003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?m5RQ1ygqWDEIlkf9mnU4dMl1wI60e0Cpcz20aE8tBZcVXQTCIIlRyQzR6t?= =?iso-8859-1?Q?Q7kJsJNmSb5OaA6VwJFIdsv0wFNFvG0jjzrTA4GZY6LAFg79/eyA7a3sC5?= =?iso-8859-1?Q?BoSJNEKhUuoxw0ALrGvij/03VL5J/leyHu71Y6wSe2tZcemPV3LZDhtMP6?= =?iso-8859-1?Q?53VefnRV3CZm/fhL938jokjWqRUlhVdcL5pI1a+t/PpoPTrir1Nb6zA0+n?= =?iso-8859-1?Q?FjoYrYPnCY7My1YKacAwh69VyZ2nOuzwLBbFHd4tzm1yrNc8rhvrHs8b8S?= =?iso-8859-1?Q?j0OHedVsA1YtDO7hqpjCsOBr4QB7RGrmaj0+XhqE2rHOUsszDmBzn4/rDj?= =?iso-8859-1?Q?hXIJyRUgw5kJzDmS+YT6Ughh36ZzsZXdegKc0uYnEJ5FZ38wAMMqlsGo2i?= =?iso-8859-1?Q?uU7gNbtdJx23H5HGKOlwdo4RhUKOR2//BATSTk4ArVGjSvkCRf4a4zEyiJ?= =?iso-8859-1?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/iDfyLgPgZA+wsGt?= =?iso-8859-1?Q?8c+MCixJnTDeBpJkJyd4hpw05dinUpSid/mYeDYV31KbA5wqq0vdDPRT9+?= =?iso-8859-1?Q?xL+SiR4zkQNxfdF1Lkg9hcGaViU63Lei95HCIjhrwhkzSh/GcDQxfSnv9v?= =?iso-8859-1?Q?eWZaQ11MsawxbcBCvXIV3LK1+gNdO4LQxVGP5VpMMHSpH5YH9NxynIAzxY?= =?iso-8859-1?Q?4PR01mIXpodqSGNuxFIgyzEGBrlOtox+EhAynC12Zl5RiYWfevQ2EGCsXG?= =?iso-8859-1?Q?oF/8Ub/DiTYc+Lr5qqfjw+fpA8a3iltenKtkHI+JvWkC7DHrNZistD8hpX?= =?iso-8859-1?Q?XKSL8JAgctv4jRjGNig9KnFkQhhIxgh+1HCSv9QRjAudM3jC+zjzFYNQSc?= =?iso-8859-1?Q?Bvv6IwrlfcaJOvaia1poWJJwfqjmhTqTR4VRoCdZIv7bWegsaOr4tgs+4i?= =?iso-8859-1?Q?TQAvw4BJ8Q2b2t0m3fpDpykkKYenVIs=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DU5PR03MB10263.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 41ec653e-e4d1-4ea1-7d66-08dea153019e X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2026 16:11:41.4272 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0J8Rc+1ri7W8MxDXAN/dMcHe5M3c6aZ8/XWRDXG5jdMvF66n3rxMPVxTXeTQb7KjH7KIz447Eae9eFqL4bNUomnBGHU3CvvSXndtlqLFVO8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB6752 X-purgate-ID: tlsNG-42698a/1776960705-7D364F3B-5D38FF89/0/0 X-purgate-type: clean X-purgate-size: 3024 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1776960726117158500 Content-Type: text/plain; charset="utf-8" In scif_uart_init_postirq(), when setup_irq() returns an error the failure was only logged via dprintk() and execution continued, unconditionally writing TIE|RIE|REIE into the Serial Control Register (SCSCR). This armed all three hardware interrupt lines (TX FIFO empty, RX data ready, receive error) with no handler registered to service them. On platforms where the GIC receives these asserted lines, the result is either repeated spurious-interrupt warnings or an unhandled interrupt fault. The fix adds an early return inside the error branch. The interrupt-enable write to SCSCR is skipped entirely when no handler is registered. SCIF TX continues to operate correctly after this change. The Xen serial framework never calls serial_async_transmit() for SCIF, so port->txbuf is always NULL. This causes __serial_putc() to take the synchronous finite-capacity path, which polls the SCFSR_TDFE hardware flag directly and does not depend on the interrupt mechanism. RX wouldn't work if irq wasn't registered. As a secondary clean-up, the hardware error-flag clearing sequence is moved to before the setup_irq() call so that error bits accumulated since init_preirq() are cleared unconditionally, regardless of whether IRQ registration succeeds. Signed-off-by: Oleksii Moisieiev Reviewed-by: Michal Orzel --- Changes in v4: - update comment for setup_irq - add R-b - change %d to %u in printk since irq is unsigned Changes in v2: - Extend fix to pl011, cadence-uart and exynos4210 - fix typo in patch 1 description xen/drivers/char/scif-uart.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xen/drivers/char/scif-uart.c b/xen/drivers/char/scif-uart.c index 888821a3b8..350d5f14b9 100644 --- a/xen/drivers/char/scif-uart.c +++ b/xen/drivers/char/scif-uart.c @@ -187,16 +187,20 @@ static void __init scif_uart_init_postirq(struct seri= al_port *port) uart->irqaction.name =3D "scif_uart"; uart->irqaction.dev_id =3D port; =20 - if ( (rc =3D setup_irq(uart->irq, 0, &uart->irqaction)) !=3D 0 ) - dprintk(XENLOG_ERR, "Failed to allocated scif_uart IRQ %d\n", - uart->irq); - /* Clear all errors */ if ( scif_readw(uart, params->status_reg) & params->error_mask ) scif_writew(uart, params->status_reg, ~params->error_mask); if ( scif_readw(uart, params->overrun_reg) & params->overrun_mask ) scif_writew(uart, params->overrun_reg, ~params->overrun_mask); =20 + if ( (rc =3D setup_irq(uart->irq, 0, &uart->irqaction)) !=3D 0 ) + { + dprintk(XENLOG_ERR, "Failed to allocated scif_uart IRQ %u\n", + uart->irq); + /* Do not unmask interrupts if irq handler wasn't set */ + return; + } + /* Enable TX/RX and Error Interrupts */ scif_writew(uart, SCIF_SCSCR, scif_readw(uart, SCIF_SCSCR) | params->irq_flags); --=20 2.43.0 From nobody Sun May 3 14:24:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1776960727; cv=pass; d=zohomail.com; s=zohoarc; b=AiSQf5Bpgx2tEb00iLlfFY+FlaC6XZExO/AkGPgURL5gdCLTPdk6RgHosAZv+sVjE96dPnwYXHA5d7JjRQONWtm9xF1KEmoDogt5771Dxcz4q8bvClpviLLxTuAQYdIu2YuYIx/ZocnKUWXYwZi5mpLANCSNSd0ZbD5wWMc98Zk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1776960727; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hwLaTMy1vY8qP6h9+hcCU5LH4m+dOUrZTarK3BrxX1w=; b=Vaqn+AtkmeTLdCepmjWJvx7LhHM/rRS3jF5wL3mWy/ad6dDvDZxiQEB5D9OkAVnUQ3N1A4Gp3bL29pqW3/x8U1DXwuRC97zTuxxh34KzWGr2F8rspkVqW7vk+9YBKtQFnaOqLkkIcsuzSliJNGOZ0IruDiWs/SGD/ePauJhHDJw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1776960727674610.2904360663449; Thu, 23 Apr 2026 09:12:07 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1292401.1570888 (Exim 4.92) (envelope-from ) id 1wFwea-0000hA-PS; Thu, 23 Apr 2026 16:11:48 +0000 Received: by outflank-mailman (output) from mailman id 1292401.1570888; Thu, 23 Apr 2026 16:11:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFwea-0000gS-Lg; Thu, 23 Apr 2026 16:11:48 +0000 Received: by outflank-mailman (input) for mailman id 1292401; Thu, 23 Apr 2026 16:11:46 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFweY-0000D9-KD for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 16:11:46 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wFweY-004X3T-11 for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 18:11:46 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69ea44be-5cb7-0a2a0a5109dd-0a2a450bafd8-14 for ; Thu, 23 Apr 2026 18:11:46 +0200 Received: from [40.107.159.119] (helo=OSPPR02CU001.outbound.protection.outlook.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 69ea44bf-212f-0a2a450b0019-286b9f772e5a-5 for ; Thu, 23 Apr 2026 18:11:45 +0200 Received: from DU5PR03MB10263.eurprd03.prod.outlook.com (2603:10a6:10:519::5) by PA4PR03MB6752.eurprd03.prod.outlook.com (2603:10a6:102:ea::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9846.21; Thu, 23 Apr 2026 16:11:42 +0000 Received: from DU5PR03MB10263.eurprd03.prod.outlook.com ([fe80::8c9e:b301:61c0:3908]) by DU5PR03MB10263.eurprd03.prod.outlook.com ([fe80::8c9e:b301:61c0:3908%5]) with mapi id 15.20.9846.021; Thu, 23 Apr 2026 16:11:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=G2H4HdNfquR99Q4SsTiDtuUd725CnHJ1llXPeZCujd68wb0SvIijOD5Pjphsp5HuPQbjPpB/rI7a3yYDI69IAJmEOclGOuyhh18vz0jE0JZqPePFeef0OpCIyCwNFGVTwB6CGHa+mQw9FgrdMev4REAUYhyTbrzf6Gr/Rl6ORD51iIdvNx7IX0ritqkJlRDudiNsNWurjzdcwdVetEGsrvf7pkQBHvNHRVutcO0a6IIk4blu6Ks1VdknHm2IEYDmACya6rbl+GTimmJSqZxUHHGnjuqn5s0Y8oZ+4otWEC9X0koNBUMblrMZ3RBZ+Vkreyh3VGoRJDdMgaeVRLpL2Q== 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=hwLaTMy1vY8qP6h9+hcCU5LH4m+dOUrZTarK3BrxX1w=; b=LFXCSpFePUD/ohX6jZZQ8SRt6YF6nece0+GBpghLi3QFnOVTXYPaGWWihxtwg5fmF/j6IJFz1e0N19izTMKFTXUNBcwSRoT54CduZ5RBbrPmGmO7AsQvklt2oWJojb68Y7ygq01GOiqdOxzt7Q/HMd+YZ77tiMd9nYMg5+bTPOEC/tZBY4r9ht7lEEB0CoybhkhNJulNX5VdcckRoGRVliRjCmCN5IgtLZtWzgHpLSDxNfYF1KKz2Uq9YTXiDAEsTyg6dTAIlAzAcmAnEmm6tXokA4aCgnKoJEeHpCXp2KBwGzGpL53fgTLSPhT36bAl2IP4O0TEZUF56DuIjn+ImA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hwLaTMy1vY8qP6h9+hcCU5LH4m+dOUrZTarK3BrxX1w=; b=M2hiLI07lsdQ6DeREGtirNKT4/3FwVaOSCFgtesrJCrAqbImotKbNvnEffZetXhYM05TnHYILBXWPkPnTrbxmaPL1FaECaOs/+bg5YCHXvv+/kXMtUh7fC75uQ1tY/DUmw69f0MwI2OyAMmVgdSNaFfcjkBW3J+FIkZtM8enKiTuz1GIAO3MUM2EWTpKepPRy3qixItiEwGD0UujljqiwcIKBB/33uda1rHDrTGPiDf1CHZZRhrZTfxh/SiBOC1wr29mOFmj7YVZy2c3vZAhHdRCoyXF4jzfcUerLHiLXkc1CDdL6cWVXuJIrH5IpYDk/81Jx7tFp02P41+1ESqTKA== From: Oleksii Moisieiev To: "xen-devel@lists.xenproject.org" CC: Bertrand Marquis , Julien Grall , Michal Orzel , Stefano Stabellini , Volodymyr Babchuk , Oleksii Moisieiev Subject: [PATCH v4 2/4] xen/drivers/char/pl011: fix IRQ registration failure propagation Thread-Topic: [PATCH v4 2/4] xen/drivers/char/pl011: fix IRQ registration failure propagation Thread-Index: AQHc0zvfp867h1iE6UiP0oRgFR3PCw== Date: Thu, 23 Apr 2026 16:11:41 +0000 Message-ID: <7a3d7e4b73ca1c144ce7687b8494f2a0eb862383.1776960679.git.oleksii_moisieiev@epam.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DU5PR03MB10263:EE_|PA4PR03MB6752:EE_ x-ms-office365-filtering-correlation-id: 11a4c04b-3f44-4545-e675-08dea15301f1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|366016|376014|18002099003|38070700021|56012099003|22082099003; x-microsoft-antispam-message-info: 3AMt3qtGqnJsT4Zepe+VBbSAIKYQyfJorTiAkOfCeyEMD/xavRgWF5i3gRipIxHMq/axl6Js7xQrL7jQhGSCdLqen6hJNjYUUw9Kly+LSj8BZ8voOF6SChnay1kmtpSx/pbV4H3mC/fbC+2l8Th9BZJMQRaQ13mnxm7gONX6VTU6BGNEUgr93YT69oWQUlJIylxJDuH4cEC6yYX8MMmh0dGNYKyLEDImOmDVjVY1ZOgpAshcPsozE8sHPy9dE0V4q4jA5OWR0CW0SAOtBvx0CAcHgRm7LyyK6PVwfYuH/KdH/ANTTKfPvwVmoSlkaFnL0wq4dIH7EiiQPC5ZmoT1+TvBpePNnxP1m3S2XPJJOORV15s3lWEhQPIaxwS599rXkT/ZVhm8Stum60RcevABsPAum/8U/+p4ipgM1v6WUbHjh7raoNolIVojyE+ZZ1zV4UxVlpdxWguHmlXJwrnZDbdCOk9IPa0ojnSfuhw+kOJEMZqyLSSXka8a8TdNcjysmUPUKjrNIbnGeF/gD7EVBlWUsPsPLRgYmb3K8KuLgxcjGMs8ge9meQu24YSm73bm/Gjf0PrJlsDM+xq91PlGFN92uOdEIdzs4azDk/yNRTX64YVUnj/gXkr7VmSbiOl/OSoPcOzZ4GfRpsOEH6gBX3o5EOKfx0o7ddTZfy9DNWQAD7xEBZfioZU8GnjO1ZcnrDM+azxejSx9bC1vSJ0PNu1zZL9ddyXvSERyKFpgenU6DjS9RsohU3SvBXc9xsGGtiGfujC0BoPj6JcXCCQuRUiryvQghqm+tusgmdEFmZc= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU5PR03MB10263.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(18002099003)(38070700021)(56012099003)(22082099003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?ddY3dRJUE/dYBmHlsOmZ0JDfSmMAitK4EEpH/qEeyPm02B//bJIzWd6G/g?= =?iso-8859-1?Q?3uu0d7ODr7wUeGO8KgJj9wu1eNDs631rxEgkyio360B9PdIoBnBnVANylx?= =?iso-8859-1?Q?MsTx2GwCM/RsYlZRNWUhDebZ9lSZewii6PVaT5xw5IHKKAthHHPRrcApxN?= =?iso-8859-1?Q?sHrLv19JKc6zalmcfewqstQARFRHt7ALpl6zBkjSIbZp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bTVpdS+hZXX64S7fj3s8+lWQBdKQq5RST/oIya9?= =?iso-8859-1?Q?YTH7VAZR0j/JQ/12sGn6gjPjF1ivZqMBSaAe6s+1G2Bs6KFmwNECLs9qKk?= =?iso-8859-1?Q?ICWLO/vzJEu1+5FEo8kQHzJjP6bnooYgExLC43U5m9Fysz3G25UazA8XHr?= =?iso-8859-1?Q?SUqg5gj+pOfo6UXCqnzFjIXFWQOqIkR5+xRtS1jv7EpU8eONSHtD/5e5si?= =?iso-8859-1?Q?PndvrBgJMNudDqac3K9ZQLevXD9nZ4zmT9ZCzLW6d4MEwbOdMAQy0rQvaC?= =?iso-8859-1?Q?bm8n4qlv5/XJaKHg0vn5QX2orVtJk6msdbUenu2Fza2qXlJdUtm4RLn0vx?= =?iso-8859-1?Q?A56D+XqUJIuyZOMJHEiVpdgFMulMP2Wk92fI8Q6zbUPkbDr/Jo34x116cP?= =?iso-8859-1?Q?ACqf5oPVYXQ9ArV1mMinojvuax1o+vF0RlrS5p+bND49hjA5wiUfWCN3kw?= =?iso-8859-1?Q?YYvmNOZuZwtNUfzvUOSSXflLZHsI6+ppe4yacuqjDRAUVWzCA08SLGHvgn?= =?iso-8859-1?Q?QvWUncP82peKM/J4HvnBRAjZD6vmSoUhFOG8KXMYvoUp/MMXqyKU5lniH0?= =?iso-8859-1?Q?DlPq6n0FNIM+gQmoXYWP8WxJTuFmkJuEGDrUb6DKAyBFe3l5NVIrICEvsm?= =?iso-8859-1?Q?j+sX2u6BjUEF0UNaEIUBOakdf4bI4zA3WmLrO3MWQ63FPB0XK0dvrD7TMS?= =?iso-8859-1?Q?lbVOTQ9vrh6ccT9BMDXiHMlxrSfeF3k=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DU5PR03MB10263.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11a4c04b-3f44-4545-e675-08dea15301f1 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2026 16:11:41.9102 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nCHoJKpAKYqVftbJFQxwpMTkEuXvJhev6mUPG/T3PGTR2AWmuw0EJ/RnR/0+Q2MRR1rA+KBe09hvEGluLcpIo9fCWb+AkVx6B9DKOpc3hMQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB6752 X-purgate-ID: tlsNG-42698a/1776960705-05165F3B-ED63BCAD/0/0 X-purgate-type: clean X-purgate-size: 2815 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1776960728065158500 Content-Type: text/plain; charset="utf-8" In pl011_init_postirq(), two code paths could reach the interrupt-unmask write to IMSC without a handler being registered: - When no valid IRQ number was provided (uart->irq <=3D 0), the original positive-condition guard (if uart->irq > 0) skipped the irqaction setup but still fell through to the IMSC write, unmasking RTI|OEI|BEI|PEI|FEI|TXI|RXI with no handler installed. - When setup_irq() returned an error, only an error message was printed and execution continued to the IMSC write, arming all hardware interrupt lines with no handler to service them. On platforms where the GIC receives these asserted lines, the result is either repeated spurious-interrupt warnings or an unhandled interrupt fault. Restructure pl011_init_postirq() to use early returns: return immediately when no valid IRQ is provided, and return after logging the error when setup_irq() fails. The interrupt-enable write to IMSC is only reached when IRQ registration succeeds. Signed-off-by: Oleksii Moisieiev Reviewed-by: Michal Orzel --- Changes in v4: - fix uart->irq <=3D 0 to uart->irq =3D=3D 0 since it's unsigned - update %d to %u in printk since irq is unsigned - add r-b Changes in v3: - clear pending error interrupts before setup_irq for pl011 xen/drivers/char/pl011.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c index 5f9913367d..a336241033 100644 --- a/xen/drivers/char/pl011.c +++ b/xen/drivers/char/pl011.c @@ -150,18 +150,24 @@ static void __init pl011_init_postirq(struct serial_p= ort *port) struct pl011 *uart =3D port->uart; int rc; =20 - if ( uart->irq > 0 ) - { - uart->irqaction.handler =3D pl011_interrupt; - uart->irqaction.name =3D "pl011"; - uart->irqaction.dev_id =3D port; - if ( (rc =3D setup_irq(uart->irq, 0, &uart->irqaction)) !=3D 0 ) - printk("ERROR: Failed to allocate pl011 IRQ %d\n", uart->irq); - } + /* Don't unmask interrupts if no valid irq was provided */ + if ( uart->irq =3D=3D 0 ) + return; + + uart->irqaction.handler =3D pl011_interrupt; + uart->irqaction.name =3D "pl011"; + uart->irqaction.dev_id =3D port; =20 /* Clear pending error interrupts */ pl011_write(uart, ICR, OEI|BEI|PEI|FEI); =20 + if ( (rc =3D setup_irq(uart->irq, 0, &uart->irqaction)) !=3D 0 ) + { + printk("ERROR: Failed to allocate pl011 IRQ %u\n", uart->irq); + /* Do not unmask interrupts if irq handler wasn't set */ + return; + } + /* Unmask interrupts */ pl011_write(uart, IMSC, RTI|OEI|BEI|PEI|FEI|TXI|RXI); } --=20 2.43.0 From nobody Sun May 3 14:24:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1776960733; cv=pass; d=zohomail.com; s=zohoarc; b=LxGVayudF1GOU71u5bfX05E+Hh1DDO0eCxulVtdWLHNr3+B83K2VcJ6DR04cI3u9Z9HcW3nnSmIGAlyfhIrtN6jj4aBYse99ORLz17CVfZH3jhahoZojk8xLyHCY2iaTrURu5ZDJROAh6EGejiqQIgOznMGmi9bjmbs3/V8lYtA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1776960733; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mvr5mzI9zMbvHinWk6X4HXPCOg0zLvukpXSOGKW0FUg=; b=PFV6bYkSjUTXM6wlzKheQOyCsoepxML84m72olIzohK/MQlK77rYyx6bRUbX0GULMOtWL+jqp0bcsf72n+oNDF7WPBSk/ZnYghMHv/7KtTaTQOaY1T+vcAIM17UyZPY8hBUJ4qeQwcTRa9XDSfjYvboXhPusd+t+OUsyxMupOlE= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1776960733028740.493883239157; Thu, 23 Apr 2026 09:12:13 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1292413.1570906 (Exim 4.92) (envelope-from ) id 1wFwem-0001Vj-Cz; Thu, 23 Apr 2026 16:12:00 +0000 Received: by outflank-mailman (output) from mailman id 1292413.1570906; Thu, 23 Apr 2026 16:12:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFwem-0001VW-7u; Thu, 23 Apr 2026 16:12:00 +0000 Received: by outflank-mailman (input) for mailman id 1292413; Thu, 23 Apr 2026 16:11:59 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFwel-0001Sy-2A for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 16:11:59 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wFwek-004X8B-Et for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 18:11:58 +0200 Received: from [10.42.69.3] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69ea44cd-5cb7-0a2a0a5109dd-0a2a4503b4ba-2 for ; Thu, 23 Apr 2026 18:11:58 +0200 Received: from [52.101.65.82] (helo=DU2PR03CU002.outbound.protection.outlook.com) by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 69ea44ce-672d-0a2a45030019-346541523953-3 for ; Thu, 23 Apr 2026 18:11:58 +0200 Received: from DU5PR03MB10263.eurprd03.prod.outlook.com (2603:10a6:10:519::5) by PA4PR03MB6752.eurprd03.prod.outlook.com (2603:10a6:102:ea::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9846.21; Thu, 23 Apr 2026 16:11:42 +0000 Received: from DU5PR03MB10263.eurprd03.prod.outlook.com ([fe80::8c9e:b301:61c0:3908]) by DU5PR03MB10263.eurprd03.prod.outlook.com ([fe80::8c9e:b301:61c0:3908%5]) with mapi id 15.20.9846.021; Thu, 23 Apr 2026 16:11:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WaMhlaGHLVRqRK1rmuiHLsU9FNN1BH3/EuraybNZrfFcbaJpltYvLQTBLiDagZxwZIxVmondjR1FVlPozOI51QTByf/GKmH3kGqvpss+xlyiZZCEBLwe0e+agJACjL+ucoxZgJUrQSahuBz8hrGE3tgISYWhOO0sIyv+eHjtIxQHIcECdj08WMxivIph/pJj7mt6tAySViP6x5BEAxHG7A39P98iFZvSUHx3QsHkqfII3TdfEmOciuTUJfUw1FjTvkMMYJBvaM+iHszULuIerYoxjKozg+NeZYXdYVYJHWnCpsi/7XUlci4U/dlplHGcfmwOomAY6Ui+WpA6TN/FEA== 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=mvr5mzI9zMbvHinWk6X4HXPCOg0zLvukpXSOGKW0FUg=; b=Cc3gTOxEaYjW9SdUCK5XJp5HlhokNH3rY5hLUHI3btX9UBu7VUV2hkQ7H/Gk3vhITz0o0rVbDVHYmEYZVTnSTz+lbj2DagJlRza2+pZVHIBxjTz6Tgr8rwbh3GyKDTKSs64Bq6eM32EBTiqCXn3w7338m4XzY1EUzwzUqpk9KzNFq7Edyl/zudEkM1Zk/qoImhHILtG/jDddTuT/rPnwAB84TOZJwnPuXMrDWqu6I07P8PpgkT89uIFIAISfGZx6YjkEw6tgk4YkZaRvmWk7TGWNinHKH9M3DnpPq4X3zEh+aNbROFX/0kQHnw6xjSTNhuaQM6m3ZNghPzn4Dw6HvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mvr5mzI9zMbvHinWk6X4HXPCOg0zLvukpXSOGKW0FUg=; b=frBAt8e3Y9CReptWl6YW0626v9tI5naQkpsSZmVdhKssjCkJffsiT5r15zBxUM4XeSzJ+jjuJv5UDrN6qAOQwXc51XJ9nmwaH/AWO10lfQenrJZfgBZfjUQElW/TOmOy+d56Yjf0zCc0H9UeigKJhJiDKNsFSXplPYR3/McNS0iXQSe3Nc5F7woC3jTK0cmyJg0yJ0a375povNVljP5zTY39zMk+cqkbfcUlMPUBSSHz9CpUtZA2cGXUS9DzZ0AR+/RYgCu5FQfgtLH8tO/DM02OIgeBNY6hzq+6lG66tYR/dKDXF5Pqpoyi4XZx8b4tvPLy+RirQYv7VjlcVMSLXA== From: Oleksii Moisieiev To: "xen-devel@lists.xenproject.org" CC: Bertrand Marquis , Julien Grall , Michal Orzel , Stefano Stabellini , Volodymyr Babchuk , Oleksii Moisieiev , Oleksandr Tyshchenko Subject: [PATCH v4 3/4] xen/drivers/char/cadence-uart: fix IRQ registration failure propagation Thread-Topic: [PATCH v4 3/4] xen/drivers/char/cadence-uart: fix IRQ registration failure propagation Thread-Index: AQHc0zvfVnWwKQ/dg0SioeeuT3c8CA== Date: Thu, 23 Apr 2026 16:11:42 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DU5PR03MB10263:EE_|PA4PR03MB6752:EE_ x-ms-office365-filtering-correlation-id: 301c4b89-c713-4158-644d-08dea153021b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|366016|376014|18002099003|38070700021|56012099003|22082099003; x-microsoft-antispam-message-info: LQgckP5heoKs5Qw65LsHv1hFeOuexpPHetEvmGDCO2I4FefVSw7J9Z6186lXtToldrf5OPTqNYAugtoRGwXDq/ibFHvn28AcmDX3ozol0QwJdV0olwRBfOK6iaDAJ4blJD+/mky6QkqXPGxVpP2N8uL4Ugsqd2JqS6uyIeD1SLBsScfVGMZxb35qrWy8SbNByFPSK4toWpfXl3HxumrTVwilawXanCCUYc5IpYnUOE96v3AqKly5J+v3+iAYVoOrHXq7Qj45oazpRFvLXv+IIQLPeUh2/+omzpdBeyib9Ya43zmK4ZxP8ylLUGBXSdyi6ZyJ7Dj46RgNYvCcbqCm72ndcrtgUV3NRNFz9d5C94pzauhlO5JoINTZnQvyMzbDXvS8HA/PvWhWK4T3P+AoE5LOgSvNsjJ1IXUzFhux/TytIVvT/62dPNP6cFMgLo9SyQLR6T2ez+QlXBJFg9jPCX1/MdxIpUJPhMi67HbD7AX2ALhQF7uHwodTY4uT1SZJZ/bKICye0qncD9NDODvm7xE3imnADFqyy4lggpsv3yjKHBaxr6M1EpAaIpZwUy/CjAn7bCfMwOn7uh9qEwUTxoofvA7szFfnP622a8Xe79jXq9t5LoRbfaCMlmNtV+O66O8q4w87jLTZ+9EagDedJy3FO1GuNLuf3M6eRcyInV89JQW+9mjcwbBh+zVIMRlIdTeC5ySsOVT8PucMjSh+rKMkGi2YP4BOB6r+ZhF6MHCYR5koHtWTmjS1Zh5CEvgDzfuIorI/KzYyXRR9QYhGtUFHFmE6FVCQiCVvxTmKmBI= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU5PR03MB10263.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(18002099003)(38070700021)(56012099003)(22082099003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?jvKcKlgrBDhh6UEv87etZNSRXnk1JIb7/qPPBw6RUNw+E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Fa8+Kp4?= =?iso-8859-1?Q?QrTZoiWoztncMyCdYjRAiJQ2O7eRAM8=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DU5PR03MB10263.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 301c4b89-c713-4158-644d-08dea153021b X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2026 16:11:42.2002 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: PmwOBkVQ0B4+RR4dLsLU9a71VTZJNIakFLnZvuJUm6jjeiMqxmrBmbQzMDpdwXLAxdopvH7KJlUJOSS5bcs6uQtlm8SonX8a9hdIqp/yCPg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB6752 X-purgate-ID: tlsNG-33051d/1776960718-2B161938-A244AA8A/0/0 X-purgate-type: clean X-purgate-size: 2817 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1776960734038154100 Content-Type: text/plain; charset="utf-8" In cuart_init_postirq(), two code paths could reach the interrupt-enable write to IER without a handler being registered: - When no valid IRQ number was provided (uart->irq <=3D 0), the original positive-condition guard (if uart->irq > 0) skipped the irqaction setup but still fell through to the IER write, enabling the receive data interrupt with no handler installed. - When setup_irq() returned an error, only an error message was printed and execution continued to the IER write, arming the receive hardware interrupt line with no handler to service it. On platforms where the GIC receives this asserted line, the result is either repeated spurious-interrupt warnings or an unhandled interrupt fault. Restructure cuart_init_postirq() to use early returns in both error paths. Signed-off-by: Oleksii Moisieiev Reviewed-by: Oleksandr Tyshchenko --- Changes in v4: - fix %d to %u since irq is unsigned in cadence uart - add R-b Changes in v3: - clear pending error interrupts before setup_irq call for cadence uart - change uart->irq <=3D 0 to uart->irq =3D=3D 0 since irq is unsigned xen/drivers/char/cadence-uart.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/xen/drivers/char/cadence-uart.c b/xen/drivers/char/cadence-uar= t.c index b2f379833f..0f1c3dd461 100644 --- a/xen/drivers/char/cadence-uart.c +++ b/xen/drivers/char/cadence-uart.c @@ -72,19 +72,25 @@ static void __init cuart_init_postirq(struct serial_por= t *port) struct cuart *uart =3D port->uart; int rc; =20 - if ( uart->irq > 0 ) - { - uart->irqaction.handler =3D cuart_interrupt; - uart->irqaction.name =3D "cadence-uart"; - uart->irqaction.dev_id =3D port; - if ( (rc =3D setup_irq(uart->irq, 0, &uart->irqaction)) !=3D 0 ) - printk("ERROR: Failed to allocate cadence-uart IRQ %d\n", uart= ->irq); - } + /* Don't unmask interrupts if no valid irq was provided */ + if ( uart->irq =3D=3D 0 ) + return; + + uart->irqaction.handler =3D cuart_interrupt; + uart->irqaction.name =3D "cadence-uart"; + uart->irqaction.dev_id =3D port; =20 /* Clear pending error interrupts */ cuart_write(uart, R_UART_RTRIG, 1); cuart_write(uart, R_UART_CISR, ~0); =20 + if ( (rc =3D setup_irq(uart->irq, 0, &uart->irqaction)) !=3D 0 ) + { + printk("ERROR: Failed to allocate cadence-uart IRQ %u\n", uart->ir= q); + /* Do not unmask interrupts if irq handler wasn't set */ + return; + } + /* Unmask interrupts */ cuart_write(uart, R_UART_IDR, ~0); cuart_write(uart, R_UART_IER, UART_SR_INTR_RTRIG); --=20 2.43.0 From nobody Sun May 3 14:24:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1776960730; cv=pass; d=zohomail.com; s=zohoarc; b=bFGA5kMRI9EJ0ikKaXqh26iexuerT0lmF766lX2ximej4AdW5vu/MlrbC3DIDLR7lajvGit/QHEhQRvj4uT8ez4DEhdPVCWlAyOIimGBkvoLWno1fXlOg9bAG4INhAGTt1S0SW8oGeb1Qmu+EL7A/1nUcVwkg9y0Jw01SEfu0xc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1776960730; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WGOYorYk5IqETMMU68/1IVtJZAZHO3i8w9NcL6A6PSw=; b=fYz3h002nDq35ZvKeIpI7uC8dvW5N4FoEf7pYKkxskPY1zVDDYm7XVRzEMs2VQWr4C3Sj+wDALJlTnwTvEtNpOGKN2b7yZgnq0C2JPD7zawajxXSAqsR+Ew1jmP5Qj8lIb7MWP4mq9xgbCslap7YrusiOp6MBMMjn88W0cOH9f4= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1776960730690889.7298499061827; Thu, 23 Apr 2026 09:12:10 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1292402.1570893 (Exim 4.92) (envelope-from ) id 1wFweb-0000ks-4P; Thu, 23 Apr 2026 16:11:49 +0000 Received: by outflank-mailman (output) from mailman id 1292402.1570893; Thu, 23 Apr 2026 16:11:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFwea-0000jb-U2; Thu, 23 Apr 2026 16:11:48 +0000 Received: by outflank-mailman (input) for mailman id 1292402; Thu, 23 Apr 2026 16:11:47 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFweY-0000DF-Tl for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 16:11:47 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wFweY-004X3T-AI for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 18:11:46 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69ea44be-5cb7-0a2a0a5109dd-0a2a450bafd8-16 for ; Thu, 23 Apr 2026 18:11:46 +0200 Received: from [40.107.159.119] (helo=OSPPR02CU001.outbound.protection.outlook.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 69ea44bf-212f-0a2a450b0019-286b9f772e5a-6 for ; Thu, 23 Apr 2026 18:11:46 +0200 Received: from DU5PR03MB10263.eurprd03.prod.outlook.com (2603:10a6:10:519::5) by PA4PR03MB6752.eurprd03.prod.outlook.com (2603:10a6:102:ea::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9846.21; Thu, 23 Apr 2026 16:11:42 +0000 Received: from DU5PR03MB10263.eurprd03.prod.outlook.com ([fe80::8c9e:b301:61c0:3908]) by DU5PR03MB10263.eurprd03.prod.outlook.com ([fe80::8c9e:b301:61c0:3908%5]) with mapi id 15.20.9846.021; Thu, 23 Apr 2026 16:11:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UdJH5IOkNN37mK9LVnF/Myt14grTjU33TzCdSWJ+4B+fnJkzfTCkIRT+MO9bld1hLVRxSMZ9dAFC/7rgJdEuGZjm0/M8G8dQssJRAZ2McFL2zSM9Alr3LQtVhTaZP+6+7NrLWiWjVms7QzVQUkgGozs3qZR+1vQNypXldWYGGLItm+KbKqqY8yWXDdSy05cHXpRXQrvYy6Esq37e6FmK+on01UMlIPznH51I8Fp/ecsaBbqsprRdOKhNDPgQCUyTcir3t0QCcCmkK0rsvCZaGZiCfXTVEpHEzdQHKInrZ9eYxA5SihdyXSOQjdZzPTilKucAWOBAL2PFbOlni97GXg== 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=WGOYorYk5IqETMMU68/1IVtJZAZHO3i8w9NcL6A6PSw=; b=wmEX23jMSaMfzqFIlIHK2fkmYTUO7Ol61qsi8uLw9n4/3OtNPbOOQWiYC0xYuCZOXIT13uPqfpupS+6QCoUYkMUmkqNyEp5e6l8jaMayES3YQs5WmX7NPrxrg0f88tUzjsq5HRoeYP4JiQmjkxgllmN/NJfrGjpHZYez9GAPKq2pA1gUKIQx6Cqh2ZgifniygzJogm6FCAYWzFdmofu4JGu2J7h4JhYlPrcYKWyVypy4MjGLHMdmplVo8HBuw3S2KO5MQ6TX3wDV5eIqZQlHK4QMYK2iKUJ/GDq/CfRoCfRBSFNuFu8Mi8gTTRHeiSxXr5dZ4dawQz4uWRRzD42BKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WGOYorYk5IqETMMU68/1IVtJZAZHO3i8w9NcL6A6PSw=; b=HzSRWcStkC+977OP+ovidXBXVczUZZCw016bvMl5gf7y7C8XyUFJCU3GNqtN+zLK9X98uQpKIRr8GL6j4RVySl0xNuPwl4jGgumCoTXIzGz7U5ZEpvaadlcFnasMI7P1sDwsyjY7ewG+tAshweXpDI4H6/JJgrUXJ1SnT56hPUOOV0GdlIo2rg9UUdxl4UQOhVYh1sW66lr/2zHOBx7DsgAKSr1QM4iV6bAJEQBsz1S+ssUAdec0DoQ/7+Tu/48mjll+RD+JsrlPnyXQSyU4u3YGQGhoAytfsJb9AXCp/4HPnT/YsCZJ1UzGB1/LncqTdWH1OfH8yZSzxug0oPNfyg== From: Oleksii Moisieiev To: "xen-devel@lists.xenproject.org" CC: Bertrand Marquis , Julien Grall , Michal Orzel , Stefano Stabellini , Volodymyr Babchuk , Oleksii Moisieiev Subject: [PATCH v4 4/4] xen/drivers/char: fix exynos4210 IRQ registration failure propagation Thread-Topic: [PATCH v4 4/4] xen/drivers/char: fix exynos4210 IRQ registration failure propagation Thread-Index: AQHc0zvfSaMcr5qlbkezhiXMQevBTg== Date: Thu, 23 Apr 2026 16:11:42 +0000 Message-ID: <68ce483d6e42a4f7504fb73e5d20fe922f0c22b6.1776960679.git.oleksii_moisieiev@epam.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DU5PR03MB10263:EE_|PA4PR03MB6752:EE_ x-ms-office365-filtering-correlation-id: f122a687-49d6-4e8c-e04a-08dea1530244 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|366016|376014|18002099003|38070700021|56012099003|22082099003; x-microsoft-antispam-message-info: Bxq4z49SIkExxfKqeJgX5tZaIsu1GIvEsVQB4d5AYabHB5mnreEfXUoubjIkiQrLim9/YXr5FS3+4tR3lkH8r8xfG8OMIUf96C3UL9rlUTxaV0+5gOhhUSVHXMA8wLK4O36+1/zzKMRpItj4wh+2vpSfSNGiHged/FdrtVv0UfY+pmQ903RngerhlCKARtCex/Mw3hLS+0CkbmVL71PLFQE49jnysH+bJjeX7fGlLl+iiLiLLh8xDvLejOxvJhfyxk8iV7quu1umtjw8v4sQaOqcvGNV0SoK3H7Bl30aA1vQP5e2VXA4yRAipqMAYk1kzSaStN5hSKCuoDeo8/I17SSbn4Unq59Jxs8NUROJN6MY8N2U8r6j5fkSpKHuJimhWPnww5+UwzrFvpOwqI0H1589QZVHGohzUJyPzfJFoUflB+C+mTJwdT0osacZOEIT88jd8jm3MWwLAjjgxSeDYYl8F1il+7mCU08K+tSkzQkt+sjrNmsCgGPFXMGoi5Y7jAhQZwrffpGocLVVMULHJlM0D/4eyvRLrkm//biE5fO7v5eYDSpHNuFFdxFcTw3gXcR65R4YB2ByIttHODbl9t8EigYB2gDo5YJycWRX9z7/W0Y1zq4EuP3CVxMhzRjq6I+ccRus11DViOxSKKfkSTvugl2rjYiK0OEYlovMwWGoOEcDkFZZsOcqH3GoDyZ5hL3ocy/3bF6LIYoA+rh7fztImmqSgorX2f8xTczyZvU9iko5HizbFvr+D5t7U6WTYv7T2TRsHpxh36GgqiLzGoeqkCtKq3ck9hJCUAnTOoI= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU5PR03MB10263.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(18002099003)(38070700021)(56012099003)(22082099003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?eBftifm1g+RRvki5Af32STODtX3e4nCY5WpJZpVLMbWIB/eUBh4veAZHvu?= =?iso-8859-1?Q?aRqplzoxmJrHNU7x/AZwcwaP7Z3ogpPdZ3yp4qlioQ6mnT/ammauxKPuEo?= =?iso-8859-1?Q?jsYM7S0FYhhUH9y62HesdAn6kgeUd+da2KVTTumlquoEiShijwT+VNnBzT?= =?iso-8859-1?Q?voVZJtHZEu6bGatMdpoPyvviXy0UgGbX2s5LlMCwud3T2QfUi+wbWNIzoo?= =?iso-8859-1?Q?H4rNh89i2Z8dk9rQrfDHjfuqHAWAhia7iu9b21fpSficBPtp768dj+IBSm?= =?iso-8859-1?Q?/p7+5f0YYHiV0UqLU0CiDvCrb6MLyhZ31Xi6Gye1wbD1qHKLZSfDSJgMFm?= =?iso-8859-1?Q?blQm4n70JY3eshYOhm3HT5VarrwBjPceT+zLwVl2KOsXkAQzpRIYpOboUp?= =?iso-8859-1?Q?v2L+wvqi0pJCQXvxYzFu45H2D3n+xHp33PhshoA0Z/MdkXQYPFxxMyVDn3?= =?iso-8859-1?Q?gf6CH1nNPUO20iVJ//I3TCuzFrfToavq9lWLgs6KbB/SsLIJqVFdT34hHV?= =?iso-8859-1?Q?36nuQfnJzQdi4N4gxgkhtW2OIdhwCZ57YgAo7BqiUfsVsJDPD0Wu1ocfG9?= =?iso-8859-1?Q?yRMykH041HD6/MUyvYvzguN3Q8g3b5+giJW+EZ8eOXWNdACpnrbyaysic/?= =?iso-8859-1?Q?/eXyIw+EpQPvy2LSw+sX18zhIq6WmLLaHp9VGk+vyIweZwdKPSW2C+ejEA?=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Syrjl8ygg0JXb+CCSgRIS/QLEo6c?= =?iso-8859-1?Q?mnWhPG6lLelEPXdAl2LbRw6EFZfb8/p/6NURj+lD81dknuAw6k/wUeJqVw?= =?iso-8859-1?Q?U5PSMpVs2ke9qC01LW+CPlJAV4tFpt3wtjWX/gZoN2VdqgUzKLdOxYvV59?= =?iso-8859-1?Q?ISHWQusiNCoUx44Cf6OUsAKCH+Y3aRycrNd+5MdsY+S+Z2iedxn/mp6DwS?= =?iso-8859-1?Q?toS2mYD98ERG8CDV1l99vXFqiFSV2Rs=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DU5PR03MB10263.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f122a687-49d6-4e8c-e04a-08dea1530244 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2026 16:11:42.4981 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: SyP9VIEDA3wOFNpX11xewcI+jGgGx690b65XjIbY6HjOMJ7Oo6BVnzl/toOc8vXvO6rPKPB5radTyAlKCv4JxaaWSCICMZE+dUsZ2PM0yhA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB6752 X-purgate-ID: tlsNG-42698a/1776960706-07979F3B-924B5D52/0/0 X-purgate-type: clean X-purgate-size: 1917 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1776960731985154100 Content-Type: text/plain; charset="utf-8" In exynos4210_uart_init_postirq(), when setup_irq() returns an error the failure was only logged via dprintk() and execution continued, unconditionally clearing UINTM and setting UMCON_INT_EN. This enabled receive and transmit interrupt lines with no handler registered. On platforms where the GIC receives these asserted lines, the result is either repeated spurious-interrupt warnings or an unhandled interrupt fault. Add an early return in the setup_irq() error branch so that the interrupt-enable writes to UINTM and UMCON are skipped when IRQ registration fails. Signed-off-by: Oleksii Moisieiev Reviewed-by: Michal Orzel --- Changes in v4: - update comment on setup_irq - change %d to %u since irq is unsigned in exynos - add r-b Changes in v3: - skip clearing pending interrupts if setup_irq was failed because according to the 13.4.1.13 of the RM: it must be cleared after cleaning interrupt pending in INTC. xen/drivers/char/exynos4210-uart.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/drivers/char/exynos4210-uart.c b/xen/drivers/char/exynos42= 10-uart.c index 58901df554..7addc11c2c 100644 --- a/xen/drivers/char/exynos4210-uart.c +++ b/xen/drivers/char/exynos4210-uart.c @@ -199,8 +199,12 @@ static void __init exynos4210_uart_init_postirq(struct= serial_port *port) uart->irqaction.dev_id =3D port; =20 if ( (rc =3D setup_irq(uart->irq, 0, &uart->irqaction)) !=3D 0 ) - dprintk(XENLOG_ERR, "Failed to allocated exynos4210_uart IRQ %d\n", + { + dprintk(XENLOG_ERR, "Failed to allocated exynos4210_uart IRQ %u\n", uart->irq); + /* Do not unmask interrupts if irq handler wasn't set */ + return; + } =20 /* Unmask interrupts */ exynos4210_write(uart, UINTM, ~UINTM_ALLI); --=20 2.43.0