From: Arnd Bergmann <arnd@arndb.de>
To: Tony Lindgren <tony@atomide.com>
Cc: Andy Green <andy.green@linaro.org>,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
nicolas.pitre@linaro.org, s-jan@ti.com, patches@linaro.org,
rostedt@goodmis.org
Subject: Re: [PATCH 2/3] OMAP2+ devices add mac address allocation register api
Date: Fri, 29 Jun 2012 15:05:06 +0000 [thread overview]
Message-ID: <201206291505.07249.arnd@arndb.de> (raw)
In-Reply-To: <20120629145203.GJ4202@atomide.com>
On Friday 29 June 2012, Tony Lindgren wrote:
> > A lot of devices already provide the mac address in the device tree,
> > wherever that comes from. Ideally that would always be possible but
> > never necessary.
> >
> > > > I'm not sure what it takes to add the link for the device node in the
> > > > usb probing code, but my feeling is that it's not too hard.
> > > >
> > > > Right now, USB is probed entirely without DT, so the patch is about
> > > > the best we can do.
> > >
> > > Right, but that still assumes a static mac from the bootloader unless
> > > we do a generic driver as below? Or do you have some other ideas?
> >
> > The boot loader could theoretically have the same algorithm that Andy's
> > patch implements, unless it is configured to something else by the
> > user. In many cases, you don't want the boot loader to be that smart,
> > but sometimes it is the right solution.
>
> OK that would mean bootloader modifying the .dtb then.
Right.
> > In the device tree, we can uniquely identify the USB hosts, that
> > is not a problem here. The problem exists only if you base your
> > path on the linux specific name for the devices.
> > It's definitely ugly to rely on that, but I think we can actually
> > guarantee that it's stable as long as we enforce in the
> > Kconfig/Kbuild that the controller that has the ethernet device
> > is always built-in on Panda and comes before the other one if
> > both are built-in. I would much prefer not to have to rely on
> > those things, but I believe it is actually guaranteed at the
> > moment for the cases that matter. While you could have both
> > controllers as loadable modules and load them in reverse
> > order that would also imply that you cannot actually boot from
> > the network, so you know that you have a file system on which
> > you can set the mac address of the device using udev, before
> > you start using networking.
>
> OK. So how about we do the following:
>
> 1. Make Andy's notifier part into a generic mac notifier
> driver that can take platform data for the driver name
> mac address pair. Devicetree binding could be added as
> needed.
I don't think the devicetree bindign should be part of that
driver but instead should go into the individual network
device drivers, otherwise it sounds ok to me.
Obviously, this still needs buy-in from the networking
people.
> 2. Pass the Panda mac information as platform data to this
> driver for now with a comment on the usb path naming being
> potentially wrong in the loadable modules case.
IMHO code outside of the platform driver world would be more
appropriate here. It's not actually a platform device because
it's more of an abstract concept to define a mac address than
physical hardware.
A new file with a single global function in net/ethernet/
that you can use to register a callback sounds like the
easiest approach to me.
> 3. Add devicetree support to the driver once the USB binding
> is available.
Here you mean the smsc95xx driver, not the new code, right?
> That will make my life much easier as then I'm not stuck with
> more legacy code to deal with ;) Also writing the driver part
> should be trivial as all the code is there already.
Sounds ok to me, if we can get Andy to reshuffle his code once
more ;-)
Arnd
WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] OMAP2+ devices add mac address allocation register api
Date: Fri, 29 Jun 2012 15:05:06 +0000 [thread overview]
Message-ID: <201206291505.07249.arnd@arndb.de> (raw)
In-Reply-To: <20120629145203.GJ4202@atomide.com>
On Friday 29 June 2012, Tony Lindgren wrote:
> > A lot of devices already provide the mac address in the device tree,
> > wherever that comes from. Ideally that would always be possible but
> > never necessary.
> >
> > > > I'm not sure what it takes to add the link for the device node in the
> > > > usb probing code, but my feeling is that it's not too hard.
> > > >
> > > > Right now, USB is probed entirely without DT, so the patch is about
> > > > the best we can do.
> > >
> > > Right, but that still assumes a static mac from the bootloader unless
> > > we do a generic driver as below? Or do you have some other ideas?
> >
> > The boot loader could theoretically have the same algorithm that Andy's
> > patch implements, unless it is configured to something else by the
> > user. In many cases, you don't want the boot loader to be that smart,
> > but sometimes it is the right solution.
>
> OK that would mean bootloader modifying the .dtb then.
Right.
> > In the device tree, we can uniquely identify the USB hosts, that
> > is not a problem here. The problem exists only if you base your
> > path on the linux specific name for the devices.
> > It's definitely ugly to rely on that, but I think we can actually
> > guarantee that it's stable as long as we enforce in the
> > Kconfig/Kbuild that the controller that has the ethernet device
> > is always built-in on Panda and comes before the other one if
> > both are built-in. I would much prefer not to have to rely on
> > those things, but I believe it is actually guaranteed at the
> > moment for the cases that matter. While you could have both
> > controllers as loadable modules and load them in reverse
> > order that would also imply that you cannot actually boot from
> > the network, so you know that you have a file system on which
> > you can set the mac address of the device using udev, before
> > you start using networking.
>
> OK. So how about we do the following:
>
> 1. Make Andy's notifier part into a generic mac notifier
> driver that can take platform data for the driver name
> mac address pair. Devicetree binding could be added as
> needed.
I don't think the devicetree bindign should be part of that
driver but instead should go into the individual network
device drivers, otherwise it sounds ok to me.
Obviously, this still needs buy-in from the networking
people.
> 2. Pass the Panda mac information as platform data to this
> driver for now with a comment on the usb path naming being
> potentially wrong in the loadable modules case.
IMHO code outside of the platform driver world would be more
appropriate here. It's not actually a platform device because
it's more of an abstract concept to define a mac address than
physical hardware.
A new file with a single global function in net/ethernet/
that you can use to register a callback sounds like the
easiest approach to me.
> 3. Add devicetree support to the driver once the USB binding
> is available.
Here you mean the smsc95xx driver, not the new code, right?
> That will make my life much easier as then I'm not stuck with
> more legacy code to deal with ;) Also writing the driver part
> should be trivial as all the code is there already.
Sounds ok to me, if we can get Andy to reshuffle his code once
more ;-)
Arnd
next prev parent reply other threads:[~2012-06-29 15:05 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-29 5:55 [PATCH 0/3] Add ability to set defaultless network device MAC addresses to deterministic computed locally administered values Andy Green
2012-06-29 5:55 ` Andy Green
2012-06-29 5:55 ` [PATCH 1/3] OMAP2+: add cpu id register to MAC address helper Andy Green
2012-06-29 5:55 ` Andy Green
2012-06-29 9:05 ` Tony Lindgren
2012-06-29 9:05 ` Tony Lindgren
2012-06-29 9:13 ` Andy Green
2012-06-29 9:13 ` Andy Green
2012-06-29 5:55 ` [PATCH 2/3] OMAP2+ devices add mac address allocation register api Andy Green
2012-06-29 5:55 ` Andy Green
2012-06-29 8:51 ` Arnd Bergmann
2012-06-29 8:51 ` Arnd Bergmann
2012-06-29 9:03 ` Andy Green
2012-06-29 9:03 ` Andy Green
2012-06-29 9:40 ` Tony Lindgren
2012-06-29 9:40 ` Tony Lindgren
2012-06-29 10:07 ` Andy Green
2012-06-29 10:07 ` Andy Green
2012-06-29 12:03 ` Tony Lindgren
2012-06-29 12:03 ` Tony Lindgren
2012-06-29 13:45 ` Arnd Bergmann
2012-06-29 13:45 ` Arnd Bergmann
2012-06-29 13:55 ` Tony Lindgren
2012-06-29 13:55 ` Tony Lindgren
2012-06-29 13:59 ` Andy Green
2012-06-29 13:59 ` Andy Green
2012-06-29 14:33 ` Arnd Bergmann
2012-06-29 14:33 ` Arnd Bergmann
2012-06-29 14:52 ` Tony Lindgren
2012-06-29 14:52 ` Tony Lindgren
2012-06-29 15:05 ` Arnd Bergmann [this message]
2012-06-29 15:05 ` Arnd Bergmann
2012-07-01 8:58 ` Tony Lindgren
2012-07-01 8:58 ` Tony Lindgren
2012-07-02 7:15 ` Arnd Bergmann
2012-07-02 7:15 ` Arnd Bergmann
2012-07-02 10:51 ` Tony Lindgren
2012-07-02 10:51 ` Tony Lindgren
2012-06-29 14:03 ` Andy Green
2012-06-29 14:03 ` Andy Green
2012-06-29 14:38 ` Arnd Bergmann
2012-06-29 14:38 ` Arnd Bergmann
2012-06-29 5:55 ` [PATCH 3/3] OMAP4 PANDA register ethernet and wlan for automatic mac allocation Andy Green
2012-06-29 5:55 ` Andy Green
2012-06-29 11:55 ` Tony Lindgren
2012-06-29 11:55 ` Tony Lindgren
2012-06-29 8:50 ` [PATCH 0/3] Add ability to set defaultless network device MAC addresses to deterministic computed locally administered values Arnd Bergmann
2012-06-29 8:50 ` Arnd Bergmann
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=201206291505.07249.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=andy.green@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=nicolas.pitre@linaro.org \
--cc=patches@linaro.org \
--cc=rostedt@goodmis.org \
--cc=s-jan@ti.com \
--cc=tony@atomide.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.