devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: Rob Herring <robh@kernel.org>
Cc: Andrew Lunn <andrew@lunn.ch>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Frank Rowand <frowand.list@gmail.com>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Ansuel Smith <ansuelsmth@gmail.com>
Subject: Re: [PATCH net-next 1/3] dt-bindings: net: add nvmem-mac-address-offset property
Date: Wed, 12 May 2021 17:27:28 +0200	[thread overview]
Message-ID: <362f1c6a8b0ec191b285ac6a604500da@walle.cc> (raw)
In-Reply-To: <fefde522146d18aa7f8fbb8fa698cb58@walle.cc>

[adding Srinivas Kandagatla and Ansuel Smith]

Am 2021-04-16 00:27, schrieb Michael Walle:
> Am 2021-04-15 23:59, schrieb Rob Herring:
>> On Wed, Apr 14, 2021 at 05:43:49PM +0200, Andrew Lunn wrote:
>>> On Wed, Apr 14, 2021 at 05:26:55PM +0200, Michael Walle wrote:
>>> > It is already possible to read the MAC address via a NVMEM provider. But
>>> > there are boards, esp. with many ports, which only have a base MAC
>>> > address stored. Thus we need to have a way to provide an offset per
>>> > network device.
>>> 
>>> We need to see what Rob thinks of this. There was recently a patchset
>>> to support swapping the byte order of the MAC address in a NVMEM. Rob
>>> said the NVMEM provider should have the property, not the MAC driver.
>>> This does seems more ethernet specific, so maybe it should be an
>>> Ethernet property?
>> 
>> There was also this one[1]. I'm not totally opposed, but don't want to
>> see a never ending addition of properties to try to describe any
>> possible transformation.
> 
> Agreed, that stuff like ASCII MAC address parsing should be done
> elsewhere. But IMHO adding an offset is a pretty common one (as also
> pointed out in [1]). And it also need to be a per ethernet device
> property.

I'm a bit up in the air on this, as I don't know how to proceed here.

To cite Rob from IRC:
   Not really up to me. All the people that care need to come up with
   something flexible enough for common/simple cases and that's not
   going to get extended with every new variation. What I don't want is
   a one-off that's then extended with another one-off.

I already pointed out that this property is per consumer as opposed
to something like endianess swap or parsing a given format. The latter
operates on the nvmem cell.

One random idea is to have a nvmem-cells-transformation (in the lack of
a better name) property for consumers, where you can have some kind of
simple operations like add:
   nvmem-cells-transformation = <NVMEM_ADD 1>
But is that something we really want to have? I'm not sure.

btw. given that there might be other means where a base mac address can
come from in the future, it might make sense to drop the "nvmem-"
prefix and just use "mac-address-offset" (or 
"base-mac-address-offset"?).

> [1] 
> https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20200920095724.8251-4-ansuelsmth@gmail.com/

-michael

  reply	other threads:[~2021-05-12 16:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14 15:26 [PATCH net-next 0/3] net: add support for an offset of a nvmem provided MAC address Michael Walle
2021-04-14 15:26 ` [PATCH net-next 1/3] dt-bindings: net: add nvmem-mac-address-offset property Michael Walle
2021-04-14 15:43   ` Andrew Lunn
2021-04-15 21:59     ` Rob Herring
2021-04-15 22:27       ` Michael Walle
2021-05-12 15:27         ` Michael Walle [this message]
2021-04-15 23:45       ` Florian Fainelli
2021-04-14 15:26 ` [PATCH net-next 2/3] net: add helper eth_addr_add() Michael Walle
2021-04-14 15:26 ` [PATCH net-next 3/3] net: implement nvmem-mac-address-offset DT property Michael Walle

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=362f1c6a8b0ec191b285ac6a604500da@walle.cc \
    --to=michael@walle.cc \
    --cc=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=srinivas.kandagatla@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;
as well as URLs for NNTP newsgroup(s).