* [PATCH] drm/amdgpu: add rebar parameter
@ 2025-02-28 20:28 Alex Deucher
2025-03-24 19:57 ` Alex Deucher
0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2025-02-28 20:28 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
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.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 11 +++++++++++
3 files changed, 15 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 87062c1adcdf7..948f832f469ef 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -268,6 +268,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;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 0a1a1f3ee5fc0..cc1a991ad4719 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1662,6 +1662,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 &&
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index b161daa900198..333c78ac000e9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -237,6 +237,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",
@@ -1083,6 +1084,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
*/
--
2.48.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amdgpu: add rebar parameter
2025-02-28 20:28 [PATCH] drm/amdgpu: add rebar parameter Alex Deucher
@ 2025-03-24 19:57 ` Alex Deucher
2025-03-25 1:51 ` Mario Limonciello
0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2025-03-24 19:57 UTC (permalink / raw)
To: Alex Deucher; +Cc: amd-gfx
Ping?
On Fri, Feb 28, 2025 at 3:39 PM Alex Deucher <alexander.deucher@amd.com> wrote:
>
> 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.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 +
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 11 +++++++++++
> 3 files changed, 15 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 87062c1adcdf7..948f832f469ef 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -268,6 +268,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;
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 0a1a1f3ee5fc0..cc1a991ad4719 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1662,6 +1662,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 &&
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index b161daa900198..333c78ac000e9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -237,6 +237,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",
> @@ -1083,6 +1084,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
> */
> --
> 2.48.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amdgpu: add rebar parameter
2025-03-24 19:57 ` Alex Deucher
@ 2025-03-25 1:51 ` Mario Limonciello
0 siblings, 0 replies; 3+ messages in thread
From: Mario Limonciello @ 2025-03-25 1:51 UTC (permalink / raw)
To: Alex Deucher, Alex Deucher; +Cc: amd-gfx
On 3/24/2025 14:57, Alex Deucher wrote:
> Ping?
>
> On Fri, Feb 28, 2025 at 3:39 PM Alex Deucher <alexander.deucher@amd.com> wrote:
>>
>> 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.
>>
>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 +
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++
>> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 11 +++++++++++
>> 3 files changed, 15 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> index 87062c1adcdf7..948f832f469ef 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> @@ -268,6 +268,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;
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> index 0a1a1f3ee5fc0..cc1a991ad4719 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> @@ -1662,6 +1662,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 &&
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> index b161daa900198..333c78ac000e9 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> @@ -237,6 +237,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",
>> @@ -1083,6 +1084,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
>> */
>> --
>> 2.48.1
>>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-25 1:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-28 20:28 [PATCH] drm/amdgpu: add rebar parameter Alex Deucher
2025-03-24 19:57 ` Alex Deucher
2025-03-25 1:51 ` Mario Limonciello
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox