[PATCH] drm/amdgpu: Check if FB BAR is enabled for ROM read
Zhang, Hawking
Hawking.Zhang at amd.com
Mon Mar 8 13:17:14 UTC 2021
[AMD Public Use]
Reviewed-by: Hawking Zhang <Hawking.Zhang at amd.com>
Regards,
Hawking
From: Lazar, Lijo <Lijo.Lazar at amd.com>
Sent: Monday, March 8, 2021 21:16
To: Lazar, Lijo <Lijo.Lazar at amd.com>; amd-gfx at lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Xu, Feifei <Feifei.Xu at amd.com>; Zhang, Hawking <Hawking.Zhang at amd.com>
Subject: RE: [PATCH] drm/amdgpu: Check if FB BAR is enabled for ROM read
[AMD Public Use]
<Ping>
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org<mailto:amd-gfx-bounces at lists.freedesktop.org>> On Behalf Of Lazar, Lijo
Sent: Wednesday, March 3, 2021 10:15 AM
To: amd-gfx at lists.freedesktop.org<mailto:amd-gfx at lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher at amd.com<mailto:Alexander.Deucher at amd.com>>; Xu, Feifei <Feifei.Xu at amd.com<mailto:Feifei.Xu at amd.com>>; Zhang, Hawking <Hawking.Zhang at amd.com<mailto:Hawking.Zhang at amd.com>>
Subject: [PATCH] drm/amdgpu: Check if FB BAR is enabled for ROM read
[AMD Public Use]
Some configurations don't have FB BAR enabled. Avoid reading ROM image
from FB BAR region in such cases.
Signed-off-by: Lijo Lazar <lijo.lazar at amd.com<mailto:lijo.lazar at amd.com>>
Reviewed-by: Hawking Zhang <Hawking.Zhang at amd.com<mailto:Hawking.Zhang at amd.com>>
Reviewed-by: Feifei Xu <Feifei.Xu at amd.com<mailto:Feifei.Xu at amd.com>>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
index efdf639f6593..f454a6bd0ed6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
@@ -97,6 +97,10 @@ static bool igp_read_bios_from_vram(struct amdgpu_device *adev)
if (amdgpu_device_need_post(adev))
return false;
+ /* FB BAR not enabled */
+ if (pci_resource_len(adev->pdev, 0) == 0)
+ return false;
+
adev->bios = NULL;
vram_base = pci_resource_start(adev->pdev, 0);
bios = ioremap_wc(vram_base, size);
--
2.29.2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20210308/b676c020/attachment.htm>
More information about the amd-gfx
mailing list