Skip to content
Snippets Groups Projects
Forked from Reform / reform-boundary-uboot
Source project has a limited visibility.
  • Remy Bohmer's avatar
    eba1f2fc
    Make usb-stop() safe to call multiple times in a row. · eba1f2fc
    Remy Bohmer authored
    
    A recent commit (936897d4)
    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: default avatarRemy Bohmer <linux@bohmer.net>
    Acked-by: default avatarMarkus Klotzbuecher <mk@denx.de>
    eba1f2fc
    History
    Make usb-stop() safe to call multiple times in a row.
    Remy Bohmer authored
    
    A recent commit (936897d4)
    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: default avatarRemy Bohmer <linux@bohmer.net>
    Acked-by: default avatarMarkus Klotzbuecher <mk@denx.de>