From: Jan Beulich Date: Fri, 30 Nov 2018 11:07:33 +0000 (+0100) Subject: ns16550/PCI: fix skipping of devices X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~2813 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c34fe0468acc61aca62422483c37a1309708f1cb;p=xen.git ns16550/PCI: fix skipping of devices Selecting between single/multiple BAR mode should happen after checking whether to skip the present device, or else multi-BAR devices won't be skipped correctly, due to port_idx getting set to zero in that case. Signed-off-by: Jan Beulich Acked-by: Wei Liu --- diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c index 3c66e65b1c..3eba56eadc 100644 --- a/xen/drivers/char/ns16550.c +++ b/xen/drivers/char/ns16550.c @@ -1037,18 +1037,18 @@ pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int idx) } } - if ( !param->bar0 ) - { - bar_idx = idx; - port_idx = 0; - } - if ( port_idx >= param->max_ports ) { idx -= param->max_ports; continue; } + if ( !param->bar0 ) + { + bar_idx = idx; + port_idx = 0; + } + uart->io_base = 0; bar = pci_conf_read32(0, b, d, f, PCI_BASE_ADDRESS_0 + bar_idx*4);