Skip to contentSkip to conversation

drm/amd: Don't initialize ISP hardware without FW

PATCH In review Mario Limonciello 3 participants 3 messages Jun 18, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd: Don't initialize ISP hardware without FW

Although designs may contain an ISP IP block, the camera might be a USB camera. Because of this the ISP firmware is considered optional from amdgpu. However if the firmware doesn't get loaded the hardware should not be initialized.

Adjust the return code for early init to ensure the IP block doesn't go through the other init and fini sequences. Also decrease the message about firmware load failure to debug so it's not as alarming to users.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c +2 -2
index 215bae809153..4766e99dd98f 100644
@@ -142,8 +142,8 @@ static int isp_early_init(void *handle)
 	isp->parent = adev->dev;
 
 	if (isp_load_fw_by_psp(adev)) {
-		DRM_WARN("%s: isp fw load failed\n", __func__);
-		return 0;
+		DRM_DEBUG_DRIVER("%s: isp fw load failed\n", __func__);
+		return -ENOENT;
 	}
 
 	return 0;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

LGTM, thank you.

-----Original Message-----
From: Limonciello, Mario <[email protected]>
Sent: Tuesday, June 18, 2024 12:43 PM
To: [email protected]
Cc: Nirujogi, Pratap <[email protected]>; Limonciello, Mario <[email protected]>
Subject: [PATCH] drm/amd: Don't initialize ISP hardware without FW

Although designs may contain an ISP IP block, the camera might be a USB camera. Because of this the ISP firmware is considered optional from amdgpu. However if the firmware doesn't get loaded the hardware should not be initialized.

Adjust the return code for early init to ensure the IP block doesn't go through the other init and fini sequences. Also decrease the message about firmware load failure to debug so it's not as alarming to users.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c +2 -2
index 215bae809153..4766e99dd98f 100644
@@ -142,8 +142,8 @@ static int isp_early_init(void *handle)
        isp->parent = adev->dev;
 
        if (isp_load_fw_by_psp(adev)) {
-               DRM_WARN("%s: isp fw load failed\n", __func__);
-               return 0;
+               DRM_DEBUG_DRIVER("%s: isp fw load failed\n", __func__);
+               return -ENOENT;
        }
 
        return 0;

--
2.34.1

Acked-by on v1 1/1
#2 lore raw
In reply to Mario Limonciello
Quoted 11 lines · Mario Limonciello

Although designs may contain an ISP IP block, the camera might be a USB camera. Because of this the ISP firmware is considered optional from amdgpu. However if the firmware doesn't get loaded the hardware should not be initialized.

Adjust the return code for early init to ensure the IP block doesn't go through the other init and fini sequences. Also decrease the message about firmware load failure to debug so it's not as alarming to users.

Quoted 22 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c +2 -3
index 215bae809153..4766e99dd98f 100644
@@ -142,8 +142,8 @@ static int isp_early_init(void *handle)
        isp->parent = adev->dev;
 
        if (isp_load_fw_by_psp(adev)) {
-               DRM_WARN("%s: isp fw load failed\n", __func__);
-               return 0;
+               DRM_DEBUG_DRIVER("%s: isp fw load failed\n", __func__);
+               return -ENOENT;
        }
 
        return 0;
--

2.34.1