From: Marek Marczykowski-Górecki Date: Tue, 7 Jun 2022 12:22:50 +0000 (+0200) Subject: ns16550: use poll mode if INTERRUPT_LINE is 0xff X-Git-Tag: RELEASE-4.15.3~13 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c7f9e0e30de957979f3cd040d6748fdd1397fd7f;p=xen.git ns16550: use poll mode if INTERRUPT_LINE is 0xff Intel LPSS has INTERRUPT_LINE set to 0xff by default, that is declared by the PCI Local Bus Specification Revision 3.0 (from 2004) as "unknown"/"no connection". Fallback to poll mode in this case. The 0xff handling is x86-specific, the surrounding code is guarded with CONFIG_X86 anyway. Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Roger Pau Monné master commit: 6a2ea1a2370a0c8a0210accac0ae62e68c185134 master date: 2022-05-20 12:19:45 +0200 --- diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c index 16a73d0c0e..c7332e02f1 100644 --- a/xen/drivers/char/ns16550.c +++ b/xen/drivers/char/ns16550.c @@ -1162,6 +1162,19 @@ pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int idx) pci_conf_read8(PCI_SBDF(0, b, d, f), PCI_INTERRUPT_LINE) : 0; +#ifdef CONFIG_X86 + /* + * PCI Local Bus Specification Revision 3.0 defines 0xff value + * as special only for X86. + */ + if ( uart->irq == 0xff ) + uart->irq = 0; +#endif + if ( !uart->irq ) + printk(XENLOG_INFO + "ns16550: %pp: no legacy IRQ, using poll mode\n", + &PCI_SBDF(0, b, d, f)); + return 0; } }