public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Make "usb start" only start / scan usb once ?
@ 2014-11-26 12:44 Hans de Goede
  2014-12-31 18:05 ` Marek Vasut
  0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2014-11-26 12:44 UTC (permalink / raw)
  To: u-boot

Hi,

Currently we've this magic in include/config_distro_bootcmd.h to avoid
scanning the usb bus multiple times.

And it does not work when also using an usb keyboard because then the
preboot command has already scanned the bus, so we're still scanning it
twice.

While discussing my latest attempt at fixing this:

http://patchwork.ozlabs.org/patch/413394/
http://patchwork.ozlabs.org/patch/413395/

With Ian, Ian said why not simply make "usb start" keep track of if it
already has started things, and then we can remove all the magic for it
from include/config_distro_bootcmd.h and just call it unconditionally.

This would also cause "usb start" and "usb reset" to actually do something
different, where as currently they are 100% the same.

I must say I like this idea, the only downside is, that it could be seen
as a break of the u-boot cmdline API, one could easily argue it is not,
because usb will be started by "usb start" if necessary, and people can
still force a rescan with "usb reset".

So any input on this, specifically would a patch-set to make "usb start"
start usb only once (per boot) be acceptable ?

Regards,

Hans

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot] Make "usb start" only start / scan usb once ?
  2014-11-26 12:44 [U-Boot] Make "usb start" only start / scan usb once ? Hans de Goede
@ 2014-12-31 18:05 ` Marek Vasut
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2014-12-31 18:05 UTC (permalink / raw)
  To: u-boot

On Wednesday, November 26, 2014 at 01:44:23 PM, Hans de Goede wrote:
> Hi,

Hello Hans,

> Currently we've this magic in include/config_distro_bootcmd.h to avoid
> scanning the usb bus multiple times.
> 
> And it does not work when also using an usb keyboard because then the
> preboot command has already scanned the bus, so we're still scanning it
> twice.
> 
> While discussing my latest attempt at fixing this:
> 
> http://patchwork.ozlabs.org/patch/413394/
> http://patchwork.ozlabs.org/patch/413395/
> 
> With Ian, Ian said why not simply make "usb start" keep track of if it
> already has started things, and then we can remove all the magic for it
> from include/config_distro_bootcmd.h and just call it unconditionally.
> 
> This would also cause "usb start" and "usb reset" to actually do something
> different, where as currently they are 100% the same.
> 
> I must say I like this idea, the only downside is, that it could be seen
> as a break of the u-boot cmdline API, one could easily argue it is not,
> because usb will be started by "usb start" if necessary, and people can
> still force a rescan with "usb reset".
> 
> So any input on this, specifically would a patch-set to make "usb start"
> start usb only once (per boot) be acceptable ?

It just makes a lot of sense, so yes. You're right it'd break the command
like API and it might be a surprise to some, but you're also right that the
current "way of things" is confusing and possibly even wrong.

Apologies I got back to you so late.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-31 18:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-26 12:44 [U-Boot] Make "usb start" only start / scan usb once ? Hans de Goede
2014-12-31 18:05 ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox