From a4206702174574e292ee7e1adfe3363f71d6eadc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Fri, 7 Oct 2022 21:00:10 +0200 Subject: [PATCH] pci_decode: disable MSI on HDAUDIO cards According to OpenBSD's azalia driver some AMD HDAudio devices do not play nice with MSIs although the capability is set. At least the 0x1457 device was tested and worked using GSIs only. genodelabs/genode#4578 --- repos/os/src/app/pci_decode/main.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/repos/os/src/app/pci_decode/main.cc b/repos/os/src/app/pci_decode/main.cc index 6307f18544..a786606a31 100644 --- a/repos/os/src/app/pci_decode/main.cc +++ b/repos/os/src/app/pci_decode/main.cc @@ -153,6 +153,27 @@ void Main::parse_pci_function(Bdf bdf, }); }); + { + /* Apply GSI/MSI/MSI-X quirks based on vendor/device/class */ + using Cc = Config::Class_code_rev_id; + + bool const hdaudio = cfg.read() == 0x40300; + auto const vendor_id = cfg.read(); + auto const device_id = cfg.read(); + + if (hdaudio && vendor_id == 0x1022 /* AMD */) { + /** + * see dde_bsd driver dev/pci/azalia.c + * + * PCI_PRODUCT_AMD_17_HDA + * PCI_PRODUCT_AMD_17_1X_HDA + * PCI_PRODUCT_AMD_HUDSON2_HDA + */ + if (device_id == 0x1457 || device_id == 0x15e3 || + device_id == 0x780d) + msi = msi_x = false; + } + } /* * Only generate nodes if at least one of the following