diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 18ee3914b46866690ea25bf6e9d1c79f1f8bab25..8efae8b72d51258465de7b5b725559887ec7ae45 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1422,6 +1422,10 @@ static int hub_configure(struct usb_hub *hub, ret = -ENODEV; goto fail; } else if (hub->descriptor->bNbrPorts == 0) { + if (!hdev->parent) { + dev_info(hub_dev, "hub can't support USB3.0\n"); + return -ENODEV; + } message = "hub doesn't have any ports!"; ret = -ENODEV; goto fail; diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 572cf34459aa7d5133592f6aa7662aebeaceb2bd..d4dffeb86c37dd4ad181b5e843f594c2ea491755 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -40,6 +40,20 @@ #define DWC3_DEFAULT_AUTOSUSPEND_DELAY 5000 /* ms */ +/* + * Default to the number of outstanding pipelined transfer + * requests is 0x3[11:8], modify the field change to 0x7. + */ +static void dwc3_outstanding_pipe_choose(struct dwc3 *dwc) +{ + u32 reg; + + reg = dwc3_readl(dwc->regs, DWC3_GSBUSCFG1); + reg &= ~DWC3_PIPE_TRANS_LIMIT_MASK; + reg |= DWC3_PIPE_TRANS_LIMIT; + dwc3_writel(dwc->regs, DWC3_GSBUSCFG1, reg); +} + /** * dwc3_get_dr_mode - Validates and sets dr_mode * @dwc: pointer to our context structure @@ -1028,6 +1042,7 @@ static int dwc3_core_init(struct dwc3 *dwc) goto err4; } + dwc3_outstanding_pipe_choose(dwc); /* * ENDXFER polling is available on version 3.10a and later of * the DWC_usb3 controller. It is NOT available in the diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 79e1b82e5e057cf793da4ba843bd9c32ec581880..5f21d727b9402a0ed68f47a4382ab88b4ddaa8de 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -32,6 +32,8 @@ #include #define DWC3_MSG_MAX 500 +#define DWC3_PIPE_TRANS_LIMIT_MASK (0xf << 8) +#define DWC3_PIPE_TRANS_LIMIT (0x7 << 8) /* Global constants */ #define DWC3_PULL_UP_TIMEOUT 500 /* ms */ diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c index d51ea1c052f244f65148dca42efb556367f0b817..7bd6def70ff446c6d426835fb992d4de4ebe3a19 100644 --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -1263,6 +1263,9 @@ static void purge_configs_funcs(struct gadget_info *gi) list_for_each_entry_safe_reverse(f, tmp, &c->functions, list) { + if (f->disable) + f->disable(f); + list_move(&f->list, &cfg->func_list); if (f->unbind) { dev_dbg(&gi->cdev.gadget->dev, @@ -1270,6 +1273,8 @@ static void purge_configs_funcs(struct gadget_info *gi) f->name, f); f->unbind(c, f); } + if (f->bind_deactivated) + usb_function_activate(f); } c->next_interface_id = 0; memset(c->interface, 0, sizeof(c->interface));