From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Santhosh Kumar K <s-k6@ti.com>
Cc: <broonie@kernel.org>, <robh@kernel.org>, <krzk+dt@kernel.org>,
<conor+dt@kernel.org>, <richard@nod.at>, <vigneshr@ti.com>,
<tudor.ambarus@linaro.org>, <pratyush@kernel.org>,
<mwalle@kernel.org>, <linux-spi@vger.kernel.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-mtd@lists.infradead.org>, <praneeth@ti.com>,
<u-kumar1@ti.com>, <p-mantena@ti.com>, <a-dutta@ti.com>,
Frieder Schrempf <frieder.schrempf@kontron.de>,
Eberhard Stoll <eberhard.stoll@kontron.de>,
Subject: Re: [RFC PATCH v2 11/12] spi: cadence-quadspi: restrict PHY frequency to tuned operations
Date: Tue, 17 Mar 2026 16:17:06 +0100 [thread overview]
Message-ID: <87zf46cwp9.fsf@bootlin.com> (raw)
In-Reply-To: <874inlxde0.fsf@bootlin.com> (Miquel Raynal's message of "Fri, 13 Feb 2026 09:21:11 +0100")
Hi Santhosh,
+ Frieder and Eberhard
On 13/02/2026 at 09:21:11 +01, Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> On 07/02/2026 at 00:57:04 +0530, Santhosh Kumar K <s-k6@ti.com> wrote:
>
>> On 05/02/26 23:17, Miquel Raynal wrote:
>>> Hi Santhosh,
>>>
>>>> + /*
>>>> + * PHY tuning allows high-frequency operation only for calibrated
>>>> + * commands. Uncalibrated operations use safe non-PHY frequency to
>>>> + * avoid timing violations.
>>>> + */
>>>> + if (cqspi->ddata->execute_tuning && f_pdata->use_phy &&
>>>> + (cqspi_op_matches_tuned(op, &f_pdata->phy_read_op) ||
>>>> + cqspi_op_matches_tuned(op, &f_pdata->phy_write_op))) {
>>>> + cqspi_configure(f_pdata, op->max_freq);
>>>> + } else if (cqspi->ddata->execute_tuning) {
>>>> + /* Use safe frequency for untuned operations */
>>>> + cqspi_configure(f_pdata, f_pdata->non_phy_clk_rate);
>>>> + } else {
>>>> + /* No tuning support, always use requested frequency */
>>>> + cqspi_configure(f_pdata, op->max_freq);
>>>> + }
>>> Shouldn't we handle this at the core level? We know what kind of
>>> operation pattern we provided, so it is easy to set the correct
>>> frequency in the operation structure.
>>> Can you please make this happen? Perhaps you can return the operation
>>> frequency once the calibration is successful (in the read and write op
>>> templates maybe?) so this can be picked up by the core and used for the
>>> following operations. This way the controller driver no longer needs to
>>> check if the operation has been tuned or not, it can just look at the
>>> frequency. When using the highest frequency, PHY tuning must be
>>> used/enabled, otherwise not.
>>
>> No, Miquel, this may not be correct. There can be cases where an
>> operation does not require tuning but still can run at maximum
>> frequency (166 MHz, for instance).
>
> This is currently not the case. Currently you tune for one or two ops
> (read/write) and you enable PHY tuning only on these. Do you plan on
> adding such a feature? If not, I would not bother with this now.
>
>> In such scenarios, simply setting
>> op->max_freq to the maximum frequency value and deciding whether to
>> enable tuning based on an op->max_freq comparison would not be
>> sufficient.
>
> If there are such cases, can they be listed? I am sorry but I fail to
> see where this would not work. Any examples to share?
I don't know if you got my feedback, but I would like to have all cases
in mind to decide in which direction we must go. Especially, I would
like to make the bridge with Frieder's work who is also "playing" with
the maximum frequency.
We need to clarify our mental picture of the max_freq handling. How it
should be derived, how autonomous shall the SPI controllers be wrt this
value, shall we flag operations that can go faster and if yes, can we
attach a meaningful value to these operations, etc etc.
I feel like this is the part that needs extra thinking. The rest of the
series is promising. I would like us to clarify the needs, maybe propose
some kind of drawing/slides or even take half an hour to discuss in a
call once we have all cases in mind.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2026-03-17 15:17 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 14:16 [RFC PATCH v2 00/12] spi: cadence-quadspi: add PHY tuning support Santhosh Kumar K
2026-01-13 14:16 ` [RFC PATCH v2 01/12] spi: dt-bindings: add spi-has-dqs property Santhosh Kumar K
2026-02-04 10:46 ` Miquel Raynal
2026-02-05 17:46 ` Santhosh Kumar K
2026-02-05 18:06 ` Miquel Raynal
2026-01-13 14:16 ` [RFC PATCH v2 02/12] spi: spi-mem: add controller tuning support Santhosh Kumar K
2026-01-13 14:16 ` [RFC PATCH v2 03/12] mtd: spinand: perform controller tuning during probe Santhosh Kumar K
2026-02-05 17:35 ` Miquel Raynal
2026-02-06 19:23 ` Santhosh Kumar K
2026-01-13 14:16 ` [RFC PATCH v2 04/12] mtd: spi-nor: extract read operation setup into helper Santhosh Kumar K
2026-01-13 14:16 ` [RFC PATCH v2 05/12] mtd: spi-nor: perform controller tuning during probe Santhosh Kumar K
2026-01-13 14:16 ` [RFC PATCH v2 06/12] spi: cadence-quadspi: move cqspi_readdata_capture earlier Santhosh Kumar K
2026-02-05 17:35 ` Miquel Raynal
2026-01-13 14:16 ` [RFC PATCH v2 07/12] spi: cadence-quadspi: add DQS support to read data capture Santhosh Kumar K
2026-02-05 17:35 ` Miquel Raynal
2026-01-13 14:16 ` [RFC PATCH v2 08/12] spi: cadence-quadspi: read 'has-dqs' DT property Santhosh Kumar K
2026-02-05 17:35 ` Miquel Raynal
2026-02-19 12:14 ` Michael Walle
2026-02-20 8:21 ` Miquel Raynal
2026-01-13 14:16 ` [RFC PATCH v2 09/12] spi: cadence-quadspi: add PHY tuning infrastructure Santhosh Kumar K
2026-02-05 17:39 ` Miquel Raynal
2026-02-06 19:25 ` Santhosh Kumar K
2026-02-13 8:18 ` Miquel Raynal
2026-02-18 18:07 ` Santhosh Kumar K
2026-02-19 10:30 ` Miquel Raynal
2026-02-09 9:48 ` Michael Walle
2026-02-12 10:50 ` Miquel Raynal
2026-02-12 11:14 ` Michael Walle
2026-02-12 12:55 ` Miquel Raynal
2026-02-18 18:07 ` Santhosh Kumar K
2026-02-19 8:33 ` Michael Walle
2026-02-19 10:34 ` Miquel Raynal
2026-01-13 14:16 ` [RFC PATCH v2 10/12] spi: cadence-quadspi: implement PHY tuning algorithm Santhosh Kumar K
2026-02-05 17:42 ` Miquel Raynal
2026-01-13 14:16 ` [RFC PATCH v2 11/12] spi: cadence-quadspi: restrict PHY frequency to tuned operations Santhosh Kumar K
2026-02-05 17:47 ` Miquel Raynal
2026-02-06 19:27 ` Santhosh Kumar K
2026-02-13 8:21 ` Miquel Raynal
2026-03-17 15:17 ` Miquel Raynal [this message]
2026-01-13 14:16 ` [RFC PATCH v2 12/12] spi: cadence-quadspi: enable PHY for direct reads and writes Santhosh Kumar K
2026-02-05 17:51 ` Miquel Raynal
2026-02-04 10:29 ` [RFC PATCH v2 00/12] spi: cadence-quadspi: add PHY tuning support Miquel Raynal
2026-02-05 15:48 ` Miquel Raynal
2026-02-06 19:28 ` Santhosh Kumar K
2026-02-13 9:01 ` Miquel Raynal
2026-02-18 18:08 ` Santhosh Kumar K
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=87zf46cwp9.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=a-dutta@ti.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=eberhard.stoll@kontron.de \
--cc=frieder.schrempf@kontron.de \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=mwalle@kernel.org \
--cc=p-mantena@ti.com \
--cc=praneeth@ti.com \
--cc=pratyush@kernel.org \
--cc=richard@nod.at \
--cc=robh@kernel.org \
--cc=s-k6@ti.com \
--cc=tudor.ambarus@linaro.org \
--cc=u-kumar1@ti.com \
--cc=vigneshr@ti.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