Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 05770C9830D for ; Thu, 24 Sep 2026 03:40:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0AB2010F2BC; Thu, 24 Sep 2026 03:40:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=rock-chips.com header.i=@rock-chips.com header.b="R2qke+wv"; dkim-atps=neutral Received: from mail-m103131191180.xmail.ntesmail.com (mail-m103131191180.xmail.ntesmail.com [103.131.191.180]) by gabe.freedesktop.org (Postfix) with ESMTPS id 09B4810F2B8 for ; Thu, 24 Sep 2026 03:40:33 +0000 (UTC) Received: from [172.16.12.74] (unknown [61.154.14.86]) by smtp.qiye.163.com (Hmail) with ESMTP id 4ef67db11; Thu, 24 Sep 2026 11:40:27 +0800 (GMT+08:00) Message-ID: Date: Thu, 24 Sep 2026 11:40:26 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RSEND] drm/bridge: analogix_dp: use devm_phy_optional_get() for the DP PHY From: Damon Ding To: Jun Yan , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Heiko Stuebner Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org References: <20260924020417.868588-1-jerrysteve1101@gmail.com> <0ef54850-6919-4a29-a8df-586a3dc2de5f@rock-chips.com> Content-Language: en-US In-Reply-To: <0ef54850-6919-4a29-a8df-586a3dc2de5f@rock-chips.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-HM-Tid: 0aa0d180169903a8kunm9636794c1822a2 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVkaGUkZVkhPTBlCHRlMHRpMGVYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlNSlVKTk9VSk9VQ01ZV1kWGg8SFR0UWUFZT0tIVUpLSU 9PT0hVSktLVUpCS0tZBg++ DKIM-Signature: a=rsa-sha256; b=R2qke+wv6KNzNLcVu0eEdHjxQszzsXDF9ACD9mTV4CxZ/ZXKWIwxNzTQqOiNNDQPFP0gCf6xZfuh0PqcHz/aMcGhDQV2s/5XbqC2H/LAfUL4btsNm1hSbcTqzUD7AsjLvtKdpEJoKLEjEHei693VjiYmqfUaLeEoYwqWUV1/7v4=; s=default; c=relaxed/relaxed; d=rock-chips.com; v=1; bh=FzcMe83hf5C3AZ1U0/2gbxcveYRvl8Cs0W878bkhmyk=; h=date:mime-version:subject:message-id:from; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 9/24/2026 11:24 AM, Damon Ding wrote: > Hi Jun, > > On 9/24/2026 10:04 AM, Jun Yan wrote: >> The DP PHY is optional: the Rockchip RK3399 eDP controller (used as the >> internal eDP port) has no separate PHY device and relies on its built-in >> PHY, which is programmed directly through the GRF registers, so its DT >> node carries no "phys"/"phy-names" property. >> >> Requesting the PHY with devm_phy_get() therefore returns -ENODEV (or >> -ENOSYS when CONFIG_GENERIC_PHY is disabled) and the driver logs a >> misleading "no DP phy configured" error at probe time before falling back >> to a NULL phy. >> >> Use devm_phy_optional_get() instead, which returns NULL when the PHY is >> absent and otherwise behaves identically, and drop the manual -ENODEV/ >> -ENOSYS handling. This also removes the spurious error message. >> >> Assisted-by: Claude:deepseek-v4-flash >> Signed-off-by: Jun Yan >> --- >>   .../gpu/drm/bridge/analogix/analogix_dp_core.c | 18 +++--------------- >>   1 file changed, 3 insertions(+), 15 deletions(-) >> >> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/ >> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c >> index 18e76d1e78e1..28eb668d3e3f 100644 >> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c >> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c >> @@ -1427,21 +1427,9 @@ analogix_dp_probe(struct device *dev, struct >> analogix_dp_plat_data *plat_data) >>       if (ret) >>           return ERR_PTR(ret); >> -    dp->phy = devm_phy_get(dp->dev, "dp"); >> -    if (IS_ERR(dp->phy)) { >> -        dev_err(dp->dev, "no DP phy configured\n"); >> -        ret = PTR_ERR(dp->phy); >> -        if (ret) { >> -            /* >> -             * phy itself is not enabled, so we can move forward >> -             * assigning NULL to phy pointer. >> -             */ >> -            if (ret == -ENOSYS || ret == -ENODEV) >> -                dp->phy = NULL; >> -            else >> -                return ERR_PTR(ret); >> -        } >> -    } > > It should be better to add some comments here: > > /* >  * Exynos5/RK3288/RK3399 use Analogix DP controller built-in PHY, >  * no separate PHY configuration is needed. >  */ Well, I think it should be fixed to: /* * RK3288/RK3399 use Analogix DP controller built-in PHY, * no extra PHY configuration is required. */ The Exynos5xxx case may be more complex. > >> +    dp->phy = devm_phy_optional_get(dp->dev, "dp"); >> +    if (IS_ERR(dp->phy)) >> +        return ERR_CAST(dp->phy); >>       dp->clock = devm_clk_get(&pdev->dev, "dp"); >>       if (IS_ERR(dp->clock)) { > > With the comment added: > Reviewed-by: Damon Ding > > Best regards, > Damon >