--- zzzz-none-000/linux-3.10.107/drivers/usb/renesas_usbhs/mod_host.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/usb/renesas_usbhs/mod_host.c 2021-02-04 17:41:59.000000000 +0000 @@ -111,9 +111,9 @@ container_of(usbhs_mod_get(priv, USBHS_HOST), struct usbhsh_hpriv, mod) #define __usbhsh_for_each_udev(start, pos, h, i) \ - for (i = start, pos = (h)->udev + i; \ - i < USBHSH_DEVICE_MAX; \ - i++, pos = (h)->udev + i) + for ((i) = start; \ + ((i) < USBHSH_DEVICE_MAX) && ((pos) = (h)->udev + (i)); \ + (i)++) #define usbhsh_for_each_udev(pos, hpriv, i) \ __usbhsh_for_each_udev(1, pos, hpriv, i) @@ -1229,12 +1229,13 @@ break; case GetHubDescriptor: - desc->bDescriptorType = 0x29; + desc->bDescriptorType = USB_DT_HUB; desc->bHubContrCurrent = 0; desc->bNbrPorts = roothub_id; desc->bDescLength = 9; desc->bPwrOn2PwrGood = 0; - desc->wHubCharacteristics = cpu_to_le16(0x0011); + desc->wHubCharacteristics = + cpu_to_le16(HUB_CHAR_INDV_PORT_LPSM | HUB_CHAR_NO_OCPM); desc->u.hs.DeviceRemovable[0] = (roothub_id << 1); desc->u.hs.DeviceRemovable[1] = ~0; dev_dbg(dev, "%s :: GetHubDescriptor\n", __func__); @@ -1469,13 +1470,14 @@ ret = usb_add_hcd(hcd, 0, 0); if (ret < 0) return 0; + device_wakeup_enable(hcd->self.controller); /* * pipe initialize and enable DCP */ + usbhs_fifo_init(priv); usbhs_pipe_init(priv, usbhsh_dma_map_ctrl); - usbhs_fifo_init(priv); usbhsh_pipe_init_for_host(priv); /*