Skip to content

Commit

Permalink
drm/amdgpu: don't use ATRM for external devices
Browse files Browse the repository at this point in the history
commit 432e664 upstream.

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_attached only works for Intel.  Use
    pdev->external_facing instead.
v3: dev_is_removable() seems to be what we want

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2925
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
alexdeucher authored and gregkh committed Nov 28, 2023
1 parent 965dce0 commit 2ab6c12
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -289,6 +290,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)
Expand Down

0 comments on commit 2ab6c12

Please sign in to comment.