From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Chanwoo Choi <cw00.choi@samsung.com>, tomasz.figa@gmail.com
Cc: linux-clk@vger.kernel.org, sboyd@kernel.org,
mturquette@baylibre.com, linux-samsung-soc@vger.kernel.org,
linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com,
m.szyprowski@samsung.com
Subject: Re: [PATCH v3] clk: samsung: Prevent potential endless loop in the PLL set_rate ops
Date: Thu, 17 Sep 2020 12:20:51 +0200 [thread overview]
Message-ID: <70db322d-4b8d-be69-0434-b1d1b3764340@samsung.com> (raw)
In-Reply-To: <c3c40d62-f5bb-6b13-0af9-ce774718eaa6@samsung.com>
On 15.09.2020 13:34, Sylwester Nawrocki wrote:
> On 14.08.2020 02:46, Chanwoo Choi wrote:
>> On 8/13/20 6:55 PM, Sylwester Nawrocki wrote:
>>> In the .set_rate callback for some PLLs there is a loop polling state
>>> of the PLL lock bit and it may become an endless loop when something
>>> goes wrong with the PLL. For some PLLs there is already code for polling
>>> with a timeout but it uses the ktime API, which doesn't work in some
>>> conditions when the set_rate op is called, in particular during
>>> initialization of the clk provider before the clocksource initialization
>>> has completed. Hence the ktime API cannot be used to reliably detect
>>> the PLL locking timeout.
>>>
>>> This patch adds a common helper function for busy waiting on the PLL lock
>>> bit with timeout detection.
>>> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
>>> ---
>>> Changes for v3:
>>> - use busy-loop with udelay() instead of ktime API
>>> Changes for v2:
>>> - use common readl_relaxed_poll_timeout_atomic() macro
>>> ---
>>> drivers/clk/samsung/clk-pll.c | 94 ++++++++++++++++---------------------------
>>> 1 file changed, 34 insertions(+), 60 deletions(-)
>> Thanks.
>>
>> Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
>
> Patch applied, thank you for your comments.
And dropped now as it causes issues on arm64. As reported by Marek
it seems udelay() doesn't work before the system timer is initialized.
prev parent reply other threads:[~2020-09-17 10:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20200813095520eucas1p209432599420d62e0e54a5545334c329c@eucas1p2.samsung.com>
2020-08-13 9:55 ` Sylwester Nawrocki
2020-08-14 0:46 ` Chanwoo Choi
2020-09-15 11:34 ` Sylwester Nawrocki
2020-09-17 10:20 ` Sylwester Nawrocki [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=70db322d-4b8d-be69-0434-b1d1b3764340@samsung.com \
--to=s.nawrocki@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=cw00.choi@samsung.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
--cc=tomasz.figa@gmail.com \
/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
all inboxes | Powered by JetHome®