On 4/20/23 11:21 PM, WeitaoWang-oc@xxxxxxxxxxx wrote: >>> Add U1/U2 feature support of xHCI for zhaoxin. >>> >>> Signed-off-by: Weitao Wang <WeitaoWang-oc@xxxxxxxxxxx> >> [...] >> >>> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c >>> index 6307bae9cddf..730c0f68518d 100644 >>> --- a/drivers/usb/host/xhci.c >>> +++ b/drivers/usb/host/xhci.c >> [...] >>> @@ -4938,6 +4938,27 @@ static int xhci_update_timeout_for_interface(struct xhci_hcd *xhci, >>> return 0; >>> } >>> +static int xhci_check_zhaoxin_tier_policy(struct usb_device *udev, >>> + enum usb3_link_state state) >>> +{ >>> + struct usb_device *parent; >>> + unsigned int num_hubs; >>> + >>> + /* Don't enable U1/U2 if the device is on an external hub. */ >>> + for (parent = udev->parent, num_hubs = 0; parent->parent; >>> + parent = parent->parent) >>> + num_hubs++; >>> + >>> + if (num_hubs < 1) >>> + return 0; >>> + >>> + dev_dbg(&udev->dev, "Disabling U1/U2 link state for device" >>> + " below external hub.\n"); >>> + dev_dbg(&udev->dev, "Plug device into root hub " >>> + "to decrease power consumption.\n"); >> >> Please don't break up the message strings. > > Thanks for your advice, and I will merge this message in next patch version. >> [...] >>> @@ -4965,6 +4986,8 @@ static int xhci_check_tier_policy(struct xhci_hcd *xhci, >>> { >>> if (xhci->quirks & XHCI_INTEL_HOST) >>> return xhci_check_intel_tier_policy(udev, state); >>> + else if (xhci->quirks & XHCI_ZHAOXIN_HOST) >> >> *else* not needed after *return*. > This function need a "int" type return value. If remove "else" branch, > vendor other than intel and zhaoxin will not get a return value. I didn't tell you to remove the whole branch, just the *else* keyword. [...] > Best Regards, > Weitao MBR, Sergey