All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Suraj Kandpal" <suraj.kandpal@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v3 04/10] drm/i915/dp: Add M/N ratio check with warning for DP link config
Date: Wed, 16 Sep 2026 09:23:29 +0000	[thread overview]
Message-ID: <20260916092330.2A0891F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260916090946.677564-5-suraj.kandpal@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] drm: log spam and DoS vector due to invariant drm_WARN inside bpp_x16 loop
--

commit cb9847e0babf613d9ed13f234a331025ee93ec9c
Author: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

drm/i915/dp: Add M/N ratio check with warning for DP link config

This commit introduces intel_dp_check_m_n_ratio() to validate the computed
link M/N ratio against the maximum allowed value. It issues a warning via
drm_WARN() if the limit is exceeded.

[ ... ]
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> index 430ba1230c5ae..364f62563f904 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> @@ -347,6 +347,8 @@ int intel_dp_mtp_tu_compute_config(struct intel_dp *intel_dp,
>  					 link_bpp_x16,
>  					 &crtc_state->dp_m_n);
>  
> +		intel_dp_check_m_n_ratio(crtc_state, &crtc_state->dp_m_n);
		^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

[Severity: Medium]
Will this evaluate a loop-invariant condition on every iteration of the
bpp_x16 loop in intel_dp_mtp_tu_compute_config() in intel_dp_mst.c?

Because intel_dp_check_m_n_ratio() uses drm_WARN() and is called inside this
loop, a KMS client requesting an MST mode where the link_m / link_n ratio
exceeds max_m_n_ratio could trigger a full kernel stack trace for every failed
loop iteration.

When DSC is used, bpp_step_x16 can be as small as 1/16 bpp. Could this cause
the loop to run potentially hundreds of times for an un-fittable mode, flooding
the kernel log and leading to dmesg rollover or console lockups?

> +
>  		if (is_mst) {
>  			int remote_bw_overhead;
>  			int remote_tu;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260916090946.677564-1-suraj.kandpal@intel.com?part=4

  reply	other threads:[~2026-09-16  9:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16  9:09 [PATCH v3 00/10] Implement Wa_14021768792 to bypass m_n ratio limit Suraj Kandpal
2026-09-16  9:09 ` [PATCH v3 01/10] drm/i915/display: Add helper to compute link M/N ratio for reuse Suraj Kandpal
2026-09-16  9:09 ` [PATCH v3 02/10] drm/i915/dp: Limit M/N ratio for DP SST Suraj Kandpal
2026-09-16  9:25   ` sashiko-bot
2026-09-16  9:33     ` Kandpal, Suraj
2026-09-16  9:09 ` [PATCH v3 03/10] drm/i915/dp_mst: Limit M/N ratio for MST Suraj Kandpal
2026-09-16  9:09 ` [PATCH v3 04/10] drm/i915/dp: Add M/N ratio check with warning for DP link config Suraj Kandpal
2026-09-16  9:23   ` sashiko-bot [this message]
2026-09-16  9:09 ` [PATCH v3 05/10] drm/i915/display: Add bits for link_n_extended for DISPLAY >= 14 Suraj Kandpal
2026-09-16  9:09 ` [PATCH v3 06/10] drm/i915/display_wa: Add support for Wa_14021768792 Suraj Kandpal
2026-09-16  9:09 ` [PATCH v3 07/10] drm/i915/display: Add bits for Wa_14021768792 for linkm/n ratio > 10 Suraj Kandpal
2026-09-16  9:23   ` sashiko-bot
2026-09-16  9:09 ` [PATCH v3 08/10] drm/i915/display: Implement Wa_14021768792 for BMG DP for link_m/n " Suraj Kandpal
2026-09-16  9:27   ` sashiko-bot
2026-09-16  9:09 ` [PATCH v3 09/10] drm/i915/dp: Extend intel_dp_can_support_m_n() for BMG M/N bypass Suraj Kandpal
2026-09-16  9:09 ` [PATCH v3 10/10] drm/i915/dp: Bump the max Link M/N ratio to 22 for DISPLAY_VER >= 35 Suraj Kandpal
2026-09-16  9:18 ` ✓ CI.KUnit: success for Implement Wa_14021768792 to bypass m_n ratio limit (rev8) Patchwork
2026-09-16  9:55 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-16 10:18 ` ✓ i915.CI.BAT: " Patchwork
2026-09-16 11:30 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-09-16 15:34 ` ✓ i915.CI.Full: success " Patchwork

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=20260916092330.2A0891F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=suraj.kandpal@intel.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 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.