From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Date: Tue, 16 Apr 2019 10:21:48 +0200 Subject: [U-Boot] [PATCH 2/3] net: eth-uclass: Write MAC address to hardware after probe In-Reply-To: References: <20190415091047.26218-1-thierry.reding@gmail.com> <20190415091047.26218-2-thierry.reding@gmail.com> Message-ID: <20190416082148.GC10907@ulmo> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, Apr 15, 2019 at 09:24:00PM +0000, Joe Hershberger wrote: > On Mon, Apr 15, 2019 at 4:11 AM Thierry Reding wrote: > > > > From: Thierry Reding > > > > In order for the device to use the proper MAC address, which can have > > been configured in the environment prior to the device being registered, > > ensure that the MAC address is written after the device has been probed. > > For devices that are registered before the network stack is initialized, > > this is already done during eth_initialize(). If the Ethernet device is > > on a bus that is not initialized on early boot, such as PCI, the device > > is not available at the time eth_initialize() is called, so we need the > > MAC address programming to also happen after probe. > > I would expect to also see a removal of the call in eth_initialize, > right? Why do it both places? I'm hesitant to do that. eth_initialize() happens after eth_post_probe() for devices that are on a fixed bus and there may be code setting up the MAC address that runs between eth_post_probe() and eth_initialize(). If we don't write the MAC address down to hardware in eth_initialize(), we may end up regressing those boards. Thierry > > Signed-off-by: Thierry Reding > > --- > > net/eth-uclass.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/net/eth-uclass.c b/net/eth-uclass.c > > index 2ef20df19203..4225aabf1fa1 100644 > > --- a/net/eth-uclass.c > > +++ b/net/eth-uclass.c > > @@ -524,6 +524,8 @@ static int eth_post_probe(struct udevice *dev) > > #endif > > } > > > > + eth_write_hwaddr(dev); > > + > > return 0; > > } > > > > -- > > 2.21.0 > > > > _______________________________________________ > > U-Boot mailing list > > U-Boot at lists.denx.de > > https://lists.denx.de/listinfo/u-boot -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: