On Tue, May 10, 2022 at 11:22:17AM -0400, Alan Stern wrote: > On Tue, May 10, 2022 at 06:46:02AM +0530, Pavan Kondeti wrote: > > On Mon, May 09, 2022 at 10:33:59AM -0400, Alan Stern wrote: > > > On Mon, May 09, 2022 at 07:53:41PM +0530, Pavan Kondeti wrote: > > > > On Mon, May 09, 2022 at 10:08:41AM -0400, Alan Stern wrote: > > > > > BTW, if there's any trouble with getting device_wakeup_path() to work > > > > > the way you want, you could consider instead calling > > > > > usb_wakeup_enabled_descendants() on the root hub. This function returns > > > > > a count of the number of wakeup-enabled USB devices at or below the > > > > > device you pass to it. > > > > > > > > > > > > > This series [1] started with usb_wakeup_enabled_descendants() actually. one > > > > of the problem with this API is that we have to call this on both USB2.0 and > > > > USB3.0 root hubs. Do you think we can have a wrapper function like > > > > usb_hcd_wakeup_enabled_descendants() that accepts hcd as an argument and > > > > internally call usb_wakeup_enabled_descendants() on both root hubs and return > > > > the result. > > > > > > Sure you can. Feel free to write such a function and add it to hcd.c. > > > Ideally it should work for host controllers with any number of root > > > hubs, just adding up the number of wakeup-enabled descendants for all of > > > them. > > > > > Thanks Alan for the suggestion. Does the below diff looks good? > > It looks fine, aside from lacking any comments/kerneldoc. > Thanks for taking a look. Sure, I will add comments and kerneldoc for this API, if we plan to use it. Thanks, Pavan