From: Alexander Dahl <ada@thorsis.com>
To: Mark Brown <broonie@kernel.org>
Cc: Alexander Dahl <ada@thorsis.com>,
Nicolas Ferre <nicolas.ferre@microchip.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Claudiu Beznea <claudiu.beznea@tuxon.dev>,
Tudor Ambarus <tudor.ambarus@linaro.org>,
"open list:SPI SUBSYSTEM" <linux-spi@vger.kernel.org>,
"moderated list:ARM/Microchip (AT91) SoC support"
<linux-arm-kernel@lists.infradead.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] spi: atmel-quadspi: Avoid overwriting delay register settings
Date: Fri, 20 Sep 2024 10:53:23 +0200 [thread overview]
Message-ID: <20240920-jujitsu-botanical-31a58a1bc1da@thorsis.com> (raw)
In-Reply-To: <Zu0wu99Hxb-b5Xo1@finisterre.sirena.org.uk>
Hello Mark,
Am Fri, Sep 20, 2024 at 10:22:19AM +0200 schrieb Mark Brown:
> On Wed, Sep 18, 2024 at 10:27:43AM +0200, Alexander Dahl wrote:
> > Previously the MR and SCR registers were just set with the supposedly
> > required values, from cached register values (cached reg content
> > initialized to zero).
> >
> > All parts fixed here did not consider the current register (cache)
> > content, which would make future support of cs_setup, cs_hold, and
> > cs_inactive impossible.
> >
> > Setting SCBR in atmel_qspi_setup() erases a possible DLYBS setting from
> > atmel_qspi_set_cs_timing(). The DLYBS setting is applied by ORing over
> > the current setting, without resetting the bits first. All writes to MR
> > did not consider possible settings of DLYCS and DLYBCT.
> >
> > Signed-off-by: Alexander Dahl <ada@thorsis.com>
> > Fixes: f732646d0ccd ("spi: atmel-quadspi: Add support for configuring CS timing")
>
> This isn't actually a fix AFAICT since nothing yet sets any of these
> fields?
You're right if we just consider board dts files in mainline. None of
those using the atmel-quadspi driver have a spi-cs-*-delay property
set in a SPI slave device node in current master.
The changes in this patch to MR writes do not change behaviour.
For changes to SCR however I see two possible bugs:
1. if atmel_qspi_set_cs_timing() is called before atmel_qspi_setup(),
the second call just overwrites what the first call set.
2. if atmel_qspi_set_cs_timing() is called multiple times with
different values, the values written to the register from the second
call onwards are just wrong.
Maybe both are scenarios not happening in practice?
Long story short, I could just remove the Fixes line, and the rest is
fine? Or should I split up with changes for MR and SCR going to
separate patches?
Greets
Alex
next prev parent reply other threads:[~2024-09-20 8:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-18 8:27 [PATCH 0/2] spi: atmel-quadspi: Fix and add full CS delay support Alexander Dahl
2024-09-18 8:27 ` [PATCH 1/2] spi: atmel-quadspi: Avoid overwriting delay register settings Alexander Dahl
2024-09-20 8:22 ` Mark Brown
2024-09-20 8:53 ` Alexander Dahl [this message]
2024-09-26 7:25 ` Alexander Dahl
2024-09-26 7:45 ` Mark Brown
2024-09-18 8:27 ` [PATCH 2/2] spi: atmel-quadspi: Add cs_hold and cs_inactive setting support Alexander Dahl
2024-09-20 11:20 ` (subset) [PATCH 0/2] spi: atmel-quadspi: Fix and add full CS delay support Mark Brown
2024-09-30 21:42 ` Mark Brown
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=20240920-jujitsu-botanical-31a58a1bc1da@thorsis.com \
--to=ada@thorsis.com \
--cc=alexandre.belloni@bootlin.com \
--cc=broonie@kernel.org \
--cc=claudiu.beznea@tuxon.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=tudor.ambarus@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
all inboxes | Powered by JetHome®