From: Jani Nikula <jani.nikula@linux.intel.com>
To: Suraj Kandpal <suraj.kandpal@intel.com>,
dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
intel-gfx@lists.freedesktop.org
Cc: ankit.k.nautiyal@intel.com, arun.r.murthy@intel.com,
imre.deak@intel.com, Suraj Kandpal <suraj.kandpal@intel.com>
Subject: Re: [PATCH] drm/display/dp_mst: Add protection against 0 vcpi
Date: Thu, 13 Nov 2025 10:25:34 +0200 [thread overview]
Message-ID: <c47f1221281e998f53169ffd0a2e06b301bb1605@intel.com> (raw)
In-Reply-To: <20251113043918.716367-1-suraj.kandpal@intel.com>
On Thu, 13 Nov 2025, Suraj Kandpal <suraj.kandpal@intel.com> wrote:
> When releasing a timeslot there is a slight chance we may end up
> with the wrong payload mask due to overflow if the delayed_destroy_work
> ends up coming into play after a DP 2.1 monitor gets disconnected
> which causes vcpi to become 0 then we try to make the payload =
> ~BIT(vcpi - 1) which is a negative shift.
Is that a real scenario or a hypothetical one?
>
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
> drivers/gpu/drm/display/drm_dp_mst_topology.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c
> index 64e5c176d5cc..3cf1eafcfcb5 100644
> --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
> @@ -4531,6 +4531,7 @@ int drm_dp_atomic_release_time_slots(struct drm_atomic_state *state,
> struct drm_dp_mst_atomic_payload *payload;
> struct drm_connector_state *old_conn_state, *new_conn_state;
> bool update_payload = true;
> + int bit;
>
> old_conn_state = drm_atomic_get_old_connector_state(state, port->connector);
> if (!old_conn_state->crtc)
> @@ -4572,7 +4573,8 @@ int drm_dp_atomic_release_time_slots(struct drm_atomic_state *state,
> if (!payload->delete) {
> payload->pbn = 0;
> payload->delete = true;
> - topology_state->payload_mask &= ~BIT(payload->vcpi - 1);
> + bit = payload->vcpi ? payload->vcpi - 1 : 0;
> + topology_state->payload_mask &= ~BIT(bit);
> }
>
> return 0;
--
Jani Nikula, Intel
next prev parent reply other threads:[~2025-11-13 8:25 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-13 4:39 [PATCH] drm/display/dp_mst: Add protection against 0 vcpi Suraj Kandpal
2025-11-13 5:30 ` ✓ i915.CI.BAT: success for " Patchwork
2025-11-13 8:21 ` [PATCH] " Imre Deak
2025-11-13 16:24 ` Jani Nikula
2025-11-17 5:09 ` Kandpal, Suraj
2025-11-17 10:08 ` Imre Deak
2025-11-17 10:19 ` Jani Nikula
2025-11-17 10:41 ` Imre Deak
2025-11-19 7:38 ` Kandpal, Suraj
2025-11-19 9:15 ` Imre Deak
2025-11-19 9:26 ` Kandpal, Suraj
2025-11-13 8:25 ` Jani Nikula [this message]
2025-11-13 8:54 ` Kandpal, Suraj
2025-11-13 10:26 ` Jani Nikula
2025-11-13 16:10 ` Jani Nikula
2025-11-13 9:34 ` ✓ i915.CI.Full: success for " Patchwork
2025-11-19 9:46 ` [PATCH v2] " Suraj Kandpal
2025-11-21 17:33 ` Imre Deak
2025-11-26 23:11 ` Lyude Paul
2025-11-19 11:01 ` ✓ i915.CI.BAT: success for drm/display/dp_mst: Add protection against 0 vcpi (rev2) Patchwork
2025-11-19 13:02 ` ✓ i915.CI.Full: " 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=c47f1221281e998f53169ffd0a2e06b301bb1605@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=ankit.k.nautiyal@intel.com \
--cc=arun.r.murthy@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).