* [PATCH 1/3] PCI/sysfs: Remove resource assignment after BAR resize
2026-11-09 13:10 [PATCH 0/3] PCI: remove redundant resource assignments done after BAR resize Ilpo Järvinen
@ 2026-11-09 13:10 ` Ilpo Järvinen
2026-11-09 13:10 ` [PATCH 2/3] drm/xe: Remove driver side " Ilpo Järvinen
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Ilpo Järvinen @ 2026-11-09 13:10 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci, linux-kernel, Matthew Brost,
Thomas Hellström, Rodrigo Vivi, David Airlie, Simona Vetter,
intel-xe, dri-devel, Jani Nikula, Joonas Lahtinen
Cc: Ilpo Järvinen
pci_resize_resource() assigns the resized BAR and the other BARs it
released, or restores the original configuration on failure. Calling
pci_assign_unassigned_bus_resources() after it is redundant. If that
call manages to assign more resources in some scenario, the problem
should be fixed inside pci_resize_resource() instead.
Remove the pci_assign_unassigned_bus_resources() call from
__resource_resize_store().
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/pci/pci-sysfs.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 6669e9ad5bd3..bccd0bd5091b 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -1731,7 +1731,6 @@ static ssize_t __resource_resize_store(struct device *dev, int n,
const char *buf, size_t count)
{
struct pci_dev *pdev = to_pci_dev(dev);
- struct pci_bus *bus = pdev->bus;
unsigned long size;
int ret;
u16 cmd;
@@ -1768,8 +1767,6 @@ static ssize_t __resource_resize_store(struct device *dev, int n,
pci_warn(pdev, "Failed to resize BAR %d: %pe\n",
n, ERR_PTR(ret));
- pci_assign_unassigned_bus_resources(bus);
-
if (sysfs_create_groups(&pdev->dev.kobj, pci_dev_resource_attr_groups))
pci_warn(pdev, "Failed to recreate resource groups after BAR resizing\n");
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 2/3] drm/xe: Remove driver side resource assignment after BAR resize
2026-11-09 13:10 [PATCH 0/3] PCI: remove redundant resource assignments done after BAR resize Ilpo Järvinen
2026-11-09 13:10 ` [PATCH 1/3] PCI/sysfs: Remove resource assignment " Ilpo Järvinen
@ 2026-11-09 13:10 ` Ilpo Järvinen
2026-11-09 15:00 ` Rodrigo Vivi
2026-11-09 13:10 ` [PATCH 3/3] drm/i915: " Ilpo Järvinen
2026-11-09 22:51 ` [PATCH 0/3] PCI: remove redundant resource assignments done " Bjorn Helgaas
3 siblings, 1 reply; 7+ messages in thread
From: Ilpo Järvinen @ 2026-11-09 13:10 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci, linux-kernel, Matthew Brost,
Thomas Hellström, Rodrigo Vivi, David Airlie, Simona Vetter,
intel-xe, dri-devel, Jani Nikula, Joonas Lahtinen
Cc: Ilpo Järvinen
pci_resize_resource() assigns the resized BAR and the other BARs it
released, or restores the original configuration on failure. Calling
pci_assign_unassigned_bus_resources() after it is redundant. If that
call manages to assign more resources in some scenario, the problem
should be fixed inside pci_resize_resource() instead.
Remove the pci_assign_unassigned_bus_resources() call from
xe_pci_rebar_resize().
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/gpu/drm/xe/xe_pci_rebar.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_pci_rebar.c b/drivers/gpu/drm/xe/xe_pci_rebar.c
index 7e2c7079b6ff..f47b3c039abd 100644
--- a/drivers/gpu/drm/xe/xe_pci_rebar.c
+++ b/drivers/gpu/drm/xe/xe_pci_rebar.c
@@ -100,7 +100,5 @@ void xe_pci_rebar_resize(struct xe_device *xe)
pci_write_config_dword(pdev, PCI_COMMAND, pci_cmd & ~PCI_COMMAND_MEMORY);
resize_bar(xe, LMEM_BAR, rebar_size);
-
- pci_assign_unassigned_bus_resources(pdev->bus);
pci_write_config_dword(pdev, PCI_COMMAND, pci_cmd);
}
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] drm/xe: Remove driver side resource assignment after BAR resize
2026-11-09 13:10 ` [PATCH 2/3] drm/xe: Remove driver side " Ilpo Järvinen
@ 2026-11-09 15:00 ` Rodrigo Vivi
0 siblings, 0 replies; 7+ messages in thread
From: Rodrigo Vivi @ 2026-11-09 15:00 UTC (permalink / raw)
To: Ilpo Järvinen
Cc: Bjorn Helgaas, linux-pci, linux-kernel, Matthew Brost,
Thomas Hellström, David Airlie, Simona Vetter, intel-xe,
dri-devel, Jani Nikula, Joonas Lahtinen
On Mon, Nov 09, 2026 at 03:10:09PM +0200, Ilpo Järvinen wrote:
> pci_resize_resource() assigns the resized BAR and the other BARs it
> released, or restores the original configuration on failure. Calling
> pci_assign_unassigned_bus_resources() after it is redundant. If that
> call manages to assign more resources in some scenario, the problem
> should be fixed inside pci_resize_resource() instead.
>
> Remove the pci_assign_unassigned_bus_resources() call from
> xe_pci_rebar_resize().
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
feel free to take it through your trees
> ---
> drivers/gpu/drm/xe/xe_pci_rebar.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_pci_rebar.c b/drivers/gpu/drm/xe/xe_pci_rebar.c
> index 7e2c7079b6ff..f47b3c039abd 100644
> --- a/drivers/gpu/drm/xe/xe_pci_rebar.c
> +++ b/drivers/gpu/drm/xe/xe_pci_rebar.c
> @@ -100,7 +100,5 @@ void xe_pci_rebar_resize(struct xe_device *xe)
> pci_write_config_dword(pdev, PCI_COMMAND, pci_cmd & ~PCI_COMMAND_MEMORY);
>
> resize_bar(xe, LMEM_BAR, rebar_size);
> -
> - pci_assign_unassigned_bus_resources(pdev->bus);
> pci_write_config_dword(pdev, PCI_COMMAND, pci_cmd);
> }
> --
> 2.47.3
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] drm/i915: Remove driver side resource assignment after BAR resize
2026-11-09 13:10 [PATCH 0/3] PCI: remove redundant resource assignments done after BAR resize Ilpo Järvinen
2026-11-09 13:10 ` [PATCH 1/3] PCI/sysfs: Remove resource assignment " Ilpo Järvinen
2026-11-09 13:10 ` [PATCH 2/3] drm/xe: Remove driver side " Ilpo Järvinen
@ 2026-11-09 13:10 ` Ilpo Järvinen
2026-11-09 13:50 ` Joonas Lahtinen
2026-11-09 22:51 ` [PATCH 0/3] PCI: remove redundant resource assignments done " Bjorn Helgaas
3 siblings, 1 reply; 7+ messages in thread
From: Ilpo Järvinen @ 2026-11-09 13:10 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci, linux-kernel, Matthew Brost,
Thomas Hellström, Rodrigo Vivi, David Airlie, Simona Vetter,
intel-xe, dri-devel, Jani Nikula, Joonas Lahtinen,
Tvrtko Ursulin, intel-gfx
Cc: Ilpo Järvinen
pci_resize_resource() assigns the resized BAR and the other BARs it
released, or restores the original configuration on failure. Calling
pci_assign_unassigned_bus_resources() after it is redundant. If that
call manages to assign more resources in some scenario, the problem
should be fixed inside pci_resize_resource() instead.
Remove the pci_assign_unassigned_bus_resources() call from
i915_resize_lmem_bar().
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/gpu/drm/i915/gt/intel_region_lmem.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/gt/intel_region_lmem.c b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
index b8a39567a334..d6f5e340657c 100644
--- a/drivers/gpu/drm/i915/gt/intel_region_lmem.c
+++ b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
@@ -104,7 +104,6 @@ static void i915_resize_lmem_bar(struct drm_i915_private *i915, resource_size_t
_resize_bar(i915, GEN12_LMEM_BAR, rebar_size);
- pci_assign_unassigned_bus_resources(pdev->bus);
pci_write_config_dword(pdev, PCI_COMMAND, pci_cmd);
intel_uncore_forcewake_put(&i915->uncore, FORCEWAKE_ALL);
}
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] drm/i915: Remove driver side resource assignment after BAR resize
2026-11-09 13:10 ` [PATCH 3/3] drm/i915: " Ilpo Järvinen
@ 2026-11-09 13:50 ` Joonas Lahtinen
0 siblings, 0 replies; 7+ messages in thread
From: Joonas Lahtinen @ 2026-11-09 13:50 UTC (permalink / raw)
To: Bjorn Helgaas, David Airlie, Ilpo Järvinen, Jani Nikula,
Matthew Brost, Rodrigo Vivi, Simona Vetter,
Thomas Hellström, Tvrtko Ursulin, dri-devel, intel-gfx,
intel-xe, linux-kernel, linux-pci
Cc: Ilpo Järvinen
Quoting Ilpo Järvinen (2026-11-09 15:10:10)
> pci_resize_resource() assigns the resized BAR and the other BARs it
> released, or restores the original configuration on failure. Calling
> pci_assign_unassigned_bus_resources() after it is redundant. If that
> call manages to assign more resources in some scenario, the problem
> should be fixed inside pci_resize_resource() instead.
>
> Remove the pci_assign_unassigned_bus_resources() call from
> i915_resize_lmem_bar().
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Feel free to apply on pci tree where the refactoring also landed.
Regards, Joonas
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] PCI: remove redundant resource assignments done after BAR resize
2026-11-09 13:10 [PATCH 0/3] PCI: remove redundant resource assignments done after BAR resize Ilpo Järvinen
` (2 preceding siblings ...)
2026-11-09 13:10 ` [PATCH 3/3] drm/i915: " Ilpo Järvinen
@ 2026-11-09 22:51 ` Bjorn Helgaas
3 siblings, 0 replies; 7+ messages in thread
From: Bjorn Helgaas @ 2026-11-09 22:51 UTC (permalink / raw)
To: Ilpo Järvinen
Cc: Bjorn Helgaas, linux-pci, linux-kernel, Matthew Brost,
Thomas Hellström, Rodrigo Vivi, David Airlie, Simona Vetter,
intel-xe, dri-devel, Jani Nikula, Joonas Lahtinen
On Mon, Nov 09, 2026 at 03:10:07PM +0200, Ilpo Järvinen wrote:
> The BAR resize rework removed the resource assignment call that
> followed the BAR resize in amdgpu. The xe and i915 drivers and the
> PCI sysfs resize interface still make the same call.
>
> The current BAR resize code should properly assign all resources and
> handle fallback gracefully so a driver-side call to assign resource
> right after BAR resize is just duplicate work (no-op). If that isn't
> the case somewhere, the fix belongs either the BAR resize code or the
> code that left the resource unassigned (e.g. a hotplug race or whatever
> left an resource unassigned prior to resize).
>
> If drm wants to take their patches out of these, it's fine with me
> (either drm+pci or through pci tree only works for me).
>
>
> Ilpo Järvinen (3):
> PCI/sysfs: Remove resource assignment after BAR resize
> drm/xe: Remove driver side resource assignment after BAR resize
> drm/i915: Remove driver side resource assignment after BAR resize
>
> drivers/gpu/drm/i915/gt/intel_region_lmem.c | 1 -
> drivers/gpu/drm/xe/xe_pci_rebar.c | 2 --
> drivers/pci/pci-sysfs.c | 3 ---
> 3 files changed, 6 deletions(-)
All applied to pci/resource for v7.5, thank you!
^ permalink raw reply [flat|nested] 7+ messages in thread