From: Bjorn Helgaas <helgaas@kernel.org>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"Simon Richter" <Simon.Richter@hogyros.de>,
"Lucas De Marchi" <lucas.demarchi@intel.com>,
amd-gfx@lists.freedesktop.org,
"Bjorn Helgaas" <bhelgaas@google.com>,
"David Airlie" <airlied@gmail.com>,
dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
intel-xe@lists.freedesktop.org,
"Jani Nikula" <jani.nikula@linux.intel.com>,
"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
linux-pci@vger.kernel.org,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Tvrtko Ursulin" <tursulin@ursulin.net>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Michał Winiarski" <michal.winiarski@intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 8/9] drm/amdgpu: Remove driver side BAR release before resize
Date: Mon, 10 Nov 2025 16:54:55 -0600 [thread overview]
Message-ID: <20251110225455.GA2141964@bhelgaas> (raw)
In-Reply-To: <20251028173551.22578-9-ilpo.jarvinen@linux.intel.com>
amdgpu folks, any objection to this?
On Tue, Oct 28, 2025 at 07:35:50PM +0200, Ilpo Järvinen wrote:
> PCI core handles releasing device's resources and their rollback in
> case of failure of a BAR resizing operation. Releasing resource prior
> to calling pci_resize_resource() prevents PCI core from restoring the
> BARs as they were.
>
> Remove driver-side release of BARs from the amdgpu driver.
>
> Also remove the driver initiated assignment as pci_resize_resource()
> should try to assign as much as possible. If the driver side call
> manages to get more required resources assigned in some scenario, such
> a problem should be fixed inside pci_resize_resource() instead.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 7a899fb4de29..65474d365229 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1729,12 +1729,8 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
> pci_write_config_word(adev->pdev, PCI_COMMAND,
> cmd & ~PCI_COMMAND_MEMORY);
>
> - /* Free the VRAM and doorbell BAR, we most likely need to move both. */
> + /* Tear down doorbell as resizing will release BARs */
> amdgpu_doorbell_fini(adev);
> - if (adev->asic_type >= CHIP_BONAIRE)
> - pci_release_resource(adev->pdev, 2);
> -
> - pci_release_resource(adev->pdev, 0);
>
> r = pci_resize_resource(adev->pdev, 0, rbar_size);
> if (r == -ENOSPC)
> @@ -1743,8 +1739,6 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
> else if (r && r != -ENOTSUPP)
> dev_err(adev->dev, "Problem resizing BAR0 (%d).", r);
>
> - pci_assign_unassigned_bus_resources(adev->pdev->bus);
> -
> /* When the doorbell or fb BAR isn't available we have no chance of
> * using the device.
> */
> --
> 2.39.5
>
next prev parent reply other threads:[~2025-11-10 22:54 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 17:35 [PATCH 0/9] PCI: BAR resizing fix/rework Ilpo Järvinen
2025-10-28 17:35 ` [PATCH 1/9] PCI: Prevent resource tree corruption when BAR resize fails Ilpo Järvinen
2025-10-29 23:36 ` Bjorn Helgaas
2025-10-30 8:22 ` Ilpo Järvinen
2025-11-10 22:59 ` Bjorn Helgaas
2025-10-28 17:35 ` [PATCH 2/9] PCI/IOV: Adjust ->barsz[] when changing BAR size Ilpo Järvinen
2025-11-13 16:29 ` Bjorn Helgaas
2025-11-13 16:35 ` Ilpo Järvinen
2025-11-13 16:57 ` Bjorn Helgaas
2025-11-13 21:02 ` Bjorn Helgaas
2025-10-28 17:35 ` [PATCH 3/9] PCI: Change pci_dev variable from 'bridge' to 'dev' Ilpo Järvinen
2025-10-28 17:35 ` [PATCH 4/9] PCI: Try BAR resize even when no window was released Ilpo Järvinen
2025-10-28 17:35 ` [PATCH 5/9] PCI: Fix restoring BARs on BAR resize rollback path Ilpo Järvinen
2025-10-28 17:35 ` [PATCH 6/9] drm/xe: Remove driver side BAR release before resize Ilpo Järvinen
2025-10-28 21:24 ` Lucas De Marchi
2025-10-30 14:37 ` Lucas De Marchi
2025-10-28 17:35 ` [PATCH 7/9] drm/i915: " Ilpo Järvinen
2025-11-10 22:53 ` Bjorn Helgaas
2025-10-28 17:35 ` [PATCH 8/9] drm/amdgpu: " Ilpo Järvinen
2025-11-10 22:54 ` Bjorn Helgaas [this message]
2025-11-11 9:08 ` Christian König
2025-11-11 11:08 ` Ilpo Järvinen
2025-11-11 12:08 ` Christian König
2025-11-11 12:56 ` Ilpo Järvinen
2025-11-11 15:07 ` Christian König
2025-11-11 15:52 ` Ilpo Järvinen
2025-11-11 23:30 ` Liu, Monk
2025-10-28 17:35 ` [PATCH 9/9] PCI: Prevent restoring assigned resources Ilpo Järvinen
2025-10-28 17:46 ` ✗ Fi.CI.BUILD: failure for PCI: BAR resizing fix/rework Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251110225455.GA2141964@bhelgaas \
--to=helgaas@kernel.org \
--cc=Simon.Richter@hogyros.de \
--cc=airlied@gmail.com \
--cc=alex.bennee@linaro.org \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=bhelgaas@google.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lucas.demarchi@intel.com \
--cc=michal.winiarski@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
--cc=thomas.hellstrom@linux.intel.com \
--cc=tursulin@ursulin.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.