android_kernel_samsung_a7y1.../drivers/pci
Jian-Hong Pan b06e7a183d PCI/MSI: Fix incorrect MSI-X masking on resume
commit e045fa29e89383c717e308609edd19d2fd29e1be upstream.

When a driver enables MSI-X, msix_program_entries() reads the MSI-X Vector
Control register for each vector and saves it in desc->masked.  Each
register is 32 bits and bit 0 is the actual Mask bit.

When we restored these registers during resume, we previously set the Mask
bit if *any* bit in desc->masked was set instead of when the Mask bit
itself was set:

  pci_restore_state
    pci_restore_msi_state
      __pci_restore_msix_state
        for_each_pci_msi_entry
          msix_mask_irq(entry, entry->masked)   <-- entire u32 word
            __pci_msix_desc_mask_irq(desc, flag)
              mask_bits = desc->masked & ~PCI_MSIX_ENTRY_CTRL_MASKBIT
              if (flag)       <-- testing entire u32, not just bit 0
                mask_bits |= PCI_MSIX_ENTRY_CTRL_MASKBIT
              writel(mask_bits, desc_addr + PCI_MSIX_ENTRY_VECTOR_CTRL)

This means that after resume, MSI-X vectors were masked when they shouldn't
be, which leads to timeouts like this:

  nvme nvme0: I/O 978 QID 3 timeout, completion polled

On resume, set the Mask bit only when the saved Mask bit from suspend was
set.

This should remove the need for 19ea025e1d28 ("nvme: Add quirk for Kingston
NVME SSD running FW E8FK11.T").

[bhelgaas: commit log, move fix to __pci_msix_desc_mask_irq()]
Link: https://bugzilla.kernel.org/show_bug.cgi?id=204887
Link: https://lore.kernel.org/r/20191008034238.2503-1-jian-hong@endlessm.com
Fixes: f2440d9acbe8 ("PCI MSI: Refactor interrupt masking code")
Signed-off-by: Jian-Hong Pan <jian-hong@endlessm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-07 13:12:43 +02:00
..
host PCI: keystone: Use quirk to limit MRRS for K2G 2020-04-07 12:36:44 +02:00
hotplug PCI: rpadlpar: Fix leaked device_node references in add/remove paths 2020-04-06 19:02:23 +02:00
pcie A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
access.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ats.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bus.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
host-bridge.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hotplug-pci.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
htirq.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
iov.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
irq.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
msi.c PCI/MSI: Fix incorrect MSI-X masking on resume 2020-04-07 13:12:43 +02:00
of.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pci-acpi.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pci-driver.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pci-label.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pci-stub.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pci-sysfs.c PCI: sysfs: Ignore lockdep for remove attribute 2020-04-06 20:06:10 +02:00
pci.c PCI: PM: Fix pci_power_up() 2020-04-07 09:27:08 +02:00
pci.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
probe.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
proc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
quirks.c PCI: Fix Intel ACS quirk UPDCR register address 2020-04-07 13:12:41 +02:00
remove.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rom.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
search.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
setup-bus.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
setup-irq.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
setup-res.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
slot.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
syscall.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
vc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
vpd.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xen-pcifront.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30