]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu: add rebar parameter
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Feb 2025 17:31:28 +0000 (12:31 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Apr 2025 19:18:33 +0000 (15:18 -0400)
Add a new parameter to disable BAR resizing.  Note that this
only disables the driver from attempting to resize the BAR,
The BIOS may have resized the BAR at boot.

Some teams have found this useful in debugging P2P DMA
issues on systems where the available MMIO space did not allow
for all of the GPUs present to resize their BARs.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

index 9a9e5249c63f94ab69c24694fa832f24b0274a90..8316f93c1cce3bb01dd2ef3e0f65169151bd7ece 100644 (file)
@@ -266,6 +266,7 @@ extern int amdgpu_umsch_mm_fwlog;
 
 extern int amdgpu_user_partt_mode;
 extern int amdgpu_agp;
+extern int amdgpu_rebar;
 
 extern int amdgpu_wbrf;
 
index 7525128f971f47e425a1b6f177c307fa19506134..f4a01704effcf1d0405336563279f0cb9015f90d 100644 (file)
@@ -1680,6 +1680,9 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
        if (amdgpu_sriov_vf(adev))
                return 0;
 
+       if (!amdgpu_rebar)
+               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 &&
index 26bf896f1444eda3963eb5733fff1ef32664dccb..2ca04d6aaa82287b7eed7a1409ae90b2392a3793 100644 (file)
@@ -238,6 +238,7 @@ int amdgpu_agp = -1; /* auto */
 int amdgpu_wbrf = -1;
 int amdgpu_damage_clips = -1; /* auto */
 int amdgpu_umsch_mm_fwlog;
+int amdgpu_rebar = -1; /* auto */
 
 DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0,
                        "DRM_UT_CORE",
@@ -1096,6 +1097,16 @@ MODULE_PARM_DESC(wbrf,
        "Enable Wifi RFI interference mitigation (0 = disabled, 1 = enabled, -1 = auto(default)");
 module_param_named(wbrf, amdgpu_wbrf, int, 0444);
 
+/**
+ * DOC: rebar (int)
+ * Allow BAR resizing.  Disable this to prevent the driver from attempting
+ * to resize the BAR if the GPU supports it and there is available MMIO space.
+ * Note that this just prevents the driver from resizing the BAR.  The BIOS
+ * may have already resized the BAR at boot time.
+ */
+MODULE_PARM_DESC(rebar, "Resizable BAR (-1 = auto (default), 0 = disable, 1 = enable)");
+module_param_named(rebar, amdgpu_rebar, int, 0444);
+
 /* These devices are not supported by amdgpu.
  * They are supported by the mach64, r128, radeon drivers
  */