From: sashiko-bot@kernel.org
To: "Daniel Golle" <daniel@makrotopia.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4 5/5] drm/bridge: it6505: Don't reject audio hw_params without an encoder
Date: Wed, 22 Jul 2026 01:12:42 +0000 [thread overview]
Message-ID: <20260722011243.450EB1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <2c08315fede798f8632fe985da5ffd568c945de3.1784681487.git.daniel@makrotopia.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Division by zero kernel panic in `__it6505_enable_audio()` when `REG_AUDIO_INPUT_FREQ` reads 0.
--
--- Patch [5]: [PATCH v4 5/5] drm/bridge: it6505: Don't reject audio hw_params without an encoder ---
commit ce61845cbb90df0a24913039e8ff09c7c4ff53e7
Author: Daniel Golle <daniel@makrotopia.org>
drm/bridge: it6505: Don't reject audio hw_params without an encoder
This commit drops the encoder check in it6505_audio_setup_hw_params() to
ensure stream parameters are always cached, even when no display is attached.
It also moves the application of audio parameter defaults to probe time.
> diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
> index 6bb5db565ccac..e01d57b0166a8 100644
> --- a/drivers/gpu/drm/bridge/ite-it6505.c
> +++ b/drivers/gpu/drm/bridge/ite-it6505.c
> @@ -3004,9 +2994,6 @@ static int it6505_audio_setup_hw_params(struct it6505 *it6505,
> params->sample_rate, params->sample_width,
> params->cea.channels);
>
> - if (!it6505->bridge.encoder)
> - return -ENODEV;
> -
[ ... ]
[Severity: High]
This is a pre-existing issue, but can this code cause a division by zero kernel
panic?
Looking at __it6505_enable_audio() in drivers/gpu/drm/bridge/ite-it6505.c,
if it6505_read() returns 0 (e.g. if no I2S clock is present or the read fails),
regbe is used as a denominator:
regbe = it6505_read(it6505, REG_AUDIO_INPUT_FREQ);
DRM_DEV_DEBUG_DRIVER(dev, "regbe:0x%02x audio input fs: %d.%d kHz",
regbe, 6750 / regbe, (6750 % regbe) * 10 / regbe);
When DRM debugging is enabled, this would evaluate the arguments and divide by
zero. Should there be a check to ensure regbe is non-zero before it is used in
the DRM_DEV_DEBUG_DRIVER macro?
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1784681487.git.daniel@makrotopia.org?part=5
prev parent reply other threads:[~2026-07-22 1:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 0:58 [PATCH v4 0/5] drm/bridge: it6505: DP audio support + shared-DAI hw_params fix Daniel Golle
2026-07-22 0:59 ` [PATCH v4 1/5] drm/bridge: it6505: quiesce event sources and work on remove() Daniel Golle
2026-07-22 1:18 ` sashiko-bot
2026-07-22 0:59 ` [PATCH v4 2/5] drm/bridge: it6505: disable runtime PM on remove Daniel Golle
2026-07-22 1:21 ` sashiko-bot
2026-07-22 0:59 ` [PATCH v4 3/5] drm/bridge: it6505: guard against zero channel count in audio infoframe Daniel Golle
2026-07-22 1:16 ` sashiko-bot
2026-07-22 1:00 ` [PATCH v4 4/5] drm/bridge: it6505: Add audio support Daniel Golle
2026-07-22 1:15 ` sashiko-bot
2026-07-22 1:00 ` [PATCH v4 5/5] drm/bridge: it6505: Don't reject audio hw_params without an encoder Daniel Golle
2026-07-22 1:12 ` sashiko-bot [this message]
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=20260722011243.450EB1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=daniel@makrotopia.org \
--cc=dri-devel@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.