From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Bernatowicz, Marcin" <marcin.bernatowicz@linux.intel.com>
Cc: intel-xe@lists.freedesktop.org,
"Michał Wajdeczko" <michal.wajdeczko@intel.com>,
"Michał Winiarski" <michal.winiarski@intel.com>
Subject: Re: [PATCH] drm/xe/pf: Keep VF LMEM BAR size low if no VFs enabled
Date: Tue, 22 Sep 2026 18:39:33 -0400 [thread overview]
Message-ID: <arMDpVx4Hf5rJ_WZ@intel.com> (raw)
In-Reply-To: <fe338ca4-ab57-4adb-9bb5-d81c70467466@linux.intel.com>
On Mon, Sep 21, 2026 at 10:28:01AM +0200, Bernatowicz, Marcin wrote:
>
> On 9/18/2026 4:50 PM, Rodrigo Vivi wrote:
> > On Fri, Sep 18, 2026 at 01:01:30PM +0200, Marcin Bernatowicz wrote:
> > > When VFs are enabled on dGFX the driver resizes the PF VF_LMEM_BAR to
> > > fit the requested layout. After VFs are disabled the PF VF BAR
> > > size is left as-is. On platforms with tight MMIO apertures a
> > > subsequent unplug/rescan followed by another enable may fail with:
> > >
> > > "VF BAR …: can't assign; no space"
> > >
> > > because the PCI core reserves address space based on the (now large) VF
> > > template, often multiplied by totalvfs.
> > >
> > > Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/5937
> > > Fixes: 94eae6ee4c2d ("drm/xe/pf: Set VF LMEM BAR size")
> > > Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
> > > Cc: Michał Wajdeczko <michal.wajdeczko@intel.com>
> > > Cc: Michał Winiarski <michal.winiarski@intel.com>
> > > ---
> > > v4:
> > > - use directly pf_resize_vf_vram_bar helper with device_total_vfs value.
> > > v3:
> > > - rebased to resolve conflicts, no other functional changes were done
> > > v2:
> > > - Rename helper to restore_vf_vram_bar_size() (Michal)
> > > - Use xe->sriov.pf.device_total_vfs instead of pci_sriov_get_totalvfs(),
> > > which may be capped (Michal)
> > > - Switch logging to %pe (Michal)
> > > - Call restore unconditionally on enable-fail path (Michal)
> > > (drop vf_vram_bar_resized flag)
> > > ---
> > > ---
> > > drivers/gpu/drm/xe/xe_pci_sriov.c | 3 +++
> > > 1 file changed, 3 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/xe/xe_pci_sriov.c b/drivers/gpu/drm/xe/xe_pci_sriov.c
> > > index c023a2a1fc17..31abcee55211 100644
> > > --- a/drivers/gpu/drm/xe/xe_pci_sriov.c
> > > +++ b/drivers/gpu/drm/xe/xe_pci_sriov.c
> > > @@ -177,6 +177,7 @@ static int pf_enable_vfs(struct xe_device *xe, int num_vfs)
> > > return num_vfs;
> > > failed:
> > > + pf_resize_vf_vram_bar(xe, xe->sriov.pf.device_total_vfs);
> > should we resize before unprovisioning?
> > or it doesn't even matter at this point?!
>
> The BAR size is independent of Xe/GuC provisioning, so resizing before
> unprovisioning is safe. It only requires SR-IOV memory decoding to be
> disabled.
>
> >
> > > xe_sriov_pf_unprovision_vfs(xe, num_vfs);
> > > xe_pm_runtime_put(xe);
> > > pf_finish_vfs_enabling(xe);
> > > @@ -204,6 +205,8 @@ static int pf_disable_vfs(struct xe_device *xe)
> > > pci_disable_sriov(pdev);
> > > + pf_resize_vf_vram_bar(xe, xe->sriov.pf.device_total_vfs);
> > I just noticed that no users of this function handles the error.
> > Should we convert it to void? (I see it already prints some messages,
> > so not needed to duplicate anywhere)
> >
> > this is not a blocker and if the order above is okay:
> The helper’s return type is unrelated to this fix, so I prefer to keep its
> interface unchanged here; it can be converted to void separately.
fair enough. pushed to drm-xe-next. Thanks for the confirmations.
> >
> > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
> Thanks for the review.
>
> marcin
>
> > > +
> > > xe_sriov_pf_reprovision_default(xe);
> > > pf_reset_vfs(xe, num_vfs);
> > > --
> > > 2.43.0
> > >
next prev parent reply other threads:[~2026-09-22 22:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 11:01 [PATCH] drm/xe/pf: Keep VF LMEM BAR size low if no VFs enabled Marcin Bernatowicz
2026-09-18 11:10 ` ✓ CI.KUnit: success for drm/xe/pf: Keep VF LMEM BAR size low if no VFs enabled (rev4) Patchwork
2026-09-18 12:26 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-18 14:50 ` [PATCH] drm/xe/pf: Keep VF LMEM BAR size low if no VFs enabled Rodrigo Vivi
2026-09-21 8:28 ` Bernatowicz, Marcin
2026-09-22 22:39 ` Rodrigo Vivi [this message]
2026-09-18 20:30 ` ✓ Xe.CI.FULL: success for drm/xe/pf: Keep VF LMEM BAR size low if no VFs enabled (rev4) Patchwork
-- strict thread matches above, loose matches on Subject: below --
2026-09-02 12:47 [PATCH] drm/xe/pf: Keep VF LMEM BAR size low if no VFs enabled Marcin Bernatowicz
2026-09-09 11:03 ` Michał Winiarski
2025-09-22 8:57 Marcin Bernatowicz
2025-09-18 16:43 Marcin Bernatowicz
2025-09-18 18:24 ` Michal Wajdeczko
2025-09-19 16:22 ` Bernatowicz, Marcin
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=arMDpVx4Hf5rJ_WZ@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=marcin.bernatowicz@linux.intel.com \
--cc=michal.wajdeczko@intel.com \
--cc=michal.winiarski@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox