From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 063D6606A335 for ; Thu, 3 Dec 2026 00:04:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oXOz10JP Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 434621126AF; Thu, 3 Dec 2026 00:04:04 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1E7981126AE for ; Thu, 3 Dec 2026 00:03:58 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 7502260EF1; Thu, 3 Dec 2026 00:03:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 090E81F0092C; Thu, 3 Dec 2026 00:03:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796256237; bh=jz1hufe+q2s82IJfumEoyrKSmzocNEAG6uKnFz/wFEA=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=oXOz10JPqPLPimua443KSFawaUnogr8UTQoJngNTdv/i2/M0Ruh3tOITA3JYQ2i+b lPEoJHS/vo086Xk0G1kYxbEONArQhaOgOe84gUqRrYQ643NGNbaQyBX9qdJ4s5SsB8 VHSuQTEBk5CLBqFbiTwDOZLPs9OsdRMdPEx8QnPzfHjWw/pY75u7rx9BaF8cCcl/30 aNNlxoTom/vGXm9YluXpChCa52/DTA5ZQba57/3rjIk7KetNiz+zYXtji7N/5VFvuh /Ju0wIrrHx070n8XLqzMIyhVFbBGgXZQmL2H5nd+Mhk3ME5K0D0FA4yoJ2ni0h7Iyt ONdcBu8uNa/sw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 04/11] drm/msm/dp: reinit video_comp and guard stream state on link maintenance To: "Gianfranco Mariotti" Cc: dri-devel@lists.freedesktop.org In-Reply-To: <20261202234640.9379-5-gianfranco.mariotti94@gmail.com> References: <20261202234640.9379-1-gianfranco.mariotti94@gmail.com> <20261202234640.9379-5-gianfranco.mariotti94@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 00:03:56 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] drm/msm/dp: race in msm_dp_ctrl_link_maintenance() during stream disable -- commit 92cb901a22d0365654c6eb38972e3118d6b87858 Author: Gianfranco Mariotti drm/msm/dp: reinit video_comp and guard stream state on link maintenance This commit reinitializes ctrl->video_comp and checks ctrl->stream_clks_on during link maintenance, turns off the pixel clock on video-ready failure in msm_dp_ctrl_on_stream(), and takes dp->plugged_lock across display enable and disable callbacks. > diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp= /dp_display.c > index b8373740275bc..d522b7d254b44 100644 > --- a/drivers/gpu/drm/msm/dp/dp_display.c > +++ b/drivers/gpu/drm/msm/dp/dp_display.c [ ... ] > @@ -724,6 +726,8 @@ static int msm_dp_display_disable(struct msm_dp_displ= ay_private *dp, > { > struct msm_dp *msm_dp_display =3D &dp->msm_dp_display; > =20 > + guard(mutex)(&dp->plugged_lock); > + > if (!msm_dp_display->power_on) > return 0; > =20 > @@ -1504,6 +1508,8 @@ void msm_dp_display_atomic_disable(struct msm_dp *d= p) > =20 > msm_dp_display =3D container_of(dp, struct msm_dp_display_private, msm_= dp_display); > =20 > + guard(mutex)(&msm_dp_display->plugged_lock); > + > /* > * If .atomic_enable() bailed out - link training failure is the common > * case - the mainlink was never brought up and ->power_on stayed false. [Severity: Medium] Can an IRQ_HPD link maintenance run between msm_dp_display_atomic_disable() and msm_dp_display_disable() and put the controller back into DP_STATE_CTRL_SEND_VIDEO while the stream is being torn down? CPU0 CPU1 (IRQ_HPD) msm_dp_display_atomic_disable() mutex_lock(&dp->plugged_lock) msm_dp_ctrl_push_idle() mutex_unlock(&dp->plugged_lock) msm_dp_irq_hpd_handle() mutex_lock(&dp->plugged_lock) ... msm_dp_ctrl_link_maintenance() /* stream_clks_on is still tr= ue */ msm_dp_ctrl_push_idle() ... msm_dp_write_link(..., DP_STATE_CTRL_SEND_VIDEO) msm_dp_ctrl_wait4video_ready() <-- times out, stream stopp= ed mutex_unlock(&dp->plugged_lock) msm_dp_display_atomic_post_disable() msm_dp_display_audio_notify_disable() msm_dp_display_disable() mutex_lock(&dp->plugged_lock) msm_dp_ctrl_off_pixel_clk() ctrl->stream_clks_on[...] =3D false msm_dp_display_atomic_disable() pushes the link to idle and drops dp->plugged_lock, but ctrl->stream_clks_on[panel->stream_id] is not cleared until msm_dp_display_disable() runs in msm_dp_display_atomic_post_disable() (after DPU encoder disable and msm_dp_display_audio_notify_disable()). If an IRQ_HPD arrives in that window, msm_dp_ctrl_link_maintenance() sees ctrl->stream_clks_on[panel->stream_id] =3D=3D true, drives PUSH_IDLE a seco= nd time (timing out on ctrl->idle_comp), retrains, writes DP_STATE_CTRL_SEND_VIDEO, and times out in msm_dp_ctrl_wait4video_ready(), leaving the controller in SEND_VIDEO when msm_dp_display_disable() turns off the pixel clock. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202234640.9379= -1-gianfranco.mariotti94@gmail.com?part=3D4