linux/drivers/pci
Mikulas Patocka f1f90e254e PCI: Fix incorrect value returned from pcie_get_speed_cap()
The macros PCI_EXP_LNKCAP_SLS_*GB are values, not bit masks.  We must mask
the register and compare it against them.

This fixes errors like this:

  amdgpu: [powerplay] failed to send message 261 ret is 0

when a PCIe-v3 card is plugged into a PCIe-v1 slot, because the slot is
being incorrectly reported as PCIe-v3 capable.

6cf57be0f7, which appeared in v4.17, added pcie_get_speed_cap() with the
incorrect test of PCI_EXP_LNKCAP_SLS as a bitmask.  5d9a633040, which
appeared in v4.19, changed amdgpu to use pcie_get_speed_cap(), so the
amdgpu bug reports below are regressions in v4.19.

Fixes: 6cf57be0f7 ("PCI: Add pcie_get_speed_cap() to find max supported link speed")
Fixes: 5d9a633040 ("drm/amdgpu: use pcie functions for link width and speed")
Link: https://bugs.freedesktop.org/show_bug.cgi?id=108704
Link: https://bugs.freedesktop.org/show_bug.cgi?id=108778
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
[bhelgaas: update comment, remove use of PCI_EXP_LNKCAP_SLS_8_0GB and
PCI_EXP_LNKCAP_SLS_16_0GB since those should be covered by PCI_EXP_LNKCAP2,
remove test of PCI_EXP_LNKCAP for zero, since that register is required]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org	# v4.17+
2018-11-30 23:42:03 -06:00
..
controller pci-v4.20-changes 2018-10-25 06:50:48 -07:00
endpoint Merge branch 'remotes/lorenzo/pci/dwc' 2018-08-15 14:59:11 -05:00
hotplug Merge branch 'xarray' of git://git.infradead.org/users/willy/linux-dax 2018-10-28 11:35:40 -07:00
pcie Merge branch 'pci/misc' 2018-10-20 11:45:30 -05:00
switch switchtec: Fix Spectre v1 vulnerability 2018-09-11 08:47:40 -05:00
access.c PCI: Uninline PCI bus accessors for better ftracing 2018-10-04 16:37:37 -05:00
ats.c
bus.c
ecam.c
host-bridge.c
iov.c PCI/IOV: Remove unnecessary include of <linux/pci-ats.h> 2018-10-11 14:35:12 -05:00
irq.c
Kconfig Merge branch 'remotes/lorenzo/pci/controller-misc' 2018-10-20 11:45:47 -05:00
Makefile Merge branch 'remotes/lorenzo/pci/controller-misc' 2018-10-20 11:45:47 -05:00
mmap.c
msi.c PCI/MSI: Warn and return error if driver enables MSI/MSI-X twice 2018-09-25 15:17:39 -05:00
of.c iommu/of: make of_pci_map_rid() available for other devices too 2018-09-25 09:47:52 +02:00
p2pdma.c PCI/P2PDMA: Introduce configfs/sysfs enable attribute helpers 2018-10-17 12:18:17 -05:00
pci-acpi.c Revert "ACPI/PCI: Pay attention to device-specific _PXM node values" 2018-11-13 08:38:17 -06:00
pci-bridge-emul.c PCI: Introduce PCI bridge emulated config space common logic 2018-10-18 17:50:19 +01:00
pci-bridge-emul.h PCI: Introduce PCI bridge emulated config space common logic 2018-10-18 17:50:19 +01:00
pci-driver.c Merge branch 'pci/misc' 2018-08-15 14:58:54 -05:00
pci-label.c
pci-mid.c x86/cpu: Sanitize FAM6_ATOM naming 2018-10-02 10:14:32 +02:00
pci-pf-stub.c
pci-stub.c
pci-sysfs.c Merge branch 'pci/hotplug' 2018-08-15 14:58:52 -05:00
pci.c PCI: Fix incorrect value returned from pcie_get_speed_cap() 2018-11-30 23:42:03 -06:00
pci.h Merge branch 'pci/virtualization' 2018-10-20 11:45:35 -05:00
probe.c Merge branch 'pci/virtualization' 2018-10-20 11:45:35 -05:00
proc.c
quirks.c PCI: Fix Switchtec DMA aliasing quirk dmesg noise 2018-10-11 11:28:53 -05:00
remove.c PCI/ASPM: Fix link_state teardown on device removal 2018-09-17 16:32:23 -05:00
rom.c
search.c
setup-bus.c PCI: Equalize hotplug memory and io for occupied and empty slots 2018-10-02 16:04:40 -05:00
setup-irq.c
setup-res.c
slot.c PCI/ERR: Use slot reset if available 2018-09-21 12:18:10 -05:00
syscall.c
vc.c
vpd.c
xen-pcifront.c