Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Cc: conor+dt@kernel.org, media-ci@linuxtv.org, robh@kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v8 10/18] media: iris: skip PIPE if it is not supported by the platform
Date: Thu, 30 Jul 2026 15:56:55 +0000	[thread overview]
Message-ID: <20260730155656.094E91F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260730-iris-ar50lt-v8-10-6597c08cea6f@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Pre-existing issues:
- [Critical] Omitting the PIPE capability causes a division-by-zero kernel panic in `iris_vpu3x_vpu4x_calculate_frequency()`.
- [Medium] `iris_set_stage()` lacks the fallback check for unsupported capabilities that was added to `iris_set_pipe()`.
--

--- Patch [10]: [PATCH v8 10/18] media: iris: skip PIPE if it is not supported by the platform ---
commit 47a09938f9dc9bf17faca2d850a92320d738ffe8
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

media: iris: skip PIPE if it is not supported by the platform

AR50Lt doesn't support HFI_PROPERTY_PARAM_WORK_ROUTE. Tables for AR50LT
won't have corresponding entry in the capability tables. Let
iris_set_pipe() silently skip propgramming the property if there is no
corresponding capability.

> diff --git a/drivers/media/platform/qcom/iris/iris_ctrls.c b/drivers/media/platform/qcom/iris/iris_ctrls.c
> index 10e33b8a73f60..33a34573391a4 100644
> --- a/drivers/media/platform/qcom/iris/iris_ctrls.c
> +++ b/drivers/media/platform/qcom/iris/iris_ctrls.c
> @@ -534,6 +534,9 @@ int iris_set_pipe(struct iris_inst *inst, enum platform_inst_fw_cap_type cap_id)
>  	u32 work_route = inst->fw_caps[PIPE].value;
>  	u32 hfi_id = inst->fw_caps[cap_id].hfi_id;
>  
> +	if (!hfi_id)
> +		return 0;
> +

[Severity: Critical]
This isn't a bug introduced by this patch, but by allowing platforms to
legitimately omit the PIPE capability, could this lead to a division by zero
panic in iris_vpu3x_vpu4x_calculate_frequency()?

When the PIPE capability is missing (like in inst_fw_cap_sm8550_enc),
inst->fw_caps[PIPE].value is initialized to 0. During clock scaling,
iris_vpu3x_vpu4x_calculate_frequency() in iris_vpu_common.c unconditionally
uses this value:

drivers/media/platform/qcom/iris/iris_vpu_common.c:iris_vpu3x_vpu4x_calculate_frequency() {
    ...
    vpp_cycles = mult_frac(mbs_per_second, caps->mb_cycles_vpp,
                           (u32)inst->fw_caps[PIPE].value);
    ...
}

Will this trigger a kernel panic if a stream is started on a platform where
PIPE is intentionally absent?

[Severity: Medium]
This is also a pre-existing issue, but should iris_set_stage() in
iris_ctrls.c include the exact same hfi_id check?

In iris_common.c, iris_alloc_and_queue_input_int_bufs() calls both
iris_set_stage() and iris_set_pipe(). Since iris_set_stage() lacks this
check, if a platform omits the STAGE capability, it will call
session_set_property() with an hfi_id of 0:

drivers/media/platform/qcom/iris/iris_ctrls.c:iris_set_stage() {
    ...
    u32 hfi_id = inst->fw_caps[cap_id].hfi_id;

    return hfi_ops->session_set_property(inst, hfi_id, ...);
    ...
}

Would this pass an invalid property ID and potentially crash the firmware?

>  	return hfi_ops->session_set_property(inst, hfi_id,
>  					     HFI_HOST_FLAGS_NONE,
>  					     iris_get_port_info(inst, cap_id),
>  					     HFI_PAYLOAD_U32,
>  					     &work_route, sizeof(u32));
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260730-iris-ar50lt-v8-0-6597c08cea6f@oss.qualcomm.com?part=10

  reply	other threads:[~2026-07-30 15:56 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <J0r-fdDYeS3FyqabzR_0wiwxC-2onZeePkUSfv0NavGV8KB3Anc-j8yKHqfY2I3X4VAiZpRkYSIZLaTwuyhKMA==@protonmail.internalid>
2026-07-30 15:20 ` [PATCH v8 00/18] media: iris: Add AR50LT core support and enable Agatti platform Dmitry Baryshkov
2026-07-30 15:20   ` [PATCH v8 01/18] media: iris: Add Gen2 firmware autodetect and fallback Dmitry Baryshkov
2026-07-30 15:37     ` sashiko-bot
2026-07-30 20:02     ` Bryan O'Donoghue
2026-07-30 15:20   ` [PATCH v8 02/18] media: iris: Skip UBWC configuration when not supported Dmitry Baryshkov
2026-07-30 15:32     ` sashiko-bot
2026-07-30 15:20   ` [PATCH v8 03/18] media: iris: drop IRIS_FMT_foo enumeration Dmitry Baryshkov
2026-07-30 15:20   ` [PATCH v8 04/18] media: iris: Filter UBWC raw formats based on hardware capabilities Dmitry Baryshkov
2026-07-30 15:20   ` [PATCH v8 05/18] media: iris: Introduce set_preset_register as a vpu_op Dmitry Baryshkov
2026-07-30 15:20   ` [PATCH v8 06/18] media: iris: Introduce interrupt_init " Dmitry Baryshkov
2026-07-30 15:20   ` [PATCH v8 07/18] media: iris: add vpu op hook to disable ARP buffer Dmitry Baryshkov
2026-07-30 15:41     ` sashiko-bot
2026-07-30 15:20   ` [PATCH v8 08/18] media: iris: Add platform data field for watchdog interrupt mask Dmitry Baryshkov
2026-07-30 15:32     ` sashiko-bot
2026-07-30 15:20   ` [PATCH v8 09/18] media: iris: Add platform flag for instantaneous bandwidth voting Dmitry Baryshkov
2026-07-30 15:20   ` [PATCH v8 10/18] media: iris: skip PIPE if it is not supported by the platform Dmitry Baryshkov
2026-07-30 15:56     ` sashiko-bot [this message]
2026-07-30 15:20   ` [PATCH v8 11/18] media: iris: Add framework support for AR50_LITE video core Dmitry Baryshkov
2026-07-30 15:41     ` sashiko-bot
2026-07-30 15:20   ` [PATCH v8 12/18] media: iris: add minimal GET_PROPERTY implementation Dmitry Baryshkov
2026-07-30 15:39     ` sashiko-bot
2026-07-30 15:20   ` [PATCH v8 13/18] media: iris: update buffer requirements based on received info Dmitry Baryshkov
2026-07-30 15:52     ` sashiko-bot
2026-07-30 15:20   ` [PATCH v8 14/18] media: iris: implement support for the Agatti platform Dmitry Baryshkov
2026-07-30 15:54     ` sashiko-bot
2026-07-30 15:20   ` [PATCH v8 15/18] media: iris: Introduce buffer size calculations for AR50LT Dmitry Baryshkov
2026-07-30 15:47     ` sashiko-bot
2026-07-30 15:20   ` [PATCH v8 16/18] media: iris: add Gen2 firmware support on the Agatti platform Dmitry Baryshkov
2026-07-30 15:21   ` [PATCH v8 17/18] media: venus: skip QCM2290 if Iris driver is enabled Dmitry Baryshkov
2026-07-30 15:39     ` sashiko-bot
2026-07-30 15:21   ` [PATCH v8 18/18] media: iris: constify inst_fw_cap_sm8250_dec Dmitry Baryshkov
2026-07-30 20:09   ` [PATCH v8 00/18] media: iris: Add AR50LT core support and enable Agatti platform Bryan O'Donoghue

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=20260730155656.094E91F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=media-ci@linuxtv.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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