[PATCH v3 0/4] xen/drivers/char: fix IRQ registration failure propagation

Oleksii Moisieiev posted 4 patches 1 week, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/cover.1776850201.git.oleksii._5Fmoisieiev@epam.com
There is a newer version of this series
xen/drivers/char/cadence-uart.c    | 22 ++++++++++++++--------
xen/drivers/char/exynos4210-uart.c |  4 ++++
xen/drivers/char/pl011.c           | 22 ++++++++++++++--------
xen/drivers/char/scif-uart.c       | 16 ++++++++++++----
4 files changed, 44 insertions(+), 20 deletions(-)
[PATCH v3 0/4] xen/drivers/char: fix IRQ registration failure propagation
Posted by Oleksii Moisieiev 1 week, 4 days ago
This series fixes a common bug pattern found in several Xen UART drivers:
when setup_irq() fails during post-IRQ initialization, drivers log the
error but continue executing and unconditionally unmask hardware
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.

Patch 1, originally submitted as a standalone fix in v1, addresses
the issue in the SCIF driver and moves the hardware error-flag clearing
sequence to before the setup_irq() call so that stale error bits are
cleared unconditionally. Patches 2-4 apply the same early-return fix to
the pl011, cadence-uart, and exynos4210-uart drivers.

The pl011 and cadence-uart drivers additionally had a positive-condition
IRQ guard (if uart->irq > 0) that could fall through to the interrupt
unmask even when no valid IRQ was provided. Both are restructured to
use the early-return idiom.

Changes in v3:
- clear pending error interrupts before setup_irq for pl011
- clear pending error interrupts before setup_irq call for cadence uart
- change uart->irq <= 0 to uart->irq == 0 since irq is unsigned
- 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.

Changes in v2:
- Extend fix to pl011, cadence-uart and exynos4210
- fix typo in patch 1 description

Oleksii Moisieiev (4):
  xen/drivers/char: fix SCIF IRQ registration failure propagation
  xen/drivers/char/pl011: fix IRQ registration failure propagation
  xen/drivers/char/cadence-uart: fix IRQ registration failure
    propagation
  xen/drivers/char: fix exynos4210 IRQ registration failure propagation

 xen/drivers/char/cadence-uart.c    | 22 ++++++++++++++--------
 xen/drivers/char/exynos4210-uart.c |  4 ++++
 xen/drivers/char/pl011.c           | 22 ++++++++++++++--------
 xen/drivers/char/scif-uart.c       | 16 ++++++++++++----
 4 files changed, 44 insertions(+), 20 deletions(-)

-- 
2.43.0

base-commit: 077dcf9841ad7df4e63c718249d8ac95f8a709ff
branch: amoi_dfmea_scifv3