From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rafal Jaworowski Date: Fri, 26 Sep 2008 10:14:19 +0200 Subject: [U-Boot] Inefficient code in NetLoop() ? In-Reply-To: <200809260955.59674.sr@denx.de> References: <20080912195058.8625324926@gemini.denx.de> <48DC7CAD.9040502@gmail.com> <20080926073653.15DEE248CD@gemini.denx.de> <200809260955.59674.sr@denx.de> Message-ID: <48DC99DB.2080806@semihalf.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Stefan Roese wrote: > On Friday 26 September 2008, Wolfgang Denk wrote: >>>> Am I reading this correctly that we eth_halt() and eth_init() the >>>> network interface for each and every call to NetLoop? >>> Yes, it looks that way. Ripe for gutting. >> I didn't have much time to look into the code, so I'm just speculating >> - maybe this is needed for switching interfaces in case of errors? > > Some ethernet interfaces (e.g. ppc4xx) need to get stopped after the network > transaction. Otherwise the interface will continue to DMA data to the buffers > and this could break OS booting. So please don't remove the eth_halt() after > the transaction is finished. I share Stefan's concerns. Isn't in general the eth_init()/eth_halt() construct because of polling mode where the network controller needs to make sure to operate in well defined states? In our deployments of using U-Boot networking facilities in standalone apps, there were problems when not doing the full eth_init()/eth_halt() sequence: without closing eth_halt() after the initial successfull transaction the network interface would choke and not work after some time, and all subsequent transfers would fail. kind regards, Rafal