From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus =?iso-8859-1?Q?Klotzb=FCcher?= Date: Tue, 9 Sep 2008 16:35:00 +0200 Subject: [U-Boot] [patch 1/1] Make usb-stop() safe to call multiple times in a row. In-Reply-To: <20080820092551.478336687@bohmer.net> References: <20080820092201.706131869@bohmer.net>> <20080820092551.478336687@bohmer.net> Message-ID: <20080909143500.GA11987@lisa> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Aug 20, 2008 at 11:22:02AM +0200, Remy Bohmer wrote: > A recent commit (936897d4d1365452bbbdf8430db5e7769ef08d38) > enabled the usb_stop() command in common/cmd_bootm.c which was > not enabled for some time, because no board did actually set the > CFG_CMD_USB flag. So, now the usb_stop() is executed before > loading the linux kernel. > > However, the usb_ohci driver hangs up (at least on AT91SAM) if the > driver is stopped twice (e.g. the peripheral clock is stopped on AT91). > If some other piece of code calls usb_stop() before the bootm command, > this command will hangup the system during boot. > (usb start and stop is typically used while booting from usb memory stick) > > But, stopping the usb stack twice is useless anyway, and a flag already > existed that kept track on the usb_init()/usb_stop() calls. > So, we now check if the usb stack is really started before we stop it. > > This problem is now fixed in both the upper as low-level layer. > > Signed-off-by: Remy Bohmer Acked-by: Markus Klotzbuecher Wolfgang, please apply! Best regards Markus -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de")