From: David Laight <David.Laight@ACULAB.COM>
To: 'Christian Eggers' <ceggers@arri.de>,
Arnd Bergmann <arnd@arndb.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH] eeprom: at25: set minimum read/write access stride to 1
Date: Tue, 28 Jul 2020 09:52:05 +0000 [thread overview]
Message-ID: <a65b01608fb34c5c8782b301c2e0cabc@AcuMS.aculab.com> (raw)
In-Reply-To: <20200728092959.24600-1-ceggers@arri.de>
From: Christian Eggers
> Sent: 28 July 2020 10:30
>
> SPI eeproms are addressed by byte.
They also support multi-byte writes - possibly with alignment
restrictions.
So forcing 4-byte writes (at aligned addresses) would typically
speed up writes by a factor of 4 over byte writes.
So does this fix a problem?
If so what.
So setting the 'stride' to 4 may be a compromise.
Looking at some code that writes the EPCQ for Altera FPGA
(which I think is just SPI) it does aligned 256 byte writes.
The long writes (and the 4-bit physical interface) are needed
to get the write times down to a sensible value.
David
>
> Signed-off-by: Christian Eggers <ceggers@arri.de>
> Cc: stable@vger.kernel.org
> ---
> drivers/misc/eeprom/at25.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
> index 0e7c8dc01195..4e57eb145fcc 100644
> --- a/drivers/misc/eeprom/at25.c
> +++ b/drivers/misc/eeprom/at25.c
> @@ -358,7 +358,7 @@ static int at25_probe(struct spi_device *spi)
> at25->nvmem_config.reg_read = at25_ee_read;
> at25->nvmem_config.reg_write = at25_ee_write;
> at25->nvmem_config.priv = at25;
> - at25->nvmem_config.stride = 4;
> + at25->nvmem_config.stride = 1;
> at25->nvmem_config.word_size = 1;
> at25->nvmem_config.size = chip.byte_len;
>
> --
> Christian Eggers
> Embedded software developer
>
> Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
> Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918
> Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
> Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477
> Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2020-07-28 9:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-28 9:29 [PATCH] eeprom: at25: set minimum read/write access stride to 1 Christian Eggers
2020-07-28 9:52 ` David Laight [this message]
2020-07-28 10:30 ` Christian Eggers
2020-07-28 11:20 ` David Laight
2020-07-28 12:03 ` Christian Eggers
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=a65b01608fb34c5c8782b301c2e0cabc@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=arnd@arndb.de \
--cc=ceggers@arri.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.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).