From: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
To: Dipayaan Roy <dipayaan.roy@oss.qualcomm.com>,
linux-media@vger.kernel.org
Cc: vikash.garodia@oss.qualcomm.com,
dikshita.agarwal@oss.qualcomm.com, abhinav.kumar@linux.dev,
bod@kernel.org, mchehab@kernel.org, p.zabel@pengutronix.de,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] media: qcom: iris: add error and status details to diagnostics
Date: Mon, 9 Nov 2026 12:55:18 +0530 [thread overview]
Message-ID: <1ceec27d-c7b2-91ae-1cce-82e403289ef1@oss.qualcomm.com> (raw)
In-Reply-To: <20261106153126.120858-3-dipayaan.roy@oss.qualcomm.com>
On 11/6/2026 9:01 PM, Dipayaan Roy wrote:
> Several Iris error messages identify a failed operation without showing
> the return code or state that caused it, making failures difficult to
> diagnose.
>
> Include available return codes, hardware status, queue positions, and
> packet or session identifiers in these messages. Also report the header
> details when an HFI response fails validation.
>
> Error handling remains unchanged.
>
> Signed-off-by: Dipayaan Roy <dipayaan.roy@oss.qualcomm.com>
> ---
> drivers/media/platform/qcom/iris/iris_hfi_common.c | 4 ++--
> .../platform/qcom/iris/iris_hfi_gen1_response.c | 9 ++++++---
> .../platform/qcom/iris/iris_hfi_gen2_response.c | 5 ++++-
> drivers/media/platform/qcom/iris/iris_hfi_queue.c | 14 +++++++++----
> drivers/media/platform/qcom/iris/iris_vb2.c | 2 +-
> drivers/media/platform/qcom/iris/iris_vdec.c | 3 ++-
> drivers/media/platform/qcom/iris/iris_venc.c | 3 ++-
> drivers/media/platform/qcom/iris/iris_vidc.c | 2 +-
> drivers/media/platform/qcom/iris/iris_vpu3x.c | 23 +++++++++++-----------
> drivers/media/platform/qcom/iris/iris_vpu4x.c | 6 ++++--
> drivers/media/platform/qcom/iris/iris_vpu_common.c | 15 ++++++++------
> 11 files changed, 53 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_common.c b/drivers/media/platform/qcom/iris/iris_hfi_common.c
> index dad906d03fdc..1fd4cecd7956 100644
> --- a/drivers/media/platform/qcom/iris/iris_hfi_common.c
> +++ b/drivers/media/platform/qcom/iris/iris_hfi_common.c
> @@ -138,7 +138,7 @@ int iris_hfi_pm_suspend(struct iris_core *core)
> return 0;
>
> error:
> - dev_err(core->dev, "failed to suspend\n");
> + dev_err(core->dev, "failed to suspend: %d\n", ret);
>
> return ret;
> }
> @@ -179,7 +179,7 @@ int iris_hfi_pm_resume(struct iris_core *core)
> err_power_off:
> iris_vpu_power_off(core);
> error:
> - dev_err(core->dev, "failed to resume\n");
> + dev_err(core->dev, "failed to resume: %d\n", ret);
>
> return -EBUSY;
> }
> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c
> index ffa98139f0eb..1ce7f97d4087 100644
> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c
> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c
> @@ -301,7 +301,8 @@ iris_hfi_gen1_sys_get_prop_image_version(struct iris_core *core,
> u32 i;
>
> if (req_bytes < IRIS_FW_VERSION_LENGTH - 1 || !pkt->data[0] || pkt->num_properties > 1) {
> - dev_err(core->dev, "bad packet\n");
> + dev_err(core->dev, "invalid firmware version packet (size %u, properties %u)\n",
> + pkt->hdr.size, pkt->num_properties);
> return;
> }
>
> @@ -382,7 +383,8 @@ static void iris_hfi_gen1_session_etb_done(struct iris_inst *inst, void *packet)
>
> error:
> iris_inst_change_state(inst, IRIS_INST_ERROR);
> - dev_err(inst->core->dev, "error in etb done\n");
> + dev_err(inst->core->dev, "ETB done without input buffer (session %#x, tag %u)\n",
> + inst->session_id, pkt->input_tag);
> }
>
> static void iris_hfi_gen1_session_ftb_done(struct iris_inst *inst, void *packet)
> @@ -530,7 +532,8 @@ static void iris_hfi_gen1_session_ftb_done(struct iris_inst *inst, void *packet)
>
> error:
> iris_inst_change_state(inst, IRIS_INST_ERROR);
> - dev_err(core->dev, "error in ftb done\n");
> + dev_err(core->dev, "FTB done without output buffer (session %#x, tag %u, offset %u)\n",
> + inst->session_id, output_tag, offset);
> }
>
> static enum iris_buffer_type iris_hfi_gen1_buf_type(struct iris_inst *inst, u32 type)
> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
> index f0782c4b1e6e..b82f50458fe1 100644
> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
> @@ -980,8 +980,11 @@ static int iris_hfi_gen2_handle_response(struct iris_core *core, void *response)
> int ret;
>
> ret = iris_hfi_gen2_validate_hdr_packet(core, hdr);
> - if (ret)
> + if (ret) {
> + dev_err(core->dev, "invalid HFI response (size %u, packets %u): %d\n",
> + hdr->size, hdr->num_packets, ret);
> return iris_hfi_gen2_handle_system_error(core, NULL);
> + }
>
> if (!hdr->session_id)
> return iris_hfi_gen2_handle_system_response(core, hdr);
> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_queue.c b/drivers/media/platform/qcom/iris/iris_hfi_queue.c
> index bf6db23b53e2..ef556e54f6f1 100644
> --- a/drivers/media/platform/qcom/iris/iris_hfi_queue.c
> +++ b/drivers/media/platform/qcom/iris/iris_hfi_queue.c
> @@ -112,14 +112,18 @@ static int iris_hfi_queue_read(struct iris_iface_q_info *qinfo, void *packet)
> int iris_hfi_queue_cmd_write_locked(struct iris_core *core, void *pkt, u32 pkt_size)
> {
> struct iris_iface_q_info *q_info = &core->command_queue;
> + int ret;
>
> if (core->state == IRIS_CORE_ERROR || core->state == IRIS_CORE_DEINIT)
> return -EINVAL;
>
> - if (!iris_hfi_queue_write(q_info, pkt, pkt_size)) {
> + ret = iris_hfi_queue_write(q_info, pkt, pkt_size);
> + if (!ret) {
> iris_vpu_raise_interrupt(core);
> } else {
> - dev_err(core->dev, "queue full\n");
> + dev_err(core->dev, "command queue write failed: %d (size %u, read %u, write %u)\n",
> + ret, pkt_size, q_info->qhdr->read_idx,
> + q_info->qhdr->write_idx);
> return -ENODATA;
> }
>
> @@ -254,7 +258,8 @@ int iris_hfi_queues_init(struct iris_core *core)
> &core->iface_q_table_daddr,
> GFP_KERNEL, DMA_ATTR_WRITE_COMBINE);
> if (!core->iface_q_table_vaddr) {
> - dev_err(core->dev, "queues alloc and map failed\n");
> + dev_err(core->dev, "failed to allocate HFI queues (%u bytes)\n",
> + queue_size);
> return -ENOMEM;
> }
>
> @@ -262,7 +267,8 @@ int iris_hfi_queues_init(struct iris_core *core)
> &core->sfr_daddr,
> GFP_KERNEL, DMA_ATTR_WRITE_COMBINE);
> if (!core->sfr_vaddr) {
> - dev_err(core->dev, "sfr alloc and map failed\n");
> + dev_err(core->dev, "failed to allocate SFR (%u bytes)\n",
> + (unsigned int)SFR_SIZE);
> dma_free_attrs(core->dev, queue_size, core->iface_q_table_vaddr,
> core->iface_q_table_daddr, DMA_ATTR_WRITE_COMBINE);
> return -ENOMEM;
> diff --git a/drivers/media/platform/qcom/iris/iris_vb2.c b/drivers/media/platform/qcom/iris/iris_vb2.c
> index 8faf709c26c1..b770cd5349b6 100644
> --- a/drivers/media/platform/qcom/iris/iris_vb2.c
> +++ b/drivers/media/platform/qcom/iris/iris_vb2.c
> @@ -135,8 +135,8 @@ int iris_vb2_queue_setup(struct vb2_queue *q,
>
> ret = inst->hfi_session_ops->session_open(inst);
> if (ret) {
> + dev_err(core->dev, "session open failed: %d\n", ret);
> ret = -EINVAL;
> - dev_err(core->dev, "session open failed\n");
> goto unlock;
> }
>
> diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/platform/qcom/iris/iris_vdec.c
> index 0dd33ff447bb..d359d3716ba1 100644
> --- a/drivers/media/platform/qcom/iris/iris_vdec.c
> +++ b/drivers/media/platform/qcom/iris/iris_vdec.c
> @@ -529,7 +529,8 @@ int iris_vdec_start_cmd(struct iris_inst *inst)
> clear_sub_state |= IRIS_INST_SUB_OUTPUT_PAUSE;
> }
> } else {
> - dev_err(inst->core->dev, "start called before receiving last_flag\n");
> + dev_err(inst->core->dev, "start before last buffer (sub-state %#x)\n",
> + inst->sub_state);
> iris_inst_change_state(inst, IRIS_INST_ERROR);
> return -EBUSY;
> }
> diff --git a/drivers/media/platform/qcom/iris/iris_venc.c b/drivers/media/platform/qcom/iris/iris_venc.c
> index 2f2c56bf9122..a7a0f14a78d1 100644
> --- a/drivers/media/platform/qcom/iris/iris_venc.c
> +++ b/drivers/media/platform/qcom/iris/iris_venc.c
> @@ -602,7 +602,8 @@ int iris_venc_start_cmd(struct iris_inst *inst)
> clear_sub_state |= IRIS_INST_SUB_OUTPUT_PAUSE;
> }
> } else {
> - dev_err(inst->core->dev, "start called before receiving last_flag\n");
> + dev_err(inst->core->dev, "start before last buffer (sub-state %#x)\n",
> + inst->sub_state);
> iris_inst_change_state(inst, IRIS_INST_ERROR);
> return -EBUSY;
> }
> diff --git a/drivers/media/platform/qcom/iris/iris_vidc.c b/drivers/media/platform/qcom/iris/iris_vidc.c
> index 05aab6e3005d..80f0a56712bf 100644
> --- a/drivers/media/platform/qcom/iris/iris_vidc.c
> +++ b/drivers/media/platform/qcom/iris/iris_vidc.c
> @@ -168,7 +168,7 @@ int iris_open(struct file *filp)
>
> ret = iris_core_init(core);
> if (ret) {
> - dev_err(core->dev, "core init failed\n");
> + dev_err(core->dev, "core init failed: %d\n", ret);
> pm_runtime_put_sync(core->dev);
> return ret;
> }
> diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/platform/qcom/iris/iris_vpu3x.c
> index c3b760730c98..cd22534c0904 100644
> --- a/drivers/media/platform/qcom/iris/iris_vpu3x.c
> +++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c
> @@ -17,14 +17,12 @@
> #define NOC_HALT BIT(0)
> #define AON_WRAPPER_SPARE (AON_BASE_OFFS + 0x28)
>
> -static bool iris_vpu3x_hw_power_collapsed(struct iris_core *core)
> +static bool iris_vpu3x_hw_power_collapsed(struct iris_core *core,
> + u32 *power_status)
> {
> - u32 value, pwr_status;
> + *power_status = readl(core->reg_base + WRAPPER_CORE_POWER_STATUS);
>
> - value = readl(core->reg_base + WRAPPER_CORE_POWER_STATUS);
> - pwr_status = value & BIT(1);
> -
> - return pwr_status ? false : true;
> + return !(*power_status & BIT(1));
> }
>
> static void iris_vpu3_power_off_hardware(struct iris_core *core)
> @@ -32,10 +30,11 @@ static void iris_vpu3_power_off_hardware(struct iris_core *core)
> u32 reg_val = 0, value, i;
> int ret;
>
> - if (iris_vpu3x_hw_power_collapsed(core))
> + if (iris_vpu3x_hw_power_collapsed(core, &value))
> goto disable_power;
>
> - dev_err(core->dev, "video hw is power on\n");
> + dev_err(core->dev, "video hardware still powered on (status %#x)\n",
> + value);
>
> value = readl(core->reg_base + WRAPPER_CORE_CLOCK_CONFIG);
> if (value)
> @@ -78,10 +77,11 @@ static void iris_vpu33_power_off_hardware(struct iris_core *core)
> u32 count = 0;
> int ret;
>
> - if (iris_vpu3x_hw_power_collapsed(core))
> + if (iris_vpu3x_hw_power_collapsed(core, &value))
> goto disable_power;
>
> - dev_err(core->dev, "video hw is power on\n");
> + dev_err(core->dev, "video hardware still powered on (status %#x)\n",
> + value);
>
> value = readl(core->reg_base + WRAPPER_CORE_CLOCK_CONFIG);
> if (value)
> @@ -116,7 +116,8 @@ static void iris_vpu33_power_off_hardware(struct iris_core *core)
> } while (++count < 1000);
>
> if (!handshake_done && handshake_busy)
> - dev_err(core->dev, "LPI handshake timeout\n");
> + dev_err(core->dev, "LPI handshake timeout (status %#x)\n",
> + value);
>
> ret = readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_STATUS,
> reg_val, reg_val & BIT(0), 200, 2000);
> diff --git a/drivers/media/platform/qcom/iris/iris_vpu4x.c b/drivers/media/platform/qcom/iris/iris_vpu4x.c
> index 90ccdc0d2a07..0369f2497f76 100644
> --- a/drivers/media/platform/qcom/iris/iris_vpu4x.c
> +++ b/drivers/media/platform/qcom/iris/iris_vpu4x.c
> @@ -117,7 +117,8 @@ static void iris_vpu4x_power_off_apv(struct iris_core *core)
> } while (++count < 1000);
>
> if (!handshake_done && handshake_busy)
> - dev_err(core->dev, "LPI handshake timeout\n");
> + dev_err(core->dev, "APV LPI handshake timeout (status %#x)\n",
> + value);
>
> writel(0x080200, core->reg_base + AON_WRAPPER_MVP_NOC_RESET_REQ);
> ret = readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_RESET_ACK,
> @@ -314,7 +315,8 @@ static void iris_vpu4x_power_off_hardware(struct iris_core *core)
> } while (++count < 1000);
>
> if (!handshake_done && handshake_busy)
> - dev_err(core->dev, "LPI handshake timeout\n");
> + dev_err(core->dev, "hardware LPI handshake timeout (status %#x)\n",
> + value);
>
> writel(MVP_NOC_RESET_REQ_MASK, core->reg_base + AON_WRAPPER_MVP_NOC_RESET_REQ);
> ret = readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_RESET_ACK,
> diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/media/platform/qcom/iris/iris_vpu_common.c
> index 243bd845349f..4a56856a8df5 100644
> --- a/drivers/media/platform/qcom/iris/iris_vpu_common.c
> +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c
> @@ -83,7 +83,8 @@ int iris_vpu_boot_firmware(struct iris_core *core)
> while (!ctrl_status && count < max_tries) {
> ctrl_status = readl(core->reg_base + CTRL_STATUS);
> if ((ctrl_status & CTRL_ERROR_STATUS__M) == 0x4) {
> - dev_err(core->dev, "invalid setting for uc_region\n");
> + dev_err(core->dev, "invalid UC region setting (CTRL_STATUS %#x)\n",
> + ctrl_status);
> return -EINVAL;
> }
>
> @@ -92,7 +93,8 @@ int iris_vpu_boot_firmware(struct iris_core *core)
> }
>
> if (count >= max_tries) {
> - dev_err(core->dev, "error booting up iris firmware\n");
> + dev_err(core->dev, "firmware boot timed out (CTRL_STATUS %#x)\n",
> + ctrl_status);
> return -ETIME;
> }
>
> @@ -128,7 +130,8 @@ int iris_vpu_watchdog(struct iris_core *core, u32 intr_status)
> u32 wd_intr_mask = core->iris_platform_data->wd_intr_mask;
>
> if (intr_status & wd_intr_mask) {
> - dev_err(core->dev, "received watchdog interrupt\n");
> + dev_err(core->dev, "received watchdog interrupt (status %#x)\n",
> + intr_status);
> return -ETIME;
> }
>
> @@ -172,7 +175,7 @@ int iris_vpu_prepare_pc(struct iris_core *core)
> ctrl_status = readl(core->reg_base + CTRL_STATUS);
> wfi_status = readl(core->reg_base + WRAPPER_TZ_CPU_STATUS);
> wfi_status &= BIT(0);
> - dev_err(core->dev, "skip power collapse, wfi=%#x, idle=%#x, pcr=%#x, ctrl=%#x)\n",
> + dev_err(core->dev, "skip power collapse (wfi=%#x, idle=%#x, pcr=%#x, ctrl=%#x)\n",
> wfi_status, idle_status, pc_ready, ctrl_status);
>
> return -EAGAIN;
> @@ -365,7 +368,7 @@ int iris_vpu35_vpu4x_power_off_controller(struct iris_core *core)
> } while (++count < 1000);
>
> if (!handshake_done && handshake_busy)
> - dev_err(core->dev, "LPI handshake timeout\n");
> + dev_err(core->dev, "LPI handshake timeout (status %#x)\n", val);
>
> ret = readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_VIDEO_CTL_NOC_LPI_STATUS,
> val, val & BIT(0), 200, 2000);
> @@ -530,7 +533,7 @@ int iris_vpu_power_on(struct iris_core *core)
> err_unvote_icc:
> iris_unset_icc_bw(core);
> err:
> - dev_err(core->dev, "power on failed\n");
> + dev_err(core->dev, "power on failed: %d\n", ret);
>
> return ret;
> }
Reviewed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
next prev parent reply other threads:[~2026-11-09 7:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 15:31 [PATCH 0/3] media: qcom: iris: improve error diagnostics Dipayaan Roy
2026-11-06 15:31 ` [PATCH 1/3] media: qcom: iris: improve probe error reporting Dipayaan Roy
2026-11-09 7:17 ` Vishnu Reddy
2026-11-06 15:31 ` [PATCH 2/3] media: qcom: iris: add error and status details to diagnostics Dipayaan Roy
2026-11-09 7:25 ` Vishnu Reddy [this message]
2026-11-06 15:31 ` [PATCH 3/3] media: qcom: iris: Improve diagnostics for system and session failures Dipayaan Roy
2026-11-09 7:53 ` Vishnu Reddy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1ceec27d-c7b2-91ae-1cce-82e403289ef1@oss.qualcomm.com \
--to=busanna.reddy@oss.qualcomm.com \
--cc=abhinav.kumar@linux.dev \
--cc=bod@kernel.org \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=dipayaan.roy@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=vikash.garodia@oss.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®