[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging-4.9] ns16550/PCI: fix skipping of devices



commit 840b5233f54bd0a00f712de310558e8324cec5a6
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Feb 1 12:02:45 2019 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Feb 1 12:02:45 2019 +0100

    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 <jbeulich@xxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    master commit: c34fe0468acc61aca62422483c37a1309708f1cb
    master date: 2018-11-30 12:07:33 +0100
---
 xen/drivers/char/ns16550.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index e4de3b476c..b7a9c5e72a 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -972,18 +972,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);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.9

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.