RE: [PATCH] drm/amdgpu: Disable runtime PM for externally attached dGPUs

"Li, Candice" <[email protected]>
Newsgroups org.freedesktop.lists.amd-gfx
Message-ID <IA1PR12MB766149F0F5A7397BF3B45A4D91DC2@IA1PR12MB7661.namprd12.prod.outlook.com>
AMD General

Reviewed-by: Candice Li <[email protected]>


Thanks,
Candice

-----Original Message-----
From: Wang, Yang(Kevin) <[email protected]>
Sent: Wednesday, August 12, 2026 4:09 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>; Feng, Kenneth <[email protected]>; Li, Candice <[email protected]>
Subject: [PATCH] drm/amdgpu: Disable runtime PM for externally attached dGPUs

pci_is_thunderbolt_attached() requires an upstream PCI bridge with
is_thunderbolt set from an Intel Thunderbolt VSEC. This does not cover
the affected ASM4242 USB4 PCI hierarchy:

  00:02.2
    \- 0f:00.0 [1b21:2421]
       +- 10:01.0 [1b21:2423] -> 45:00.0 -> 46:00.0
       |  -> 47:00.0 -> 48:00.0 -> 49:00.0 [1002:7590]
       \- 10:03.0 -> 76:00.0 [1b21:2425] USB4 Host Router

The host router is outside the GPU upstream bridge chain, leaving no
ancestor with is_thunderbolt set. PCI core propagates DEVICE_REMOVABLE
below the external-facing PCIe tunnel. Disable Runtime PM when either
pci_is_thunderbolt_attached() or dev_is_removable() is true.

Signed-off-by: Yang Wang <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 8ebe24d59ab6..a4b4f9645c84 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -609,6 +609,13 @@ void amdgpu_device_detect_runtime_pm_mode(struct amdgpu_device *adev)
        int bamaco_support;

        adev->pm.rpm_mode = AMDGPU_RUNPM_NONE;
+       if (pci_is_thunderbolt_attached(adev->pdev) ||
+           dev_is_removable(&adev->pdev->dev)) {
+               dev_info(adev->dev,
+                        "Runtime PM disabled for externally attached device\n");
+               return;
+       }
+
        bamaco_support = amdgpu_device_supports_baco(adev);

        switch (amdgpu_runtime_pm) {
--
2.54.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.