Skip to contentSkip to conversation

drm/imagination: Wait for FW trace update command completion

PATCH Applied Brajesh Gupta 2 participants 3 messages Jan 8 – Jan 19

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

PATCH 1/1 drm/imagination: Wait for FW trace update command completion

Possibility of no FW trace available after update in the fw_trace_mask due to asynchronous mode of command consumption in the FW.

To ensure FW trace is available after update, wait for FW trace log update command completion from the FW.

Fixes cc1aeedb98ad ("drm/imagination: Implement firmware infrastructure and META FW support")
---
 drivers/gpu/drm/imagination/pvr_fw_trace.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/imagination/pvr_fw_trace.c +7 -1
index 8a56952f6730..99d681413eff 100644
@@ -137,6 +137,7 @@ update_logtype(struct pvr_device *pvr_dev, u32 group_mask)
 	struct rogue_fwif_kccb_cmd cmd;
 	int idx;
 	int err;
+	int slot;
 
 	if (group_mask)
 		fw_trace->tracebuf_ctrl->log_type = ROGUE_FWIF_LOG_TYPE_TRACE | group_mask;
@@ -154,8 +155,13 @@ update_logtype(struct pvr_device *pvr_dev, u32 group_mask)
 	cmd.cmd_type = ROGUE_FWIF_KCCB_CMD_LOGTYPE_UPDATE;
 	cmd.kccb_flags = 0;
 
-	err = pvr_kccb_send_cmd(pvr_dev, &cmd, NULL);
+	err = pvr_kccb_send_cmd(pvr_dev, &cmd, &slot);
+	if (err)
+		goto err_drm_dev_exit;
+
+	err = pvr_kccb_wait_for_completion(pvr_dev, slot, HZ, NULL);
 
+err_drm_dev_exit:
 	drm_dev_exit(idx);
 
 err_up_read:
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Brajesh Gupta

Possibility of no FW trace available after update in the fw_trace_mask due to asynchronous mode of command consumption in the FW.

To ensure FW trace is available after update, wait for FW trace log update command completion from the FW.

Fixes cc1aeedb98ad ("drm/imagination: Implement firmware infrastructure and META FW support")

I'll apply this to drm-misc-fixes later today if there are no objections.

Cheers,
Matt

Quoted 34 lines
---
 drivers/gpu/drm/imagination/pvr_fw_trace.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/imagination/pvr_fw_trace.c +7 -2
index 8a56952f6730..99d681413eff 100644
@@ -137,6 +137,7 @@ update_logtype(struct pvr_device *pvr_dev, u32 group_mask)
        struct rogue_fwif_kccb_cmd cmd;
        int idx;
        int err;
+       int slot;
 
        if (group_mask)
                fw_trace->tracebuf_ctrl->log_type = ROGUE_FWIF_LOG_TYPE_TRACE | group_mask;
@@ -154,8 +155,13 @@ update_logtype(struct pvr_device *pvr_dev, u32 group_mask)
        cmd.cmd_type = ROGUE_FWIF_KCCB_CMD_LOGTYPE_UPDATE;
        cmd.kccb_flags = 0;
 
-       err = pvr_kccb_send_cmd(pvr_dev, &cmd, NULL);
+       err = pvr_kccb_send_cmd(pvr_dev, &cmd, &slot);
+       if (err)
+               goto err_drm_dev_exit;
+
+       err = pvr_kccb_wait_for_completion(pvr_dev, slot, HZ, NULL);
 
+err_drm_dev_exit:
        drm_dev_exit(idx);
 
 err_up_read:
--

2.43.0

Signature · 2 lines
Matt Coster
E: [email protected]
Applied
#2 lore raw
In reply to Brajesh Gupta
Quoted 8 lines · Brajesh Gupta

Possibility of no FW trace available after update in the fw_trace_mask due to asynchronous mode of command consumption in the FW.

To ensure FW trace is available after update, wait for FW trace log update command completion from the FW.

[...]

Applied, thanks!

[1/1] drm/imagination: Wait for FW trace update command completion

      commit: 812062e74a3945b575dce89d330b67cb50054a77

Best regards,

Signature · 1 line
Matt Coster <[email protected]>