drm/amdgpu: don't use ATRM for external devices
A message that is not in the archive (sent off-list or not yet received): [email protected]
Ping on this series?
Alex
Quoted 42 lines · Alex Deucher
The ATRM ACPI method is for fetching the dGPU vbios rom image on laptops and all-in-one systems. It should not be used for external add in cards. If the dGPU is thunderbolt connected, don't try ATRM.
v2:
pci_is_thunderbolt_attachedonly works for Intel. Usepdev->external_facing instead.v3:
dev_is_removable()seems to be what we wantSigned-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c +5
-1@@ -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) --2.41.0
Mario Limonciello
Reviewed-byQuoted 11 lines · Alex Deucher
The ATRM ACPI method is for fetching the dGPU vbios rom image on laptops and all-in-one systems. It should not be used for external add in cards. If the dGPU is thunderbolt connected, don't try ATRM.
v2:
pci_is_thunderbolt_attachedonly works for Intel. Usepdev->external_facing instead.v3:
dev_is_removable()seems to be what we want
Reviewed-by Mario Limonciello <[email protected]>
Quoted 27 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c +5
-0@@ -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)