AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] PCI (& drm/amdgpu): BAR to be excluded depends on HW generation
@ 2025-11-14 10:30 Ilpo Järvinen
  2025-11-14 10:32 ` Christian König
  2025-11-14 18:20 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Ilpo Järvinen @ 2025-11-14 10:30 UTC (permalink / raw)
  To: Bjorn Helgaas, Christian König, linux-pci, Alex Deucher,
	David Airlie, Simona Vetter, amd-gfx, dri-devel, linux-kernel
  Cc: Ilpo Järvinen

Depending on HW generation, BAR that needs to be excluded from
pci_resize_resource() is either 2 or 5.

Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---

This change should be be folded into the commit 73cd7ee85e78 ("PCI: Fix
restoring BARs on BAR resize rollback path") in the pci/resource branch.

Also the changelog should be changed: "(BAR 5)" -> "(BAR 2 or 5)".

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 4e241836ae68..bf0bc38e1c47 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1736,7 +1736,9 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
 
 	pci_release_resource(adev->pdev, 0);
 
-	r = pci_resize_resource(adev->pdev, 0, rbar_size, 1 << 5);
+	r = pci_resize_resource(adev->pdev, 0, rbar_size,
+				(adev->asic_type >= CHIP_BONAIRE) ? 1 << 5
+								  : 1 << 2);
 	if (r == -ENOSPC)
 		dev_info(adev->dev,
 			 "Not enough PCI address space for a large BAR.");

base-commit: 73cd7ee85e788bc2541bfce2500e3587cf79f081
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] PCI (& drm/amdgpu): BAR to be excluded depends on HW generation
  2025-11-14 10:30 [PATCH 1/1] PCI (& drm/amdgpu): BAR to be excluded depends on HW generation Ilpo Järvinen
@ 2025-11-14 10:32 ` Christian König
  2025-11-14 18:20 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Christian König @ 2025-11-14 10:32 UTC (permalink / raw)
  To: Ilpo Järvinen, Bjorn Helgaas, linux-pci, Alex Deucher,
	David Airlie, Simona Vetter, amd-gfx, dri-devel, linux-kernel

On 11/14/25 11:30, Ilpo Järvinen wrote:
> Depending on HW generation, BAR that needs to be excluded from
> pci_resize_resource() is either 2 or 5.
> 
> Suggested-by: Christian König <christian.koenig@amd.com>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

If necessary feel free to add Acked-by: Christian König <christian.koenig@amd.com> to the amdgpu patch in this set as well.

Regards,
Christian.

> ---
> 
> This change should be be folded into the commit 73cd7ee85e78 ("PCI: Fix
> restoring BARs on BAR resize rollback path") in the pci/resource branch.
> 
> Also the changelog should be changed: "(BAR 5)" -> "(BAR 2 or 5)".
> 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 4e241836ae68..bf0bc38e1c47 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1736,7 +1736,9 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
>  
>  	pci_release_resource(adev->pdev, 0);
>  
> -	r = pci_resize_resource(adev->pdev, 0, rbar_size, 1 << 5);
> +	r = pci_resize_resource(adev->pdev, 0, rbar_size,
> +				(adev->asic_type >= CHIP_BONAIRE) ? 1 << 5
> +								  : 1 << 2);
>  	if (r == -ENOSPC)
>  		dev_info(adev->dev,
>  			 "Not enough PCI address space for a large BAR.");
> 
> base-commit: 73cd7ee85e788bc2541bfce2500e3587cf79f081


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] PCI (& drm/amdgpu): BAR to be excluded depends on HW generation
  2025-11-14 10:30 [PATCH 1/1] PCI (& drm/amdgpu): BAR to be excluded depends on HW generation Ilpo Järvinen
  2025-11-14 10:32 ` Christian König
@ 2025-11-14 18:20 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2025-11-14 18:20 UTC (permalink / raw)
  To: Ilpo Järvinen
  Cc: Bjorn Helgaas, Christian König, linux-pci, Alex Deucher,
	David Airlie, Simona Vetter, amd-gfx, dri-devel, linux-kernel

On Fri, Nov 14, 2025 at 12:30:53PM +0200, Ilpo Järvinen wrote:
> Depending on HW generation, BAR that needs to be excluded from
> pci_resize_resource() is either 2 or 5.
> 
> Suggested-by: Christian König <christian.koenig@amd.com>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> ---
> 
> This change should be be folded into the commit 73cd7ee85e78 ("PCI: Fix
> restoring BARs on BAR resize rollback path") in the pci/resource branch.
> 
> Also the changelog should be changed: "(BAR 5)" -> "(BAR 2 or 5)".
> 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Squashed into 73cd7ee85e78, thanks:

  https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/commit/?id=40a8789930e2

> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 4e241836ae68..bf0bc38e1c47 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1736,7 +1736,9 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
>  
>  	pci_release_resource(adev->pdev, 0);
>  
> -	r = pci_resize_resource(adev->pdev, 0, rbar_size, 1 << 5);
> +	r = pci_resize_resource(adev->pdev, 0, rbar_size,
> +				(adev->asic_type >= CHIP_BONAIRE) ? 1 << 5
> +								  : 1 << 2);
>  	if (r == -ENOSPC)
>  		dev_info(adev->dev,
>  			 "Not enough PCI address space for a large BAR.");
> 
> base-commit: 73cd7ee85e788bc2541bfce2500e3587cf79f081
> -- 
> 2.39.5
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-14 18:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-14 10:30 [PATCH 1/1] PCI (& drm/amdgpu): BAR to be excluded depends on HW generation Ilpo Järvinen
2025-11-14 10:32 ` Christian König
2025-11-14 18:20 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox