linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pci: Avoid FLR for AMD FCH AHCI adapters
@ 2023-01-28  1:39 Damien Le Moal
  2023-01-30 15:21 ` Bjorn Helgaas
  0 siblings, 1 reply; 7+ messages in thread
From: Damien Le Moal @ 2023-01-28  1:39 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci; +Cc: Niklas Cassel

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. Forcing the "bus" reset method before
unbinding & binding the adapter to the vfio-pci driver solves this
issue. I.e.:

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

gives a working guest OS, thus indicating that the default flr reset
method is defective, resulting in the adapter not being reset correctly.

This patch applies the no_flr quirk to AMD FCH AHCI devices to
permanently solve this issue.

Reported-by: Niklas Cassel <niklas.cassel@wdc.com>
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
---
 drivers/pci/quirks.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 285acc4aaccc..20ac67d59034 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5340,6 +5340,7 @@ static void quirk_no_flr(struct pci_dev *dev)
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x1487, quirk_no_flr);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x148c, quirk_no_flr);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x149c, quirk_no_flr);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x7901, quirk_no_flr);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1502, quirk_no_flr);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1503, quirk_no_flr);
 
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-31  0:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-28  1:39 [PATCH] pci: Avoid FLR for AMD FCH AHCI adapters Damien Le Moal
2023-01-30 15:21 ` Bjorn Helgaas
2023-01-30 15:46   ` Niklas Cassel
2023-01-30 16:04     ` Bjorn Helgaas
2023-01-31  0:36       ` Damien Le Moal
2023-01-30 16:12   ` Shyam Sundar S K
2023-01-30 16:33     ` Niklas Cassel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).