drm/amdgpu: don't use ATRM for external devices
[platform/kernel/linux-starfive.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_bios.c
index 38ccec9..f3a09ec 100644 (file)
@@ -29,6 +29,7 @@
 #include "amdgpu.h"
 #include "atom.h"
 
+#include <linux/device.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/acpi.h>
@@ -287,6 +288,10 @@ static bool amdgpu_atrm_get_bios(struct amdgpu_device *adev)
        if (adev->flags & AMD_IS_APU)
                return false;
 
+       /* ATRM is for on-platform devices only */
+       if (dev_is_removable(&adev->pdev->dev))
+               return false;
+
        while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
                dhandle = ACPI_HANDLE(&pdev->dev);
                if (!dhandle)