Re: [PATCH] drm/amdgpu: restrict BAR0 fallback read to SR-IOV VFs only
Alex Deucher <[email protected]>
| Newsgroups | org.freedesktop.lists.amd-gfx,org.kernel.vger.stable |
|---|---|
| Message-ID | <CADnq5_NFjs_i_bgjKjsk1atzZ2VKvoyH9Lx8CagEzSkOxgfsqg@mail.gmail.com> |
On Wed, Aug 26, 2026 at 4:10 PM Mario Limonciello <[email protected]> wrote: > > The BAR0 fallback read path was introduced as a workaround for SR-IOV VFs > where the VRAM aperture is not available during early init. Restrict this > workaround to only SR-IOV VFs where it's needed. > > Cc: [email protected] > Reported-by: [email protected] > Fixes: ea8ac194077d ("drm/amdgpu: reduce early full GPU access during SR-IOV init") > Signed-off-by: Mario Limonciello <[email protected]> Acked-by: Alex Deucher <[email protected]> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index 3603f7109703c..251c4aea013fc 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -765,6 +765,9 @@ static int amdgpu_device_read_fb_via_bar0(struct amdgpu_device *adev, > if (!buf || !size) > return -EINVAL; > > + if (!amdgpu_sriov_vf(adev)) > + return -EINVAL; > + > flags = pci_resource_flags(adev->pdev, 0); > if ((flags & IORESOURCE_UNSET) || !(flags & IORESOURCE_MEM)) > return -EINVAL; > -- > 2.43.0 >