On Tue, May 10, 2022 at 07:00:54AM +0530, Pavan Kondeti wrote: > btw, should we add an else block here to take care of companion controllers > associcated if any. Can you pls tell us if it is possible that we have all > the below cases together? should the companion check be done only when > shared_hcd is not present? > > - primary HCD (USB2.0, EHCI/XHCI) > - secondary HCD (USB3.0 XHCI) > - hs_companion (USB2.0 companion) for OHCI/UHCI > > unsigned int usb_hcd_wakeup_enabled_descendants(struct usb_hcd *hcd) > { > unsigned int nr_wakeup; > > nr_wakeup = usb_wakeup_enabled_descendants(hcd->self.root_hub); > > if (hcd->shared_hcd) > nr_wakeup += usb_wakeup_enabled_descendants(hcd->shared_hcd->self.root_hub); > else if (hcd->self.hs_companion) > nr_wakeup += usb_wakeup_enabled_descendants(hcd->self.hs_companion->root_hub); No, this is wrong. Companion controllers do not contribute to the descendant count. You should ignore them. Alan Stern