Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Erikas Bitovtas" <xerikasxx@gmail.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v9 4/8] media: qcom: venus: add codec blacklist mechanism
Date: Tue, 26 May 2026 15:24:50 +0000	[thread overview]
Message-ID: <20260526152451.08BB31F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260526-msm8939-venus-rfc-v9-4-bb1069f3fe02@gmail.com>

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

New issues:
- [Medium] The newly introduced codec blacklist mechanism is silently bypassed and ignored for newer HFI platforms (V4, V6).

Pre-existing issues:
- [High] Unmapped firmware codecs cause a fatal probe failure instead of being gracefully skipped.
--

commit 940596b130019709f06d3571e5a70d611a9c2f28
Author: Erikas Bitovtas <xerikasxx@gmail.com>

media: qcom: venus: add codec blacklist mechanism

This commit introduces dec_codec_blacklist and enc_codec_blacklist
properties to allow disabling different codecs per Venus device. It updates
parse_codecs() to apply these blacklists instead of checking the HFI version.

> diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
> index a87e8afb23dfb..bd88e2b484a53 100644
> --- a/drivers/media/platform/qcom/venus/core.c
> +++ b/drivers/media/platform/qcom/venus/core.c
[ ... ]
> @@ -178,6 +179,8 @@ static void venus_sys_error_handler(struct work_struct *work)
>  static u32 to_v4l2_codec_type(u32 codec)
>  {
>  	switch (codec) {
> +	case HFI_VIDEO_CODEC_HEVC:
> +		return V4L2_PIX_FMT_HEVC;

[Severity: High]
This is a pre-existing issue, but does an unmapped firmware codec cause a
fatal probe failure instead of being gracefully skipped?

If a codec bit is set by the firmware but is not explicitly mapped in
to_v4l2_codec_type() (such as HFI_VIDEO_CODEC_SPARK if it were not explicitly
blacklisted), it hits the default case and returns 0.

This 0 is then passed to hfi_session_init(), which converts it back to codec=0.
pkt_session_init() correctly rejects codec=0 with -EINVAL. This error is
unconditionally propagated up to venus_probe(), causing the entire device probe
to fail and the driver to become unusable.

Should unknown codecs simply be skipped instead?

[ ... ]
> diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c
> index 92765f9c88730..8e762cf77968b 100644
> --- a/drivers/media/platform/qcom/venus/hfi_parser.c
> +++ b/drivers/media/platform/qcom/venus/hfi_parser.c
> @@ -206,11 +206,11 @@ static int parse_codecs(struct venus_core *core, void *data)
>  	core->dec_codecs = codecs->dec_codecs;
>  	core->enc_codecs = codecs->enc_codecs;
>  
> -	if (IS_V1(core)) {
> -		core->dec_codecs &= ~HFI_VIDEO_CODEC_HEVC;
> -		core->dec_codecs &= ~HFI_VIDEO_CODEC_SPARK;
> -		core->enc_codecs &= ~HFI_VIDEO_CODEC_HEVC;
> -	}
> +	if (core->res->dec_codec_blacklist)
> +		core->dec_codecs &= ~core->res->dec_codec_blacklist;

[Severity: Medium]
Will this newly introduced codec blacklist mechanism be silently bypassed and
ignored for newer HFI platforms like V4 and V6?

For newer platforms, hfi_platform_parser() directly sets the codecs from
hardcoded driver capabilities and returns 0. This causes hfi_parser() to return
early and skip the entire firmware parsing loop where parse_codecs() resides.

If a V4 or V6 device is configured with these blacklists, they appear to be
completely ignored.

> +
> +	if (core->res->enc_codec_blacklist)
> +		core->enc_codecs &= ~core->res->enc_codec_blacklist;
>  
>  	return sizeof(*codecs);
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260526-msm8939-venus-rfc-v9-0-bb1069f3fe02@gmail.com?part=4

  reply	other threads:[~2026-05-26 15:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 13:24 [PATCH v9 0/8] media: qcom: venus: add MSM8939 support Erikas Bitovtas
2026-05-26 13:24 ` [PATCH v9 1/8] media: dt-bindings: venus: Add qcom,msm8939 schema Erikas Bitovtas
2026-05-26 13:24 ` [PATCH v9 2/8] clk: qcom: gcc-msm8939: mark Venus core GDSCs as hardware controlled Erikas Bitovtas
2026-05-26 13:43   ` Bryan O'Donoghue
2026-06-10 13:32   ` Konrad Dybcio
2026-05-26 13:24 ` [PATCH v9 3/8] media: qcom: venus: add power domain enable logic for Venus cores Erikas Bitovtas
2026-05-26 14:50   ` sashiko-bot
2026-05-26 13:24 ` [PATCH v9 4/8] media: qcom: venus: add codec blacklist mechanism Erikas Bitovtas
2026-05-26 15:24   ` sashiko-bot [this message]
2026-05-26 13:24 ` [PATCH v9 5/8] media: qcom: venus: Add msm8939 resource struct Erikas Bitovtas
2026-05-26 13:24 ` [PATCH v9 6/8] arm64: dts: qcom: msm8939: Add venus node Erikas Bitovtas
2026-06-10 13:29   ` Konrad Dybcio
2026-05-26 13:24 ` [PATCH v9 7/8] arm64: dts: qcom: msm8939-longcheer-l9100: Enable " Erikas Bitovtas
2026-05-26 13:24 ` [PATCH v9 8/8] arm64: dts: qcom: msm8939-asus-z00t: add Venus Erikas Bitovtas

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=20260526152451.08BB31F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=xerikasxx@gmail.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