From: Heiko Stuebner <heiko@sntech.de>
To: Ulf Hansson <ulf.hansson@linaro.org>,
Shawn Lin <shawn.lin@rock-chips.com>
Cc: linux-rockchip@lists.infradead.org,
Detlev Casanova <detlev.casanova@collabora.com>,
linux-mmc@vger.kernel.org, Shawn Lin <shawn.lin@rock-chips.com>
Subject: Re: [PATCH] mmc: dw_mmc-rockchip: Fix wrong internal phase calculate
Date: Fri, 07 Nov 2025 00:02:15 +0100 [thread overview]
Message-ID: <3369161.5fSG56mABF@phil> (raw)
In-Reply-To: <1762228283-5025-1-git-send-email-shawn.lin@rock-chips.com>
Am Dienstag, 4. November 2025, 04:51:23 Mitteleuropäische Normalzeit schrieb Shawn Lin:
> ciu clock is 2 times of io clock, but the sample clk used is
> derived from io clock provided to the card. So we should use
> io clock to calculate the phase.
>
> Fixes: 59903441f5e4 ("mmc: dw_mmc-rockchip: Add internal phase support")
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
> ---
>
> drivers/mmc/host/dw_mmc-rockchip.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
> index 82dd906..6813549 100644
> --- a/drivers/mmc/host/dw_mmc-rockchip.c
> +++ b/drivers/mmc/host/dw_mmc-rockchip.c
> @@ -42,7 +42,7 @@ struct dw_mci_rockchip_priv_data {
> */
> static int rockchip_mmc_get_internal_phase(struct dw_mci *host, bool sample)
> {
> - unsigned long rate = clk_get_rate(host->ciu_clk);
> + unsigned long rate = clk_get_rate(host->ciu_clk) / RK3288_CLKGEN_DIV;
> u32 raw_value;
> u16 degrees;
> u32 delay_num = 0;
> @@ -85,7 +85,7 @@ static int rockchip_mmc_get_phase(struct dw_mci *host, bool sample)
>
> static int rockchip_mmc_set_internal_phase(struct dw_mci *host, bool sample, int degrees)
> {
> - unsigned long rate = clk_get_rate(host->ciu_clk);
> + unsigned long rate = clk_get_rate(host->ciu_clk) / RK3288_CLKGEN_DIV;
> u8 nineties, remainder;
> u8 delay_num;
> u32 raw_value;
>
prev parent reply other threads:[~2025-11-06 23:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-04 3:51 [PATCH] mmc: dw_mmc-rockchip: Fix wrong internal phase calculate Shawn Lin
2025-11-06 23:02 ` Heiko Stuebner [this message]
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=3369161.5fSG56mABF@phil \
--to=heiko@sntech.de \
--cc=detlev.casanova@collabora.com \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=shawn.lin@rock-chips.com \
--cc=ulf.hansson@linaro.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;
as well as URLs for NNTP newsgroup(s).