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 A6FAA606A322 for ; Thu, 3 Dec 2026 00:17:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Bq772+VY Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1CF331126B9; Thu, 3 Dec 2026 00:17:48 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id E72341126B9 for ; Thu, 3 Dec 2026 00:17:41 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id B5032435DC; Thu, 3 Dec 2026 00:17:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 888FE1F000C1; Thu, 3 Dec 2026 00:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796257061; bh=QJFBgeNUEbp4PHV6IbQkjWTUmK8eOow4LCGZM8yC4bY=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Bq772+VY2JYdTSfnJmhG0nxFIOwdYMJ3gvCBp40Ld+DFUsuMJM1vK5rb1ZEBeVxGe q0a0T8vPghf4wbmNVf9RYlvqjH8SDr5bA0BQp4omyMz7vsVpYoeRJw1oUaW5FhMnoe ZKjV/Bo01H/C7QB1plBkKdqv3FNPTspiXF/2ax2RWyVVt1Dh8ExIPHJh3Rs2hI03Lk tDTdG/QQ8ER0Oc7U69OQYsVty+y8F0rSC4MLODOvEsaBpQjMkOUbspYtZApmawiDhf LZxYD0DyAjTj8bH2PHp93rQ5WSzUtPNNfBJVEQwPnhqiWuCxxcwBDRohDZ7HhWlk1q DJRB7LWQNrzDg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 08/11] drm/msm/dp: keep PHY initialized while plugged across link unprepare To: "Gianfranco Mariotti" Cc: dri-devel@lists.freedesktop.org In-Reply-To: <20261202234640.9379-9-gianfranco.mariotti94@gmail.com> References: <20261202234640.9379-1-gianfranco.mariotti94@gmail.com> <20261202234640.9379-9-gianfranco.mariotti94@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 00:17:41 +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: - [High] drm/msm/dp: eDP PHY left uninitialized in msm_dp_display_unprepare() -- commit 3ff8f4b66e30683c7b1e9468b834d7cecc0a20e4 Author: Gianfranco Mariotti drm/msm/dp: keep PHY initialized while plugged across link unprepare This commit adds dp->prepared to track link preparation and reinitializes the PHY in msm_dp_display_unprepare() and msm_dp_pm_runtime_resume() when dp->plugged is set. > diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp= /dp_display.c > index d1925594da878..9e3d81ffbe03e 100644 > --- a/drivers/gpu/drm/msm/dp/dp_display.c > +++ b/drivers/gpu/drm/msm/dp/dp_display.c [ ... ] > @@ -1570,19 +1592,25 @@ static void msm_dp_display_unprepare(struct msm_d= p_display_private *dp) > { > struct msm_dp *msm_dp_display =3D &dp->msm_dp_display; > =20 > - /* dongle is still connected but sinks are disconnected */ > - if (dp->link->sink_count =3D=3D 0) > - msm_dp_link_psm_config(dp->link, &dp->panel->link_info, true); > + scoped_guard(mutex, &dp->plugged_lock) { > + if (!dp->prepared) > + return; > =20 > - msm_dp_ctrl_off_link(dp->ctrl, dp->panel); > + /* dongle is still connected but sinks are disconnected */ > + if (dp->link->sink_count =3D=3D 0 && dp->plugged) > + msm_dp_link_psm_config(dp->link, &dp->panel->link_info, > + true); > =20 > - if (dp->link->sink_count =3D=3D 0) > - /* re-init the PHY so that we can listen to Dongle disconnect */ > - msm_dp_ctrl_reinit_phy(dp->ctrl); > - else > + msm_dp_ctrl_off_link(dp->ctrl, dp->panel); > + > + /* Keep PHY initialized for AUX and IRQ_HPD while a sink remains plugg= ed */ > msm_dp_display_host_phy_exit(dp); > + if (dp->plugged) > + msm_dp_display_host_phy_init(dp); [Severity: High] Does this leave the eDP PHY uninitialized while the controller is still runtime-active? For eDP, msm_dp_pm_runtime_resume() initializes the PHY whenever the controller is runtime-resumed regardless of dp->plugged, and msm_dp_aux_transfer() skips the aux->enable_xfers check on eDP. In msm_dp_display_atomic_post_disable(), msm_dp_hpd_unplug_handle() runs before msm_dp_display_unprepare() and sets dp->plugged =3D false (and if msm_dp_display_prepare_link() failed before setting dp->prepared, msm_dp_hpd_unplug_handle() also calls msm_dp_display_host_phy_exit(dp) directly). When msm_dp_display_unprepare() then exits the PHY, dp->plugged is false so msm_dp_display_host_phy_init() is skipped. The subsequent pm_runtime_put_sync(&msm_dp_display->pdev->dev) does not suspend the controller because the child DP AUX endpoint device (panel->dev) remains runtime-active until panel_bridge_atomic_post_disable() -> drm_panel_unprepare() runs later in the bridge chain, and only triggers an asynchronous idle on the parent when it finally suspends. Any eDP AUX transfer (such as panel_edp_get_modes() or AUX backlight updates) while the controller is still RPM_ACTIVE will skip msm_dp_pm_runtime_resume() and time out with -ETIMEDOUT against the uninitialized PHY. Should msm_dp_display_unprepare() (and the failure path in msm_dp_display_prepare_link()) also reinitialize the PHY when msm_dp_display->is_edp is true, and msm_dp_hpd_unplug_handle() skip msm_dp_display_host_phy_exit() on eDP so that msm_dp_pm_runtime_suspend() remains responsible for exiting the eDP PHY? --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202234640.9379= -1-gianfranco.mariotti94@gmail.com?part=3D8