]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Avoid FLR for AMD FCH AHCI adapters
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Sat, 28 Jan 2023 01:39:51 +0000 (10:39 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:34:31 +0000 (09:34 +0100)
commita5ab2439b4d8c9d27e9bec4c5ac42125db0cabe3
tree3fd78831e3ab9ccd9bfd11e6e725c46c6c60f1a8
parent2362a462ceca56924db0a59b123d062eb2696329
PCI: Avoid FLR for AMD FCH AHCI adapters

commit 02a8cc28fbf0ee4ab23ecedae9007b1460510c89 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>
drivers/pci/quirks.c