From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Wed, 1 Jun 2016 10:40:31 -0600 Subject: [U-Boot] [PATCH] net: rtl8169: fix switching between adapters In-Reply-To: References: <1461706140-2768-1-git-send-email-swarren@wwwdotorg.org> Message-ID: <574F0FFF.8000602@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 04/26/2016 04:05 PM, Joe Hershberger wrote: > On Tue, Apr 26, 2016 at 4:29 PM, Stephen Warren wrote: >> From: Stephen Warren >> >> The rtl8169 driver uses a global variable to store the register address >> of the adapter being operated upon. This is updated to point at the >> correct adapter when sending or receiving a packet, or shutting down the >> adapter, but not when initializing the adapter. Consequently, switching >> between different adapters within the same U-Boot runtime does not work >> correctly since the driver programs the wrong registers during >> rtl8169_eth_start() -> rtl8169_common_start() -> rtl8169_hw_start(). >> >> Note that since rtl8169_eth_stop() does set the global variable, the >> second consecutive attempt to use the "new" adapter did work even before >> this patch, because each time network usage is shut down, the network >> core calls stop, which sets the variable so that the next start does >> actually initialize the hardware, and the adapter works. >> >> Equally, rtl8169_eth_probe() calls rtl_init() which sets the global, so >> if using only a single device, or if picking the "right" device (based on >> probe order) when multiple devices are present, ioaddr will already be set >> correctly from the get-go, so the issue does not occur. >> >> Signed-off-by: Stephen Warren > > Looks reasonable to me. > Acked-by: Joe Hershberger Joe, I assume you'll be applying this?