From: Stephen Boyd <sboyd@kernel.org>
To: Abel Vesa <abelvesa@kernel.org>,
Aisheng Dong <aisheng.dong@nxp.com>,
Fabio Estevam <festevam@gmail.com>,
Michael Turquette <mturquette@baylibre.com>,
Peng Fan (OSS) <peng.fan@oss.nxp.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Sascha Hauer <s.hauer@pengutronix.de>,
Shawn Guo <shawnguo@kernel.org>
Cc: linux-clk@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>,
Jacky Bai <ping.bai@nxp.com>
Subject: Re: [PATCH 4/4] clk: imx: fracn-gppll: fix pll power up
Date: Wed, 16 Oct 2024 14:49:55 -0700 [thread overview]
Message-ID: <4c7956afc86ea05f07b25d98ffb5b80c.sboyd@kernel.org> (raw)
In-Reply-To: <20241014-imx-clk-v1-v1-4-ee75876d3102@nxp.com>
Quoting Peng Fan (OSS) (2024-10-14 02:11:25)
> From: Peng Fan <peng.fan@nxp.com>
>
> To i.MX93 which features dual Cortex-A55 cores and DSU, when using
> writel_relaxed to write value to PLL registers, the value might be
> buffered. To make sure the value has been written into the hardware,
> using readl to read back the register could make sure the value
> written into hardware.
>
> current PLL power up flow can be simplified as below:
> 1. writel_relaxed to set the PLL POWERUP bit;
> 2. readl_poll_timeout to check the PLL lock bit:
> a). timeout = ktime_add_us(ktime_get(), timeout_us);
> b). readl the pll the lock reg;
> c). check if the pll lock bit ready
> d). check if timeout
>
> But in some corner cases, both the write in step 1 and read in
> step 2 will be blocked by other bus transaction in the SoC for a
> long time, saying the value into real hardware is just before step b).
> That means the timeout counting has begins for quite sometime since
> step a), but value still not written into real hardware until bus
> released just at a point before step b).
>
> Then there maybe chances that the pll lock bit is not ready
> when readl done but the timeout happens. readl_poll_timeout will
> err return due to timeout. To avoid such unexpected failure,
> read back the reg to make sure the write has been done in HW
> reg.
>
> Introduce fence_write for this purpose.
Please just write out the readl() instead of introducing a bespoke macro
that isn't generic for all architectures.
prev parent reply other threads:[~2024-10-16 21:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 9:11 [PATCH 0/4] clk: imx: scu and fracn pll update Peng Fan (OSS)
2024-10-14 9:11 ` [PATCH 1/4] clk: imx: lpcg-scu: SW workaround for errata (e10858) Peng Fan (OSS)
2024-10-14 14:20 ` Fabio Estevam
2024-10-15 2:25 ` Peng Fan
2024-10-16 21:46 ` Stephen Boyd
2024-10-14 9:11 ` [PATCH 2/4] clk: imx: lpcg-scu: Skip HDMI LPCG clock save/restore Peng Fan (OSS)
2024-10-14 9:11 ` [PATCH 3/4] clk: imx: fracn-gppll: correct PLL initialization flow Peng Fan (OSS)
2024-10-14 9:11 ` [PATCH 4/4] clk: imx: fracn-gppll: fix pll power up Peng Fan (OSS)
2024-10-16 21:49 ` Stephen Boyd [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=4c7956afc86ea05f07b25d98ffb5b80c.sboyd@kernel.org \
--to=sboyd@kernel.org \
--cc=abelvesa@kernel.org \
--cc=aisheng.dong@nxp.com \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=peng.fan@nxp.com \
--cc=peng.fan@oss.nxp.com \
--cc=ping.bai@nxp.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@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;
as well as URLs for NNTP newsgroup(s).