Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'usb-4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
"Here are a few small USB fixes for 4.10-rc5.

Most of these are gadget/dwc2 fixes for reported issues, all of these
have been in linux-next for a while. The last one is a single xhci
WARN_ON removal to handle an issue that the dwc3 driver is hitting in
the 4.10-rc tree. The warning is harmless and needs to be removed, and
a "real" fix that is more complex will show up in 4.11-rc1 for this
device.

That last patch hasn't been in linux-next yet due to the weekend
timing, but it's a "simple" WARN_ON() removal so what could go wrong?
:)"

Famous last words.

* tag 'usb-4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
xhci: remove WARN_ON if dma mask is not set for platform devices
usb: dwc2: host: fix Wmaybe-uninitialized warning
usb: dwc2: gadget: Fix GUSBCFG.USBTRDTIM value
usb: gadget: udc: atmel: remove memory leak
usb: dwc3: exynos fix axius clock error path to do cleanup
usb: dwc2: Avoid suspending if we're in gadget mode
usb: dwc2: use u32 for DT binding parameters
usb: gadget: f_fs: Fix iterations on endpoints.
usb: dwc2: gadget: Fix DMA memory freeing
usb: gadget: composite: Fix function used to free memory

+31 -32
+2 -2
drivers/usb/dwc2/core.h
··· 513 513 /* Gadget parameters */ 514 514 bool g_dma; 515 515 bool g_dma_desc; 516 - u16 g_rx_fifo_size; 517 - u16 g_np_tx_fifo_size; 516 + u32 g_rx_fifo_size; 517 + u32 g_np_tx_fifo_size; 518 518 u32 g_tx_fifo_size[MAX_EPS_CHANNELS]; 519 519 }; 520 520
+5 -13
drivers/usb/dwc2/gadget.c
··· 3169 3169 /* keep other bits untouched (so e.g. forced modes are not lost) */ 3170 3170 usbcfg = dwc2_readl(hsotg->regs + GUSBCFG); 3171 3171 usbcfg &= ~(GUSBCFG_TOUTCAL_MASK | GUSBCFG_PHYIF16 | GUSBCFG_SRPCAP | 3172 - GUSBCFG_HNPCAP); 3172 + GUSBCFG_HNPCAP | GUSBCFG_USBTRDTIM_MASK); 3173 3173 3174 3174 if (hsotg->params.phy_type == DWC2_PHY_TYPE_PARAM_FS && 3175 3175 (hsotg->params.speed == DWC2_SPEED_PARAM_FULL || ··· 3749 3749 __func__, epctrl, epctrl_reg); 3750 3750 3751 3751 /* Allocate DMA descriptor chain for non-ctrl endpoints */ 3752 - if (using_desc_dma(hsotg)) { 3753 - hs_ep->desc_list = dma_alloc_coherent(hsotg->dev, 3752 + if (using_desc_dma(hsotg) && !hs_ep->desc_list) { 3753 + hs_ep->desc_list = dmam_alloc_coherent(hsotg->dev, 3754 3754 MAX_DMA_DESC_NUM_GENERIC * 3755 3755 sizeof(struct dwc2_dma_desc), 3756 3756 &hs_ep->desc_list_dma, GFP_ATOMIC); ··· 3872 3872 3873 3873 error2: 3874 3874 if (ret && using_desc_dma(hsotg) && hs_ep->desc_list) { 3875 - dma_free_coherent(hsotg->dev, MAX_DMA_DESC_NUM_GENERIC * 3875 + dmam_free_coherent(hsotg->dev, MAX_DMA_DESC_NUM_GENERIC * 3876 3876 sizeof(struct dwc2_dma_desc), 3877 3877 hs_ep->desc_list, hs_ep->desc_list_dma); 3878 3878 hs_ep->desc_list = NULL; ··· 3900 3900 if (ep == &hsotg->eps_out[0]->ep) { 3901 3901 dev_err(hsotg->dev, "%s: called for ep0\n", __func__); 3902 3902 return -EINVAL; 3903 - } 3904 - 3905 - /* Remove DMA memory allocated for non-control Endpoints */ 3906 - if (using_desc_dma(hsotg)) { 3907 - dma_free_coherent(hsotg->dev, MAX_DMA_DESC_NUM_GENERIC * 3908 - sizeof(struct dwc2_dma_desc), 3909 - hs_ep->desc_list, hs_ep->desc_list_dma); 3910 - hs_ep->desc_list = NULL; 3911 3903 } 3912 3904 3913 3905 epctrl_reg = dir_in ? DIEPCTL(index) : DOEPCTL(index); ··· 4123 4131 /* keep other bits untouched (so e.g. forced modes are not lost) */ 4124 4132 usbcfg = dwc2_readl(hsotg->regs + GUSBCFG); 4125 4133 usbcfg &= ~(GUSBCFG_TOUTCAL_MASK | GUSBCFG_PHYIF16 | GUSBCFG_SRPCAP | 4126 - GUSBCFG_HNPCAP); 4134 + GUSBCFG_HNPCAP | GUSBCFG_USBTRDTIM_MASK); 4127 4135 4128 4136 /* set the PLL on, remove the HNP/SRP and set the PHY */ 4129 4137 trdtim = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5;
+5 -2
drivers/usb/dwc2/hcd.c
··· 4367 4367 if (!HCD_HW_ACCESSIBLE(hcd)) 4368 4368 goto unlock; 4369 4369 4370 + if (hsotg->op_state == OTG_STATE_B_PERIPHERAL) 4371 + goto unlock; 4372 + 4370 4373 if (!hsotg->params.hibernation) 4371 4374 goto skip_power_saving; 4372 4375 ··· 4492 4489 { 4493 4490 #ifdef VERBOSE_DEBUG 4494 4491 struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd); 4495 - char *pipetype; 4496 - char *speed; 4492 + char *pipetype = NULL; 4493 + char *speed = NULL; 4497 4494 4498 4495 dev_vdbg(hsotg->dev, "%s, urb %p\n", fn_name, urb); 4499 4496 dev_vdbg(hsotg->dev, " Device address: %d\n",
+5 -5
drivers/usb/dwc2/params.c
··· 385 385 } 386 386 387 387 /** 388 - * dwc2_set_param_u16() - Set a u16 parameter 388 + * dwc2_set_param_u32() - Set a u32 parameter 389 389 * 390 390 * See dwc2_set_param(). 391 391 */ 392 - static void dwc2_set_param_u16(struct dwc2_hsotg *hsotg, u16 *param, 392 + static void dwc2_set_param_u32(struct dwc2_hsotg *hsotg, u32 *param, 393 393 bool lookup, char *property, u16 legacy, 394 394 u16 def, u16 min, u16 max) 395 395 { 396 396 dwc2_set_param(hsotg, param, lookup, property, 397 - legacy, def, min, max, 2); 397 + legacy, def, min, max, 4); 398 398 } 399 399 400 400 /** ··· 1178 1178 * auto-detect if the hardware does not support the 1179 1179 * default. 1180 1180 */ 1181 - dwc2_set_param_u16(hsotg, &p->g_rx_fifo_size, 1181 + dwc2_set_param_u32(hsotg, &p->g_rx_fifo_size, 1182 1182 true, "g-rx-fifo-size", 2048, 1183 1183 hw->rx_fifo_size, 1184 1184 16, hw->rx_fifo_size); 1185 1185 1186 - dwc2_set_param_u16(hsotg, &p->g_np_tx_fifo_size, 1186 + dwc2_set_param_u32(hsotg, &p->g_np_tx_fifo_size, 1187 1187 true, "g-np-tx-fifo-size", 1024, 1188 1188 hw->dev_nperio_tx_fifo_size, 1189 1189 16, hw->dev_nperio_tx_fifo_size);
+3 -1
drivers/usb/dwc3/dwc3-exynos.c
··· 138 138 exynos->axius_clk = devm_clk_get(dev, "usbdrd30_axius_clk"); 139 139 if (IS_ERR(exynos->axius_clk)) { 140 140 dev_err(dev, "no AXI UpScaler clk specified\n"); 141 - return -ENODEV; 141 + ret = -ENODEV; 142 + goto axius_clk_err; 142 143 } 143 144 clk_prepare_enable(exynos->axius_clk); 144 145 } else { ··· 197 196 regulator_disable(exynos->vdd33); 198 197 err2: 199 198 clk_disable_unprepare(exynos->axius_clk); 199 + axius_clk_err: 200 200 clk_disable_unprepare(exynos->susp_clk); 201 201 clk_disable_unprepare(exynos->clk); 202 202 return ret;
+1 -1
drivers/usb/gadget/composite.c
··· 2147 2147 cdev->os_desc_req->buf = kmalloc(4096, GFP_KERNEL); 2148 2148 if (!cdev->os_desc_req->buf) { 2149 2149 ret = -ENOMEM; 2150 - kfree(cdev->os_desc_req); 2150 + usb_ep_free_request(ep0, cdev->os_desc_req); 2151 2151 goto end; 2152 2152 } 2153 2153 cdev->os_desc_req->context = cdev;
+6 -6
drivers/usb/gadget/function/f_fs.c
··· 1806 1806 unsigned long flags; 1807 1807 1808 1808 spin_lock_irqsave(&func->ffs->eps_lock, flags); 1809 - do { 1809 + while (count--) { 1810 1810 /* pending requests get nuked */ 1811 1811 if (likely(ep->ep)) 1812 1812 usb_ep_disable(ep->ep); ··· 1817 1817 __ffs_epfile_read_buffer_free(epfile); 1818 1818 ++epfile; 1819 1819 } 1820 - } while (--count); 1820 + } 1821 1821 spin_unlock_irqrestore(&func->ffs->eps_lock, flags); 1822 1822 } 1823 1823 ··· 1831 1831 int ret = 0; 1832 1832 1833 1833 spin_lock_irqsave(&func->ffs->eps_lock, flags); 1834 - do { 1834 + while(count--) { 1835 1835 struct usb_endpoint_descriptor *ds; 1836 1836 int desc_idx; 1837 1837 ··· 1867 1867 1868 1868 ++ep; 1869 1869 ++epfile; 1870 - } while (--count); 1870 + } 1871 1871 spin_unlock_irqrestore(&func->ffs->eps_lock, flags); 1872 1872 1873 1873 return ret; ··· 3448 3448 3449 3449 /* cleanup after autoconfig */ 3450 3450 spin_lock_irqsave(&func->ffs->eps_lock, flags); 3451 - do { 3451 + while (count--) { 3452 3452 if (ep->ep && ep->req) 3453 3453 usb_ep_free_request(ep->ep, ep->req); 3454 3454 ep->req = NULL; 3455 3455 ++ep; 3456 - } while (--count); 3456 + } 3457 3457 spin_unlock_irqrestore(&func->ffs->eps_lock, flags); 3458 3458 kfree(func->eps); 3459 3459 func->eps = NULL;
+2 -1
drivers/usb/gadget/udc/atmel_usba_udc.c
··· 1978 1978 dev_err(&pdev->dev, "of_probe: name error(%d)\n", ret); 1979 1979 goto err; 1980 1980 } 1981 - ep->ep.name = kasprintf(GFP_KERNEL, "ep%d", ep->index); 1981 + sprintf(ep->name, "ep%d", ep->index); 1982 + ep->ep.name = ep->name; 1982 1983 1983 1984 ep->ep_regs = udc->regs + USBA_EPT_BASE(i); 1984 1985 ep->dma_regs = udc->regs + USBA_DMA_BASE(i);
+1
drivers/usb/gadget/udc/atmel_usba_udc.h
··· 280 280 void __iomem *ep_regs; 281 281 void __iomem *dma_regs; 282 282 void __iomem *fifo; 283 + char name[8]; 283 284 struct usb_ep ep; 284 285 struct usba_udc *udc; 285 286
+1 -1
drivers/usb/host/xhci-plat.c
··· 165 165 return -ENODEV; 166 166 167 167 /* Try to set 64-bit DMA first */ 168 - if (WARN_ON(!pdev->dev.dma_mask)) 168 + if (!pdev->dev.dma_mask) 169 169 /* Platform did not initialize dma_mask */ 170 170 ret = dma_coerce_mask_and_coherent(&pdev->dev, 171 171 DMA_BIT_MASK(64));