]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/imagination: Wait for FW trace update command completion
authorBrajesh Gupta <brajesh.gupta@imgtec.com>
Thu, 8 Jan 2026 04:09:36 +0000 (04:09 +0000)
committerMatt Coster <matt.coster@imgtec.com>
Mon, 19 Jan 2026 11:14:11 +0000 (11:14 +0000)
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")
Signed-off-by: Brajesh Gupta <brajesh.gupta@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Link: https://patch.msgid.link/20260108040936.129769-1-brajesh.gupta@imgtec.com
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
drivers/gpu/drm/imagination/pvr_fw_trace.c

index 8a56952f6730e8cb53313827bd4f67592bac6e1b..99d681413effb95cf172b82e3f05afea59a5eefa 100644 (file)
@@ -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: