Re: [Query] checking hub port status while USB 2.0 port is resuming.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 1 Jun 2018, Anshuman Gupta wrote:

> On Thu, May 31, 2018 at 03:49:46PM -0400, Alan Stern wrote:
> > On Thu, 31 May 2018, Anshuman Gupta wrote:
> > 
> > > > +		resuming_ports = hcd->driver->get_resuming_ports(hcd);
> > > > +		for (i = 0; i < hdev->maxchild; ++i) {
> > > > +			if (test_bit(i, &resuming_ports)) {
> > > > +				struct usb_port *port_dev = hub->ports[i];
> > > > +
> > > > +				pm_wakeup_event(&port_dev->dev, 0);
> > >   port_dev does not have a wakeup source, there will not any wakeup_count increment 
> > >   for port_dev, usb_dev for a particular port has wakeup source associated with it,
> > >   so using port_dev->child usb_dev instead of usb_port device. 
> > 
> > Okay.  However, there might not be a child usb_dev below the port.  For 
> > example, a wakeup signal could happen as a result of the user plugging 
> > in a new device.
>   Wake on connect/disconnect wakeup sources are basiclly root hub devices i.e. usb_dev 
>   usb1 and usb2 "/sys/bus/usb/devices/usb1/power/wakeup" 

That's right; a newly plugged-in device won't send a wakeup signal.  
All right, forget I made that comment.

> > In any case, when the system wakes up because of a signal received by a 
> > USB host controller, there should be a wakeup event associated with the 
> > host controller.  Don't you get those events?
>   There are no wakeup attributes for usb_port devices 
>   Ex. "cat /sys/bus/usb/devices/1-0\:1.0/usb1-port5/power/"
>   usb_port devcies are not wakeup capable.
>   I think wake on connect pm_wakeup_events should be handle by root hub
>   usb_dev. 

You misunderstand.  I'm talking about host controller devices like 
/sys/bus/pci/devices/0000:00:14.0.  Not usb_port devices.

These host controller devices are wakeup capable, and they are the
devices responsible for actually waking up the system when a wakeup
request is received over USB.  You should be getting wakeup events from
the controller.

> > Alan Stern
> > 
> > PS: Do you have a wakeup-capable USB-3 device?  I'm not sure that the 
> > patch will work the way you want for USB-3 devices.
> > 
>   I do not have any USB-3 wake capable device to test, but will try with 
>   USB type-c mouse,if that will be a USB 3 device, 
>   I think USB 3.0 pm_wakeup_event will be handle by 
>   https://elixir.bootlin.com/linux/latest/source/drivers/usb/core/hub.c#L66

A mouse won't be USB-3, not even a mouse with a type-C connector.

Alan Stern

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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux