From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 C427BC2BA1A for ; Tue, 18 Jun 2024 11:25:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sfCtfIg/3fZTn7PLSAPScJD1Nmkrbs2MhSuDeZ+eN04=; b=ZK9xTUAsIVAp4CoZWJTi/f1mum tpgjvQsKUDs3Hh05OYOql34soPXNvJSOiaU+UVU8Ijz8xmngWoxXymhnZuAUEEv8wiIUs5fMGFKUz l4Muzg//dExQecSlBNzNknkw6pIYhPn642fdm5evC68EAqBuVaySgqMPNJu3oKGhkTBDHQijRDga2 J/CRGpRAxb4nwNdrLrAh3klzVekKoUjBHVVby81s2uODkUXJrr8DpEn3HqBRdI1Ogu0pYfKyFXQL2 W2OdN1aQZF9FbaPFK/Hv4IkHREcoPq4MLaPuPGle+Iomhp/wzDT0+XJ/rqmCTAG4+CZ4j/R9Y0tvT R3arVMKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJWxm-0000000EbwL-3FRP; Tue, 18 Jun 2024 11:25:22 +0000 Received: from madrid.collaboradmins.com ([46.235.227.194]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJWxj-0000000Ebuk-3ulh; Tue, 18 Jun 2024 11:25:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718709917; bh=laBbGW8u+C3wkt52DJVoyFfKIQuH6xetOZoiKmaKf20=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=AACNMWpJM4WRVJIsfDww72SFiSALFZZ5AdyZm+2NGuGCfsy5fYf8cOVvYQ3wAU3Qo L/xCpy6rAKSFMNimFaCXcfttYFR++8IRzmk6NE8jtBPMosoFk4JF5bRUfqXY0HOXW8 NdDfVGxF5nqJ1KCkNhJSnvCdvIO6pHRlByaVagXDs8ARYVIj7RQmUwCBFM1arQYMsy 9hRlIUexe4XcwuG6oSlkBaP97yTc4ZoETNJAumFMvo/wAKAQH3Rn7c7oidVyR+TLAq NLJQB5k1XXrl2cORp7Bfkedr+OdLGe+iSqVYH/oyLZNV9ijARWvO4iz+JHc5VnszGr YCefW+0Mj5opQ== Received: from [100.115.223.179] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id D33A5378217B; Tue, 18 Jun 2024 11:25:16 +0000 (UTC) Message-ID: Date: Tue, 18 Jun 2024 14:25:16 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/4] phy: phy-rockchip-samsung-hdptx: Add clock provider support To: =?UTF-8?Q?Heiko_St=C3=BCbner?= , Vinod Koul , Kishon Vijay Abraham I , Algea Cao , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: kernel@collabora.com, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20240618-rk3588-hdmiphy-clkprov-v1-0-80e4aa12177e@collabora.com> <20240618-rk3588-hdmiphy-clkprov-v1-4-80e4aa12177e@collabora.com> <2910644.FA0FI3ke8A@diego> Content-Language: en-US From: Cristian Ciocaltea In-Reply-To: <2910644.FA0FI3ke8A@diego> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240618_042520_135329_8C28B751 X-CRM114-Status: GOOD ( 12.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 6/18/24 10:55 AM, Heiko Stübner wrote: > Am Montag, 17. Juni 2024, 23:48:12 CEST schrieb Cristian Ciocaltea: >> The HDMI PHY PLL can be used as an alternative dclk source to RK3588 SoC >> CRU. It provides more accurate clock rates required by VOP2 to improve >> existing support for display modes handling, which is known to be >> problematic when dealing with non-integer refresh rates, among others. >> >> It is worth noting this only works for HDMI 2.0 or below, e.g. cannot be >> used to support HDMI 2.1 4K@120Hz mode. >> >> Signed-off-by: Cristian Ciocaltea >> --- >> drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c | 189 +++++++++++++++++++--- >> 1 file changed, 167 insertions(+), 22 deletions(-) >> >> diff --git a/drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c b/drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c >> index 72de287282eb..ad3fd4084377 100644 >> --- a/drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c >> +++ b/drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c > >> static int rk_hdptx_phy_power_on(struct phy *phy) >> { >> struct rk_hdptx_phy *hdptx = phy_get_drvdata(phy); >> int bus_width = phy_get_bus_width(hdptx->phy); >> + int ret; >> + >> /* >> * FIXME: Temporary workaround to pass pixel_clk_rate >> * from the HDMI bridge driver until phy_configure_opts_hdmi >> @@ -871,20 +925,18 @@ static int rk_hdptx_phy_power_on(struct phy *phy) >> dev_dbg(hdptx->dev, "%s bus_width=%x rate=%u\n", >> __func__, bus_width, rate); >> >> - return rk_hdptx_ropll_tmds_mode_config(hdptx, rate); >> + ret = rk_hdptx_phy_consumer_get(hdptx, rate); >> + if (!ret) >> + ret = rk_hdptx_ropll_tmds_mode_config(hdptx, rate); > > I think this will need a put if _mode_config fails? Indeed, a forced put variant would be required to ignore any regmap_read() errors and keep usage_count decremented. This should be also used in rk_hdptx_phy_clk_unprepare(), since ->unprepare() callback cannot fail. Will get this fixed in v2. Thanks for reviewing! Cristian