Skip to content

media: qcom: iris: improve error diagnostics - #2408

Closed
Dipayaan Roy (diproy-qcom) wants to merge 6 commits into
qualcomm-linux:mainfrom
diproy-qcom:main
Closed

Dipayaan Roy (diproy-qcom) wants to merge 6 commits into
qualcomm-linux:mainfrom
diproy-qcom:main

Conversation

@diproy-qcom

Copy link
Copy Markdown

The Iris driver can return probe errors or enter error states without
logging enough context to identify the failed operation or firmware
response. This makes failures difficult to diagnose from kernel logs.

Improve probe error reporting, include available return codes and status
values in existing messages, and add focused diagnostics for system and
session failures. Report recovery failures and provide debug-level
messages for successful recovery and less actionable events.

Dipayaan Roy (3):
media: qcom: iris: improve probe error reporting
media: qcom: iris: add error and status details to diagnostics
media: qcom: iris: Improve diagnostics for system and session failures

Vishnu Reddy and others added 5 commits November 16, 2026 11:11
…allback

inst->tss[] has VIDEO_MAX_FRAME (32) entries, so valid indexes are 0
through 31. iris_set_ts_metadata() writes at metadata_idx and then
increments it. After the 32nd input buffer, metadata_idx is 32 until
the next input buffer is queued.

If iris_get_ts_metadata() finds no matching timestamp in that window,
its fallback reads inst->tss[32], one entry past the end of the array.
UBSAN (Undefined Behavior Sanity Checker) reports this as an
array-index-out-of-bounds error.

Use the last written entry, metadata_idx - 1, in the fallback instead.
Fall back to slot 0 if nothing has been written yet. Even if stream off
and stream on happen multiple times on the same session, the fallback
always uses the latest metadata received.

Link: https://lore.kernel.org/all/20261017-fix-oob-tss-v1-1-fb86f4cabf65@oss.qualcomm.com/
Fixes: 17f2a48 ("media: iris: implement vb2 ops for buf_queue and firmware response")
Cc: stable@vger.kernel.org
Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
The Iris probe path returned errors from resource initialization and
device registration without identifying the operation that failed. This
made failures difficult to diagnose, especially when several resources
were acquired during probe.

Use dev_err_probe() at probe and resource initialization failure paths to
report useful context while preserving deferred-probe handling. Also
validate the platform match data before it is dereferenced.

Successful probe behavior and existing cleanup paths remain unchanged.

Signed-off-by: Dipayaan Roy <dipayaan.roy@oss.qualcomm.com>
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>
Log system and session response timeouts, firmware-reported failures,
and failed recovery attempts so the cause of an error is visible.

Add debug messages for unknown sessions, invalid state transitions,
and successful recovery. Avoid a redundant system init timeout message
after firmware reports an error, and rate-limit Gen2 session response
errors.

Signed-off-by: Dipayaan Roy <dipayaan.roy@oss.qualcomm.com>
@qswat-orbit-external

Copy link
Copy Markdown

Change Requests Validation Check

No CR numbers found in the pull request description.

Please add CR numbers in the format: CRs-fixed: {number} (one per line).

Example:

CRs-fixed: 12345
CRs-fixed: 67890

@qswat-orbit-external

Copy link
Copy Markdown

Change Requests Validation Check

No CR numbers found in the pull request description.

Please add CR numbers in the format: CRs-fixed: {number} (one per line).

Example:

CRs-fixed: 12345
CRs-fixed: 67890

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants