stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Eggers <ceggers@arri.de>
To: David Laight <David.Laight@aculab.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"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 14:03:30 +0200	[thread overview]
Message-ID: <2379124.UCELOXW4Ax@n95hx1g2> (raw)
In-Reply-To: <02cb3be60abf4a54affe239009c6e157@AcuMS.aculab.com>

On Tuesday, 28 July 2020, 13:20:15 CEST, David Laight wrote:
> From: Christian Eggers
> 
> > &spi {
> >     ....
> >     fram: fram@0 {
> >     ...
> >         mac_address_fec2: mac-address@126 {
> >             reg = <0x126 6>;
> >         };
> >     ...
> >     };
> > };
> 
> 
> Hmmmm.... the 'stride' only constrains the alignment of 'cells'.
> (ie address ranges from the device tree.)

My mac-address is not aligned to 4 bytes...

> It looks as though you can open the entire NVMEM device and
> then do reads from byte offsets.
> The 'stride' and 'word_size' are then not checked!

When I set back the stride to 4, I get the following errors:
[    6.998788] 000: nvmem spi0.00: cell mac-address unaligned to nvmem stride 4
[    6.998902] 000: at25: probe of spi0.0 failed with error -22
...
[    7.146454] 000: fec 20b4000.ethernet: Invalid MAC address: 00:00:00:00:00:00
[    7.146480] 000: fec 20b4000.ethernet: Using random MAC address: 6e:9d:37:49:6d:15

> Actually it might be that before 01973a01f9ec3 byte aligned
> 'cells' were allowed.

I use linux-5.4.x (latest), the mentioned patch has been included long time ago.

regards
Christian




      reply	other threads:[~2020-07-28 12:13 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
2020-07-28 10:30   ` Christian Eggers
2020-07-28 11:20     ` David Laight
2020-07-28 12:03       ` Christian Eggers [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=2379124.UCELOXW4Ax@n95hx1g2 \
    --to=ceggers@arri.de \
    --cc=David.Laight@aculab.com \
    --cc=arnd@arndb.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).