Skip to contentSkip to conversation

drm/amdgpu: Disable runtime PM for externally attached dGPUs

PATCH In review Yang Wang 4 participants 6 messages Aug 12

Subsystems (2)
lore
Share & tools
lore

Yang Wang

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -0
index 8ebe24d59ab6..a4b4f9645c84 100644
@@ -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) {
Signature · 1 line
2.54.0
Reviewed-by on v1 1/1
#1 lore raw

AMD General

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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -0
index 8ebe24d59ab6..a4b4f9645c84 100644
@@ -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

Reviewed-by on v1 1/1
#2 lore raw
In reply to Yang Wang

AMD General

-----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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -0
index 8ebe24d59ab6..a4b4f9645c84 100644
@@ -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

#3 lore raw
In reply to Yang Wang
Quoted 11 lines · Yang Wang

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
Quoted 5 lines

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.

I could see BOCO being an issue, but shouldn't BACO work? That should be self contained to the driver.

Alex

Quoted 26 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -1
index 8ebe24d59ab6..a4b4f9645c84 100644
@@ -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

#4 lore raw

AMD General

Quoted 24 lines

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

Quoted 11 lines · Yang Wang

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
Quoted 8 lines
Quoted 5 lines

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.

I could see BOCO being an issue, but shouldn't BACO work? That should be self contained to the driver.

We reproduced the failure on the affected ASM4242 USB4 eGPU topology. Before applying the workaround, the driver selected BACO:

amdgpu 0000:49:00.0: Using BACO for runtime pm
amdgpu 0000:49:00.0: Failed to exit BACO state!

The failure therefore occurs in the BACO runtime‑resume path, not in a validated BOCO or _PR3 path.

We do not have an actual test case to verify the BOCO case, but it should be disabled together for safety. Note that the final target state for BOCO is D3cold, while D3hot is an intermediate state.
It could also be problematic if the device cannot fully transition into D3cold, (though this is only my guess and not yet confirmed)

So, should we keep pursuing this issue, or limit our workaround scope to BAMXCO only?

Best Regards,
Kevin

Best Regards,
Kevin

Quoted 31 lines

Alex

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c void

Quoted 11 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 8ebe24d59ab6..a4b4f9645c84 100644
@@ -609,6 +609,13 @@ void

amdgpu_device_detect_runtime_pm_mode(struct amdgpu_device *adev)

Quoted 16 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -1
        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

#5 lore raw
Quoted 42 lines · Yang(Kevin)

AMD General

Quoted 24 lines

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

Quoted 11 lines · Yang Wang

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
Quoted 8 lines
Quoted 5 lines

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.

I could see BOCO being an issue, but shouldn't BACO work? That should be self contained to the driver.

We reproduced the failure on the affected ASM4242 USB4 eGPU topology. Before applying the workaround, the driver selected BACO:

amdgpu 0000:49:00.0: Using BACO for runtime pm
amdgpu 0000:49:00.0: Failed to exit BACO state!

Quoted 8 lines

The failure therefore occurs in the BACO runtime‑resume path, not in a validated BOCO or _PR3 path.

We do not have an actual test case to verify the BOCO case, but it should be disabled together for safety. Note that the final target state for BOCO is D3cold, while D3hot is an intermediate state.
It could also be problematic if the device cannot fully transition into D3cold, (though this is only my guess and not yet confirmed)

So, should we keep pursuing this issue, or limit our workaround scope to BAMXCO only?

This change is fine for now as it fixes the issue, but it would be nice to understand if there is a fundamental compatibility issue with BACO and USB4 in general.

Alex

Quoted 37 lines

Best Regards,
Kevin

Best Regards,
Kevin

Quoted 31 lines

Alex

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c void

Quoted 11 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 8ebe24d59ab6..a4b4f9645c84 100644
@@ -609,6 +609,13 @@ void

amdgpu_device_detect_runtime_pm_mode(struct amdgpu_device *adev)

Quoted 16 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -1
        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