[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/4] xen/drivers/char: fix SCIF IRQ registration failure propagation
- To: Oleksii Moisieiev <Oleksii_Moisieiev@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: "Orzel, Michal" <michal.orzel@xxxxxxx>
- Date: Thu, 9 Apr 2026 16:31:58 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=epam.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- 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=WVT6ms/4/5B1430m35U1YpiaxU3qA1qtSjiP14nFtLw=; b=KdGCz/C9w1oR2CtnuTD3uCN4E6i1uXiqWJyuNYHjxmgV4ZRCkz7U2vYYIr73+g/wZ7/56ceMbUWbrW0D1Vrx9XdRIZIfLJn6v78DfYwIb+U2dSPnd35yrBteoqKb6HBD/aN9Td4VspYkzjeXuKXQ3lSqitV+Z28CgxBngRdiXonRqY4xttAx0mGxZQEaIhqHWmJBZNFL3V+qJuR61oV16rvAb4Xovjb0ZklRJ8s0JV1cRcBTzhF50w7VzTRsTBFWjRR7U9koqKNkv6nzpZ8P1fHGzyQkyz13z4IaHUzwYxBxLUqZOc7dyOZBBjFISeOsKFKoqsWBUKrtLeE3msvyPA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VoaTDaHmcM92dZpdk/ecgbOPijyaVDbHT2AGA4gkJWsQ5BUiJfpq0Uz4aJM05HMIqIdTSEXc2Y7tVRfDxkbDDQBx1Q+RdqBQYY0GdODLhFLDZTSKW/nyFVv0XIJQqHM/PRALqAXdd9FZs29u7GvSj2MnWXbLo+BYPL4AXVijmJ12vS5Iomn+u9CMm6cev7LeabTMFPGaaFTp/YfRpSM+dXEP+qaso4L8yp5mrrEmruSGpzMbuDdmyIj6HVj3AzB451anUS5rej/7aHN1YsBv7oyGS7Pon+2ZARCHoplmQSfLrhyiTGCCQvRDb5zQuGl0yz3JRcnrhShqUBEBXgzCIA==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Cc: Bertrand Marquis <bertrand.marquis@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Thu, 09 Apr 2026 14:32:14 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 09/04/2026 15:50, Oleksii Moisieiev wrote:
> 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 <oleksii_moisieiev@xxxxxxxx>
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
~Michal
|