On 10/15/26 07:56, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] pci: missing EXPORT_SYMBOL for pci_realloc_enabled_by_user() breaks 
amdgpu
--

commit 9eeda1e99dc9a34bbbe5670a252bc894b1208696
Author: Mario Limonciello <[email protected]>

drm/amdgpu: Gate VFCT bus fallback on pci=realloc

This patch modifies the soft filter system to gate the VFCT bus fallback
so it only runs when pci=realloc is explicitly requested by the user. It
introduces pci_realloc_enabled_by_user() in the PCI core and uses it in
the AMDGPU driver.

Closes: 
https://lore.kernel.org/amd-gfx/[email protected]/

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
index f9315e0472fe9..9651260278c18 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
[ ... ]
@@ -459,7 +457,10 @@ static int amdgpu_acpi_vfct_match(struct amdgpu_device 
*adev,
        if (vhdr->PCIBus == adev->pdev->bus->number)
                return 0;
- /* Bus mismatch but device identity matches (PCI renumbering case) */
+       /* Allow bus renumbering only when the user requested pci=realloc. */
+       if (!pci_realloc_enabled_by_user())
+               return -ENODEV;
+

[ ... ]

diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index ed16ef7c26fa7..d9450585082c0 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1799,6 +1799,11 @@ static bool pci_realloc_enabled(enum enable_type enable)
        return enable >= user_enabled;
  }
+bool pci_realloc_enabled_by_user(void)
+{
+       return pci_realloc_enable == user_enabled;
+}
+

[Severity: Low]
Will this cause a module build failure (undefined reference) if the amdgpu
driver is compiled as a loadable module (CONFIG_DRM_AMDGPU=m)?

Since setup-bus.c is built into the core kernel and 
pci_realloc_enabled_by_user()
lacks an EXPORT_SYMBOL or EXPORT_SYMBOL_GPL macro, the linker won't be able
to resolve this symbol during modpost for amdgpu.ko.


Yeah; this is a valid issue. If we're aligned directionally on this I'll fix that in a v2.

Reply via email to