From: Stephen Boyd <sboyd@kernel.org>
To: Daniel Mack <daniel@zonque.org>, mturquette@baylibre.com
Cc: linux-clk@vger.kernel.org, robh+dt@kernel.org,
devicetree@vger.kernel.org, kuninori.morimoto.gx@renesas.com,
Daniel Mack <daniel@zonque.org>
Subject: Re: [PATCH v2 2/2] clk: cs2000-cp: make PLL lock timeout configurable
Date: Mon, 29 Aug 2022 18:49:06 -0700 [thread overview]
Message-ID: <20220830014909.64D78C433D6@smtp.kernel.org> (raw)
In-Reply-To: <20220826091122.2344503-2-daniel@zonque.org>
Quoting Daniel Mack (2022-08-26 02:11:22)
> The driver currently does 256 iterations of reads from the DEVICE_CTRL
> register to wait for the PLL_LOCK bit to clear, and sleeps one
> microsecond after each attempt.
>
> This isn't ideal because
>
> a) the total time this allows for the device to settle depends on the I2C
> bus speed, and
> b) the device might need more time, depending on the application.
>
> This patch allows users to configure this timeout through a new device-tree
> property "cirrus,pll-lock-timeout-ms".
It's a timeout, so why not just increase the timeout regardless of
everything else? Or can we parse the bus speed (100kHz or 400kHz)
instead of adding a new property?
>
> In order to not break existing applications, a default value of 100 ms is
> assumed: For each read cycle, 8 bits are sent for the register address, and
> 8 bits are read with the values. 16 bits take about 160 us on a 100 kHz bus
> and 40 us on a 400 kHz bus. Hence 256 iterations would take a maximum of
> around 44 ms. Round up and double that value to be on the safe side.
>
next prev parent reply other threads:[~2022-08-30 1:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-26 9:11 [PATCH v2 1/2] dt-bindings: clock: cs2000-cp: Document cirrus,pll-lock-timeout-ms Daniel Mack
2022-08-26 9:11 ` [PATCH v2 2/2] clk: cs2000-cp: make PLL lock timeout configurable Daniel Mack
2022-08-30 1:49 ` Stephen Boyd [this message]
2022-08-30 20:25 ` Rob Herring
2022-08-31 13:25 ` Daniel Mack
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=20220830014909.64D78C433D6@smtp.kernel.org \
--to=sboyd@kernel.org \
--cc=daniel@zonque.org \
--cc=devicetree@vger.kernel.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-clk@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=robh+dt@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).