[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 <[email protected]<mailto:[email protected]>>
Reviewed-by: Hawking Zhang <[email protected]<mailto:[email protected]>>
Reviewed-by: Feifei Xu <[email protected]<mailto:[email protected]>>
---
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
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to