Re: [PATCH 3/5] media: iris: guard against a NULL hfi_sys_ops in the interrupt handler

From: Konrad Dybcio

Date: Thu Jul 30 2026 - 13:03:54 EST


On 7/30/26 5:26 PM, Dmitry Baryshkov wrote:
> core->hfi_sys_ops is populated only during core bring-up, once the
> firmware generation has been detected. iris_vpu_power_on() enables
> interrupts earlier than that, so an interrupt (for instance a spurious
> one) that fires in this window makes iris_hfi_isr_handler()
> unconditionally dereference a NULL core->hfi_sys_ops and panic.
>
> Skip the response handler when hfi_sys_ops has not been set up yet; the
> interrupt is still acknowledged and the line re-enabled.
>
> Fixes: d8a6a63372b8 ("media: qcom: iris: merge hfi_response_ops and hfi_command_ops")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>
> Assisted-by: Claude:claude-opus-4-8
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>

double sob (it surely makes some people sob! :P)

> ---
> drivers/media/platform/qcom/iris/iris_hfi_common.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_common.c b/drivers/media/platform/qcom/iris/iris_hfi_common.c
> index 8769ec61f117..36fcac4b40f1 100644
> --- a/drivers/media/platform/qcom/iris/iris_hfi_common.c
> +++ b/drivers/media/platform/qcom/iris/iris_hfi_common.c
> @@ -109,7 +109,9 @@ irqreturn_t iris_hfi_isr_handler(int irq, void *data)
> iris_vpu_clear_interrupt(core);
> mutex_unlock(&core->lock);
>
> - core->hfi_sys_ops->sys_hfi_response_handler(core);
> + /* An early (e.g. spurious) interrupt can arrive before hfi_sys_ops is set. */

Slop comment, drop or mention the reason behind this

apart from that

Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>

Konrad