From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-m118115.qiye.163.com (mail-m118115.qiye.163.com [115.236.118.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 808283AC0EF for ; Thu, 24 Sep 2026 03:55:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.236.118.115 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790222163; cv=none; b=MywHclZZAr9mn1b9npSCNHKw71ZdJFsHJO0hcx+qPRWT4RmDQnhIqF4Ez53Au6sMrGmTy7wE9NzKKkLpwJx5HJaxVoU8fS+2PPJ9RZOWXip5ZHoC/b3GVYfPRPdVy+Id8aFsQXrPPa6fpmpVcGs7lkWB6mXnkMiCBWeveARB6ag= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790222163; c=relaxed/simple; bh=Gii0hZt4rrHVnkIZnDUldhYQigdo3NfJ69/jkm3drzg=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=A3vinQ2A7jRQihEhPoGP9f6O2NGpNLAnBG75U7ndk9Boe8e+cP6CHCVG9wXUfmWH+iTvdvgf7DsE5cSfC2xwHgu4cJTKupIqbtpRGczK2p8AW6AyA7wBL6Z1J4WJ8aVtZKKtIKzlEnUQJUEE4qMx6iBg/bCfGhiIBDACbiJ/hoE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rock-chips.com; spf=pass smtp.mailfrom=rock-chips.com; dkim=pass (1024-bit key) header.d=rock-chips.com header.i=@rock-chips.com header.b=R2qke+wv; arc=none smtp.client-ip=115.236.118.115 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rock-chips.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rock-chips.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=rock-chips.com header.i=@rock-chips.com header.b="R2qke+wv" 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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; 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 >