From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
Aradhya Bhatia <aradhya.bhatia@linux.dev>,
Parth Pancholi <parth.pancholi@toradex.com>,
Jayesh Choudhary <j-choudhary@ti.com>,
Vinod Koul <vkoul@kernel.org>, Devarsh Thakkar <devarsht@ti.com>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.17.y 1/3] phy: cdns-dphy: Store hs_clk_rate and return it
Date: Tue, 21 Oct 2025 12:02:05 -0400 [thread overview]
Message-ID: <20251021160207.2330991-1-sashal@kernel.org> (raw)
In-Reply-To: <2025101625-laborer-imaging-a408@gregkh>
From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
[ Upstream commit 689a54acb56858c85de8c7285db82b8ae6dbf683 ]
The DPHY driver does not return the actual hs_clk_rate, so the DSI
driver has no idea what clock was actually achieved. Set the realized
hs_clk_rate to the opts struct, so that the DSI driver gets it back.
Reviewed-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
Tested-by: Parth Pancholi <parth.pancholi@toradex.com>
Tested-by: Jayesh Choudhary <j-choudhary@ti.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://lore.kernel.org/r/20250723-cdns-dphy-hs-clk-rate-fix-v1-1-d4539d44cbe7@ideasonboard.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Stable-dep-of: 2c27aaee934a ("phy: cadence: cdns-dphy: Update calibration wait time for startup state machine")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/cadence/cdns-dphy.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/phy/cadence/cdns-dphy.c b/drivers/phy/cadence/cdns-dphy.c
index ed87a3970f834..f79ec4fab4093 100644
--- a/drivers/phy/cadence/cdns-dphy.c
+++ b/drivers/phy/cadence/cdns-dphy.c
@@ -79,6 +79,7 @@ struct cdns_dphy_cfg {
u8 pll_ipdiv;
u8 pll_opdiv;
u16 pll_fbdiv;
+ u32 hs_clk_rate;
unsigned int nlanes;
};
@@ -154,6 +155,9 @@ static int cdns_dsi_get_dphy_pll_cfg(struct cdns_dphy *dphy,
cfg->pll_ipdiv,
pll_ref_hz);
+ cfg->hs_clk_rate = div_u64((u64)pll_ref_hz * cfg->pll_fbdiv,
+ 2 * cfg->pll_opdiv * cfg->pll_ipdiv);
+
return 0;
}
@@ -297,6 +301,7 @@ static int cdns_dphy_config_from_opts(struct phy *phy,
if (ret)
return ret;
+ opts->hs_clk_rate = cfg->hs_clk_rate;
opts->wakeup = cdns_dphy_get_wakeup_time_ns(dphy) / 1000;
return 0;
--
2.51.0
next prev parent reply other threads:[~2025-10-21 16:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-16 13:07 FAILED: patch "[PATCH] phy: cadence: cdns-dphy: Update calibration wait time for" failed to apply to 6.17-stable tree gregkh
2025-10-21 16:02 ` Sasha Levin [this message]
2025-10-21 16:02 ` [PATCH 6.17.y 2/3] phy: cadence: cdns-dphy: Fix PLL lock and O_CMN_READY polling Sasha Levin
2025-10-21 16:02 ` [PATCH 6.17.y 3/3] phy: cadence: cdns-dphy: Update calibration wait time for startup state machine Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251021160207.2330991-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=aradhya.bhatia@linux.dev \
--cc=devarsht@ti.com \
--cc=j-choudhary@ti.com \
--cc=parth.pancholi@toradex.com \
--cc=stable@vger.kernel.org \
--cc=tomi.valkeinen@ideasonboard.com \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox