From 639992e81dd6628534f7333b83fa8bb1de07625b Mon Sep 17 00:00:00 2001 From: Andy Nguyen Date: Thu, 30 Apr 2026 22:31:03 +0200 Subject: [PATCH] linux: hardcode ari functions --- linux.patch | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/linux.patch b/linux.patch index 43ac344..24d6016 100644 --- a/linux.patch +++ b/linux.patch @@ -1021,22 +1021,24 @@ index f3fd7f39efb4..7dd1b138ae78 100644 if (amd_iommu_irq_remap) { struct amd_iommu_pci_seg *pci_seg; diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c -index bccc7a4bdd79..ee8e93b79e9f 100644 +index bccc7a4bdd79..ed434b9650e9 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c -@@ -2807,7 +2807,12 @@ static int next_ari_fn(struct pci_bus *bus, struct pci_dev *dev, int fn) +@@ -2802,6 +2802,14 @@ static int next_ari_fn(struct pci_bus *bus, struct pci_dev *dev, int fn) + u16 cap = 0; + unsigned int next_fn; - pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ARI); - if (!pos) +#ifdef CONFIG_X86_PS5 -+ /* PCI config via sfc_read does not have ARI capability, so just assume fn + 1. */ ++ /* ARI capability is broken, so we just assume contiguous functions until 45. */ ++ if (fn < 45) + return fn + 1; -+#else - return -ENODEV; ++ else ++ return -ENODEV; +#endif ++ + if (!dev) + return -ENODEV; - pci_read_config_word(dev, pos + PCI_ARI_CAP, &cap); - next_fn = PCI_ARI_CAP_NFN(cap); diff --git a/drivers/ps5/Makefile b/drivers/ps5/Makefile new file mode 100644 index 000000000000..7acb030a4976