drm/amdgpu: disable BAR resize on Dell G5 SE
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 17 Feb 2025 15:55:05 +0000 (10:55 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Feb 2025 16:44:00 +0000 (11:44 -0500)
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 caused a regression with runtime pm 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 unless runtime pm is disabled.

v2: update commit message, add runpm check

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1707
Fixes: 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index c8ceea01a2213d80fe5894734d29c0e3382e1157..7b60646c6ad27a09dacddbec7a18da4a436efc56 100644 (file)
@@ -1662,6 +1662,13 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
        if (amdgpu_sriov_vf(adev))
                return 0;
 
+       /* resizing on Dell G5 SE platforms causes problems with runtime pm */
+       if ((amdgpu_runtime_pm != 0) &&
+           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");