]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
PCI/switchtec: Fix vep_vector_number ioread width
authorLogan Gunthorpe <logang@deltatee.com>
Mon, 6 Jan 2020 19:03:27 +0000 (12:03 -0700)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 17 Feb 2020 11:36:58 +0000 (12:36 +0100)
BugLink: https://bugs.launchpad.net/bugs/1863589
commit 9375646b4cf03aee81bc6c305aa18cc80b682796 upstream.

vep_vector_number is actually a 16 bit register which should be read with
ioread16() instead of ioread32().

Fixes: 080b47def5e5 ("MicroSemi Switchtec management interface driver")
Link: https://lore.kernel.org/r/20200106190337.2428-3-logang@deltatee.com
Reported-by: Doug Meyer <dmeyer@gigaio.com>
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/pci/switch/switchtec.c

index 1bb3dcf3d7a2e332d866e3a94d117bfd8fa6203f..cc43c855452f741d9ec37d5e39d68d70c8ac9c38 100644 (file)
@@ -1276,7 +1276,7 @@ static int switchtec_init_isr(struct switchtec_dev *stdev)
        if (nvecs < 0)
                return nvecs;
 
-       event_irq = ioread32(&stdev->mmio_part_cfg->vep_vector_number);
+       event_irq = ioread16(&stdev->mmio_part_cfg->vep_vector_number);
        if (event_irq < 0 || event_irq >= nvecs)
                return -EFAULT;