On Thu, Oct 11, 2012 at 03:20:51PM -0400, Alan Stern wrote:
> On Thu, 11 Oct 2012, Peter Chen wrote:
> 
> 
> > >   There is a port on the root hub with suspend status clear
> > >   and enabled status set (which implies there must be a device
> > >   attached to the port, because disconnected ports can't be
> > >   enabled).
> > > 
> > > Obviously if a port isn't enabled then it doesn't need any delay.
> > Is it ok to set one hcd flag, like hcd->unsuspended_device_on_port
> > to get condition at xxx_bus_suspend?
> 
> Only if you're willing to change all the host controller drivers to 
> make them set that flag!

Taking EHCI controller as an example, it just needs to change ehci_bus_resume,
if there is any enabled, unsuspended port, set hcd->unsuspended_device_on_port
> 
> usb_bus_resume() can poll the port statuses to see if there are any 
> enabled, unsuspended ports.  If there aren't any, the delay can be 
> skipped.
Taking EHCI controller as an example, you mean:

- Change hcd_bus_resume like below:

        status = hcd->driver->bus_resume(hcd);
        clear_bit(HCD_FLAG_WAKEUP_PENDING, &hcd->flags);
        if (status == 0) {
                char    buffer[6];

                status = hcd->driver->hub_status_data(hcd, buffer);
                if (status != 0) {
                        /* There are any enabled unsuspended ports */
                        /* TRSMRCY = 10 msec */
                        msleep(10);
                spin_lock_irq(&hcd_root_hub_lock);
- Add get any enabled, unsuspended port as port change condition at
ehci_hub_status_data.

> 
> How does that sound?

So, you prefer the latter one?

-- 

Best Regards,
Peter Chen

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to