All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ns16550: reject IRQ above nr_irqs
@ 2022-03-10 14:34 Marek Marczykowski-Górecki
  2022-03-10 14:34 ` [PATCH 2/2] ns16550: Add support for Intel LPSS UART Marek Marczykowski-Górecki
  2022-03-10 15:23 ` [PATCH 1/2] ns16550: reject IRQ above nr_irqs Jan Beulich
  0 siblings, 2 replies; 18+ messages in thread
From: Marek Marczykowski-Górecki @ 2022-03-10 14:34 UTC (permalink / raw)
  To: xen-devel
  Cc: Marek Marczykowski-Górecki, Andrew Cooper, George Dunlap,
	Jan Beulich, Julien Grall, Stefano Stabellini, Wei Liu

Intel LPSS has INTERRUPT_LINE set to 0xff by default, that can't
possibly work. While a proper IRQ configuration may be useful,
validating value retrieved from the hardware is still necessary. If it
fails, use the device in poll mode.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/drivers/char/ns16550.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index e5b4a9085516..2d7c8c11bc69 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1221,6 +1221,9 @@ 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;
 
+                if (uart->irq >= nr_irqs)
+                    uart->irq = 0;
+
                 return 0;
             }
         }
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2022-03-15 10:03 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-10 14:34 [PATCH 1/2] ns16550: reject IRQ above nr_irqs Marek Marczykowski-Górecki
2022-03-10 14:34 ` [PATCH 2/2] ns16550: Add support for Intel LPSS UART Marek Marczykowski-Górecki
2022-03-15  9:04   ` Jan Beulich
2022-03-10 15:23 ` [PATCH 1/2] ns16550: reject IRQ above nr_irqs Jan Beulich
2022-03-10 15:47   ` Roger Pau Monné
2022-03-10 16:08     ` Jan Beulich
2022-03-10 16:12       ` Roger Pau Monné
2022-03-10 16:21         ` Julien Grall
2022-03-10 16:34           ` Jan Beulich
2022-03-10 16:37           ` Marek Marczykowski-Górecki
2022-03-11 10:23             ` Julien Grall
2022-03-11 10:52               ` Marek Marczykowski-Górecki
2022-03-11 11:15                 ` Julien Grall
2022-03-11 15:04                   ` Roger Pau Monné
2022-03-11 15:19                     ` Julien Grall
2022-03-11 15:43                       ` Roger Pau Monné
2022-03-11 16:32                         ` Marek Marczykowski-Górecki
2022-03-15 10:02                           ` Roger Pau Monné

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.