android_kernel_motorola_sm6225/drivers/pci
Damien Le Moal aa39330a9f PCI: Avoid FLR for AMD FCH AHCI adapters
commit 63ba51db24ed1b8f8088a897290eb6c036c5435d upstream.

PCI passthrough to VMs does not work with AMD FCH AHCI adapters: the guest
OS fails to correctly probe devices attached to the controller due to FIS
communication failures:

  ata4: softreset failed (1st FIS failed)
  ...
  ata4.00: qc timeout after 5000 msecs (cmd 0xec)
  ata4.00: failed to IDENTIFY (I/O error, err_mask=0x4)

Forcing the "bus" reset method before unbinding & binding the adapter to
the vfio-pci driver solves this issue, e.g.:

  echo "bus" > /sys/bus/pci/devices/<ID>/reset_method

gives a working guest OS, indicating that the default FLR reset method
doesn't work correctly.

Apply quirk_no_flr() to AMD FCH AHCI devices to work around this issue.

Link: https://lore.kernel.org/r/20230128013951.523247-1-damien.lemoal@opensource.wdc.com
Reported-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-11 16:31:55 +01:00
..
controller PCI: hv: Fix interrupt mapping for multi-MSI 2022-07-29 17:10:38 +02:00
endpoint PCI: endpoint: Fix missing destroy_workqueue() 2021-05-22 10:59:43 +02:00
hotplug PCI: pciehp: Add Qualcomm quirk for Command Completed erratum 2022-04-15 14:15:01 +02:00
pcie
switch
access.c PCI: Reduce warnings on possible RW1C corruption 2022-04-15 14:14:50 +02:00
ats.c
bus.c
ecam.c
host-bridge.c
iov.c
irq.c PCI: Check for alloc failure in pci_request_irq() 2023-01-18 11:30:21 +01:00
Kconfig
Makefile
mmap.c
msi.c PCI/MSI: Mask MSI-X vectors only on success 2021-12-22 09:19:02 +01:00
of.c
pci-acpi.c
pci-driver.c
pci-label.c PCI/sysfs: Fix dsm_label_utf16s_to_utf8s() buffer overrun 2021-07-20 16:16:12 +02:00
pci-mid.c
pci-pf-stub.c
pci-stub.c
pci-sysfs.c PCI/sysfs: Fix double free in error path 2023-01-18 11:30:44 +01:00
pci.c PCI: Fix pci_device_is_present() for VFs by checking PF 2023-01-18 11:30:44 +01:00
pci.h PCI: thunder: Fix compile testing 2021-05-22 10:59:48 +02:00
probe.c PCI: Release OF node in pci_scan_device()'s error path 2021-05-22 10:59:42 +02:00
proc.c
quirks.c PCI: Avoid FLR for AMD FCH AHCI adapters 2023-03-11 16:31:55 +01:00
remove.c
rom.c
search.c
setup-bus.c
setup-irq.c
setup-res.c PCI: Sanitise firmware BAR assignments behind a PCI-PCI bridge 2022-10-26 13:19:22 +02:00
slot.c
syscall.c PCI: Return ~0 data on pciconfig_read() CAP_SYS_ADMIN failure 2021-09-22 11:48:00 +02:00
vc.c
vpd.c
xen-pcifront.c