Sorry for the late reply on this--I missed this message while off on another project for a while, and I'm just getting back to this.
On Fri, Feb 25, 2005 at 10:57:44AM -0500, Alan Stern wrote: > On Thu, 24 Feb 2005, Glenn Maynard wrote: > > > > It's probably not a good idea to prefer the lower-power configuration by > > > default. A better heuristic might be to prefer the highest-power > > > configuration that fits within the parent hub's power budget. > > > > A quick look suggests that doing this against the 100mA per-port cap > > should be fairly easy, but I don't know how to do this for the power > > limit of the whole hub: when the first device is inserted, it needs to > > choose a low-enough power config that we have enough for the second card > > that's not inserted yet (and, presumably, without having to second-guess > > and change the configuration later). Since the power limit of the whole > > hub appears to also be 100mA, that seems to be--for this particular > > case--"prefer the highest-power configuration <= 50mA" (100mA over 2 > > devices). Is there a better approach? > > Does this make a significant difference? Do you have devices with > separate configurations for 50mA and 100mA total power consumption? > Also, what if you want to plug in only one device and it needs the full > 100mA (or doesn't have a 50mA config)? We support USB pen drives in the wild, not specific devices, so I'm assuming they'll do every strange thing possible. David corrected the above: the power limit of each *port* is 100mA, 400mA for all four ports. We support two at once, one each for two players--one player never uses two drives. It's not useful to handle a device better when only one is in use (for example, supporting a 200mA device only when it's the only card). It's better to not support it at all, since if it seems to work in some cases, it'll cause false success reports, leading to people buying them and having problems ... > I think the "greedy" approach is probably best. Based on David's explanation, yes; I'll have it choose the highest-power configuration <= 100mA, or the lowest power configuration if none fit. (I have one pen drive, a 128mb Attache, that only reports a 200mA configuration, but seems to work fine on my bus-powered hub, even when another device is connected and set to 500mA. Since these are very common, I can't just reject devices that don't have a config <= 100mA.) I'm not sure if it helps at all that we only access one at a time--we mount a card, access it for a while, and unmount it, never mounting both cards at once. (That's a side-effect of our implementation, not really by design, but I'll probably leave it that way--it seems safer, anyway.) -- Glenn Maynard ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel