]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
ns16550: use poll mode if INTERRUPT_LINE is 0xff
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Fri, 20 May 2022 10:19:45 +0000 (12:19 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 20 May 2022 10:19:45 +0000 (12:19 +0200)
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 <marmarek@invisiblethingslab.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/drivers/char/ns16550.c

index c133f1f466754d82ce2a05e393b6401796e17243..cd3573e43df3ef632bd8af87ef19b3e28db3755e 100644 (file)
@@ -1316,6 +1316,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;
             }
         }