Skip to contentSkip to conversation

drm/amdgpu: disable BAR resize on Dell G5 SE

PATCH In review Alex Deucher 3 participants 6 messages Feb 18, 2025 – Feb 19, 2025

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu: disable BAR resize on Dell G5 SE

There was a quirk added to add a workaround for a Sapphire RX 5600 XT Pulse that didn't allow BAR resizing. However, the quirk casused a regression on Dell laptops using those chips, rather than narrowing the scope of the resizing quirk, add a quirk to prevent amdgpu from resizing the BAR on those Dell platforms.

Fixes 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -0
index 512e642477a7e..56fd874a22de8 100644
@@ -1662,6 +1662,12 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
 	if (amdgpu_sriov_vf(adev))
 		return 0;
 
+	/* skip resizing on Dell G5 SE platforms */
+	if (adev->pdev->vendor == PCI_VENDOR_ID_ATI &&
+	    adev->pdev->device == 0x731f &&
+	    adev->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL)
+		return 0;
+
 	/* PCI_EXT_CAP_ID_VNDR extended capability is located at 0x100 */
 	if (!pci_find_ext_capability(adev->pdev, PCI_EXT_CAP_ID_VNDR))
 		DRM_WARN("System can't access extended configuration space, please check!!\n");
Signature · 1 line
2.48.1
#1 lore raw
Quoted 10 lines · Alex Deucher

There was a quirk added to add a workaround for a Sapphire RX 5600 XT Pulse that didn't allow BAR resizing. However, the quirk casused a regression on Dell laptops using those chips, rather than narrowing the scope of the resizing quirk, add a quirk to prevent amdgpu from resizing the BAR on those Dell platforms.

Fixes 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")

As per the issue thread, issue happens when dGPU resumes from runpm. If so, can't we disable runpm as the workaround (IMO, the current patch also is a workaround)?

Thanks,
Lijo

Quoted 21 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -0
index 512e642477a7e..56fd874a22de8 100644
@@ -1662,6 +1662,12 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
 	if (amdgpu_sriov_vf(adev))
 		return 0;
 
+	/* skip resizing on Dell G5 SE platforms */
+	if (adev->pdev->vendor == PCI_VENDOR_ID_ATI &&
+	    adev->pdev->device == 0x731f &&
+	    adev->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL)
+		return 0;
+
 	/* PCI_EXT_CAP_ID_VNDR extended capability is located at 0x100 */
 	if (!pci_find_ext_capability(adev->pdev, PCI_EXT_CAP_ID_VNDR))
 		DRM_WARN("System can't access extended configuration space, please check!!\n");
#2 lore raw
Quoted 11 lines · Lijo
Quoted 7 lines · Alex Deucher

There was a quirk added to add a workaround for a Sapphire RX 5600 XT Pulse that didn't allow BAR resizing. However, the quirk casused a regression on Dell laptops using those chips, rather than narrowing the scope of the resizing quirk, add a quirk to prevent amdgpu from resizing the BAR on those Dell platforms.

Quoted 7 lines
Quoted 3 lines
Fixes 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")

As per the issue thread, issue happens when dGPU resumes from runpm. If so, can't we disable runpm as the workaround (IMO, the current patch also is a workaround)?

This seems like a better workaround than disabling runtime pm. Leaving the dGPU powered up all the time seems worse than limiting the BAR size on this platform.

Alex

Quoted 26 lines

Thanks,
Lijo

Quoted 21 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -0
index 512e642477a7e..56fd874a22de8 100644
@@ -1662,6 +1662,12 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
      if (amdgpu_sriov_vf(adev))
              return 0;
 
+     /* skip resizing on Dell G5 SE platforms */
+     if (adev->pdev->vendor == PCI_VENDOR_ID_ATI &&
+         adev->pdev->device == 0x731f &&
+         adev->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL)
+             return 0;
+
      /* PCI_EXT_CAP_ID_VNDR extended capability is located at 0x100 */
      if (!pci_find_ext_capability(adev->pdev, PCI_EXT_CAP_ID_VNDR))
              DRM_WARN("System can't access extended configuration space, please check!!\n");
#3 lore raw
Quoted 16 lines · Alex Deucher
Quoted 15 lines · Lijo
Quoted 10 lines · Alex Deucher

There was a quirk added to add a workaround for a Sapphire RX 5600 XT Pulse that didn't allow BAR resizing. However, the quirk casused a regression on Dell laptops using those chips, rather than narrowing the scope of the resizing quirk, add a quirk to prevent amdgpu from resizing the BAR on those Dell platforms.

Fixes 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")
Quoted 8 lines
Quoted 3 lines

As per the issue thread, issue happens when dGPU resumes from runpm. If so, can't we disable runpm as the workaround (IMO, the current patch also is a workaround)?

This seems like a better workaround than disabling runtime pm. Leaving the dGPU powered up all the time seems worse than limiting the BAR size on this platform.

Probably, it's better to note down that as well in the description. Also, check if the device has runpm enabled. If a user prefers performance, say runpm disabled through driver option, then no need to apply this.

Thanks,
Lijo

Quoted 28 lines

Alex

Quoted 26 lines

Thanks,
Lijo

Quoted 21 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -0
index 512e642477a7e..56fd874a22de8 100644
@@ -1662,6 +1662,12 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
      if (amdgpu_sriov_vf(adev))
              return 0;
 
+     /* skip resizing on Dell G5 SE platforms */
+     if (adev->pdev->vendor == PCI_VENDOR_ID_ATI &&
+         adev->pdev->device == 0x731f &&
+         adev->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL)
+             return 0;
+
      /* PCI_EXT_CAP_ID_VNDR extended capability is located at 0x100 */
      if (!pci_find_ext_capability(adev->pdev, PCI_EXT_CAP_ID_VNDR))
              DRM_WARN("System can't access extended configuration space, please check!!\n");
#4 lore raw
Quoted 29 lines · Lijo
Quoted 16 lines · Alex Deucher
Quoted 15 lines · Lijo
Quoted 10 lines · Alex Deucher

There was a quirk added to add a workaround for a Sapphire RX 5600 XT Pulse that didn't allow BAR resizing. However, the quirk casused a regression on Dell laptops using those chips, rather than narrowing the scope of the resizing quirk, add a quirk to prevent amdgpu from resizing the BAR on those Dell platforms.

Fixes 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")
Quoted 8 lines
Quoted 3 lines

As per the issue thread, issue happens when dGPU resumes from runpm. If so, can't we disable runpm as the workaround (IMO, the current patch also is a workaround)?

This seems like a better workaround than disabling runtime pm. Leaving the dGPU powered up all the time seems worse than limiting the BAR size on this platform.

Quoted 4 lines

Probably, it's better to note down that as well in the description. Also, check if the device has runpm enabled. If a user prefers performance, say runpm disabled through driver option, then no need to apply this.

I can update the commit message, but the runtime pm method gets set much later in the init sequence so we don't know what it is or if it is enabled when we resize the BAR.

Alex

Quoted 33 lines

Thanks,
Lijo

Quoted 28 lines

Alex

Quoted 26 lines

Thanks,
Lijo

Quoted 21 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -0
index 512e642477a7e..56fd874a22de8 100644
@@ -1662,6 +1662,12 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
      if (amdgpu_sriov_vf(adev))
              return 0;
 
+     /* skip resizing on Dell G5 SE platforms */
+     if (adev->pdev->vendor == PCI_VENDOR_ID_ATI &&
+         adev->pdev->device == 0x731f &&
+         adev->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL)
+             return 0;
+
      /* PCI_EXT_CAP_ID_VNDR extended capability is located at 0x100 */
      if (!pci_find_ext_capability(adev->pdev, PCI_EXT_CAP_ID_VNDR))
              DRM_WARN("System can't access extended configuration space, please check!!\n");
#5 lore raw

[Public]

Should we just check the amdgpu runpm param value?

Thanks,
Lijo
________________________________
From: Alex Deucher <[email protected]>
Sent: Wednesday, February 19, 2025 9:45:28 PM
To: Lazar, Lijo <[email protected]>
Cc: Deucher, Alexander <[email protected]>; [email protected] <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: disable BAR resize on Dell G5 SE

Quoted 29 lines · Lijo
Quoted 16 lines · Alex Deucher
Quoted 15 lines · Lijo
Quoted 10 lines · Alex Deucher

There was a quirk added to add a workaround for a Sapphire RX 5600 XT Pulse that didn't allow BAR resizing. However, the quirk casused a regression on Dell laptops using those chips, rather than narrowing the scope of the resizing quirk, add a quirk to prevent amdgpu from resizing the BAR on those Dell platforms.

Fixes 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")
Quoted 8 lines
Quoted 3 lines

As per the issue thread, issue happens when dGPU resumes from runpm. If so, can't we disable runpm as the workaround (IMO, the current patch also is a workaround)?

This seems like a better workaround than disabling runtime pm. Leaving the dGPU powered up all the time seems worse than limiting the BAR size on this platform.

Quoted 4 lines

Probably, it's better to note down that as well in the description. Also, check if the device has runpm enabled. If a user prefers performance, say runpm disabled through driver option, then no need to apply this.

I can update the commit message, but the runtime pm method gets set much later in the init sequence so we don't know what it is or if it is enabled when we resize the BAR.

Alex

Quoted 33 lines

Thanks,
Lijo

Quoted 28 lines

Alex

Quoted 26 lines

Thanks,
Lijo

Quoted 21 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -0
index 512e642477a7e..56fd874a22de8 100644
@@ -1662,6 +1662,12 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
      if (amdgpu_sriov_vf(adev))
              return 0;
 
+     /* skip resizing on Dell G5 SE platforms */
+     if (adev->pdev->vendor == PCI_VENDOR_ID_ATI &&
+         adev->pdev->device == 0x731f &&
+         adev->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL)
+             return 0;
+
      /* PCI_EXT_CAP_ID_VNDR extended capability is located at 0x100 */
      if (!pci_find_ext_capability(adev->pdev, PCI_EXT_CAP_ID_VNDR))
              DRM_WARN("System can't access extended configuration space, please check!!\n");