Commit 9b31071d authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'fixes-for-v4.12-rc2' of...

Merge tag 'fixes-for-v4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus

Felipe writes:

usb: fixes for v4.12-rc2

- New device ID for Intel Canonlake CPUs
- fix for Isochronous performance regression on dwc3
- fix for out-of-bounds access on comp_desc on f_fs
- fix for lost events on dwc3 in case of spurious interrupts
parents 2ea659a9 018047a1
...@@ -107,6 +107,10 @@ static int kdwc3_probe(struct platform_device *pdev) ...@@ -107,6 +107,10 @@ static int kdwc3_probe(struct platform_device *pdev)
return PTR_ERR(kdwc->usbss); return PTR_ERR(kdwc->usbss);
kdwc->clk = devm_clk_get(kdwc->dev, "usb"); kdwc->clk = devm_clk_get(kdwc->dev, "usb");
if (IS_ERR(kdwc->clk)) {
dev_err(kdwc->dev, "unable to get usb clock\n");
return PTR_ERR(kdwc->clk);
}
error = clk_prepare_enable(kdwc->clk); error = clk_prepare_enable(kdwc->clk);
if (error < 0) { if (error < 0) {
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#define PCI_DEVICE_ID_INTEL_APL 0x5aaa #define PCI_DEVICE_ID_INTEL_APL 0x5aaa
#define PCI_DEVICE_ID_INTEL_KBP 0xa2b0 #define PCI_DEVICE_ID_INTEL_KBP 0xa2b0
#define PCI_DEVICE_ID_INTEL_GLK 0x31aa #define PCI_DEVICE_ID_INTEL_GLK 0x31aa
#define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee
#define PCI_DEVICE_ID_INTEL_CNPH 0xa36e
#define PCI_INTEL_BXT_DSM_UUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511" #define PCI_INTEL_BXT_DSM_UUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511"
#define PCI_INTEL_BXT_FUNC_PMU_PWR 4 #define PCI_INTEL_BXT_FUNC_PMU_PWR 4
...@@ -270,6 +272,8 @@ static const struct pci_device_id dwc3_pci_id_table[] = { ...@@ -270,6 +272,8 @@ static const struct pci_device_id dwc3_pci_id_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_APL), }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_APL), },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBP), }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBP), },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_GLK), }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_GLK), },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPLP), },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPH), },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), },
{ } /* Terminating Entry */ { } /* Terminating Entry */
}; };
......
...@@ -1261,14 +1261,24 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) ...@@ -1261,14 +1261,24 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
__dwc3_gadget_start_isoc(dwc, dep, cur_uf); __dwc3_gadget_start_isoc(dwc, dep, cur_uf);
dep->flags &= ~DWC3_EP_PENDING_REQUEST; dep->flags &= ~DWC3_EP_PENDING_REQUEST;
} }
return 0;
} }
return 0;
if ((dep->flags & DWC3_EP_BUSY) &&
!(dep->flags & DWC3_EP_MISSED_ISOC)) {
WARN_ON_ONCE(!dep->resource_index);
ret = __dwc3_gadget_kick_transfer(dep,
dep->resource_index);
}
goto out;
} }
if (!dwc3_calc_trbs_left(dep)) if (!dwc3_calc_trbs_left(dep))
return 0; return 0;
ret = __dwc3_gadget_kick_transfer(dep, 0); ret = __dwc3_gadget_kick_transfer(dep, 0);
out:
if (ret == -EBUSY) if (ret == -EBUSY)
ret = 0; ret = 0;
...@@ -3026,6 +3036,15 @@ static irqreturn_t dwc3_check_event_buf(struct dwc3_event_buffer *evt) ...@@ -3026,6 +3036,15 @@ static irqreturn_t dwc3_check_event_buf(struct dwc3_event_buffer *evt)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
/*
* With PCIe legacy interrupt, test shows that top-half irq handler can
* be called again after HW interrupt deassertion. Check if bottom-half
* irq event handler completes before caching new event to prevent
* losing events.
*/
if (evt->flags & DWC3_EVENT_PENDING)
return IRQ_HANDLED;
count = dwc3_readl(dwc->regs, DWC3_GEVNTCOUNT(0)); count = dwc3_readl(dwc->regs, DWC3_GEVNTCOUNT(0));
count &= DWC3_GEVNTCOUNT_MASK; count &= DWC3_GEVNTCOUNT_MASK;
if (!count) if (!count)
......
...@@ -1858,12 +1858,12 @@ static int ffs_func_eps_enable(struct ffs_function *func) ...@@ -1858,12 +1858,12 @@ static int ffs_func_eps_enable(struct ffs_function *func)
ep->ep->driver_data = ep; ep->ep->driver_data = ep;
ep->ep->desc = ds; ep->ep->desc = ds;
comp_desc = (struct usb_ss_ep_comp_descriptor *)(ds + if (needs_comp_desc) {
USB_DT_ENDPOINT_SIZE); comp_desc = (struct usb_ss_ep_comp_descriptor *)(ds +
ep->ep->maxburst = comp_desc->bMaxBurst + 1; USB_DT_ENDPOINT_SIZE);
ep->ep->maxburst = comp_desc->bMaxBurst + 1;
if (needs_comp_desc)
ep->ep->comp_desc = comp_desc; ep->ep->comp_desc = comp_desc;
}
ret = usb_ep_enable(ep->ep); ret = usb_ep_enable(ep->ep);
if (likely(!ret)) { if (likely(!ret)) {
......
...@@ -1256,7 +1256,7 @@ static void gserial_console_exit(void) ...@@ -1256,7 +1256,7 @@ static void gserial_console_exit(void)
struct gscons_info *info = &gscons_info; struct gscons_info *info = &gscons_info;
unregister_console(&gserial_cons); unregister_console(&gserial_cons);
if (info->console_thread != NULL) if (!IS_ERR_OR_NULL(info->console_thread))
kthread_stop(info->console_thread); kthread_stop(info->console_thread);
gs_buf_free(&info->con_buf); gs_buf_free(&info->con_buf);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment