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

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

Felipe writes:

usb: fixes for v3.17-rc2

Here's our first set of fixes for v3.17-rc cycle. Most fixes are
pretty minor changes like the signedness bug in dwc3, or the wrong
string format on MUSB.

The most interesting part is the addition of Intel Quark X1000 support
to PCH UDC.

Signed-of-by: Felipe Balbi <balbi@ti.com>

+51 -27
+1 -1
drivers/usb/dwc3/dwc3-omap.c
··· 425 425 426 426 static int dwc3_omap_extcon_register(struct dwc3_omap *omap) 427 427 { 428 - u32 ret; 428 + int ret; 429 429 struct device_node *node = omap->dev->of_node; 430 430 struct extcon_dev *edev; 431 431
+1 -1
drivers/usb/gadget/Makefile
··· 3 3 # 4 4 subdir-ccflags-$(CONFIG_USB_GADGET_DEBUG) := -DDEBUG 5 5 subdir-ccflags-$(CONFIG_USB_GADGET_VERBOSE) += -DVERBOSE_DEBUG 6 - ccflags-y += -I$(PWD)/drivers/usb/gadget/udc 6 + ccflags-y += -Idrivers/usb/gadget/udc 7 7 8 8 obj-$(CONFIG_USB_LIBCOMPOSITE) += libcomposite.o 9 9 libcomposite-y := usbstring.o config.o epautoconf.o
+2 -2
drivers/usb/gadget/function/Makefile
··· 2 2 # USB peripheral controller drivers 3 3 # 4 4 5 - ccflags-y := -I$(PWD)/drivers/usb/gadget/ 6 - ccflags-y += -I$(PWD)/drivers/usb/gadget/udc/ 5 + ccflags-y := -Idrivers/usb/gadget/ 6 + ccflags-y += -Idrivers/usb/gadget/udc/ 7 7 8 8 # USB Functions 9 9 usb_f_acm-y := f_acm.o
-3
drivers/usb/gadget/function/u_ether.c
··· 1127 1127 1128 1128 DBG(dev, "%s\n", __func__); 1129 1129 1130 - netif_tx_lock(dev->net); 1131 1130 netif_stop_queue(dev->net); 1132 - netif_tx_unlock(dev->net); 1133 - 1134 1131 netif_carrier_off(dev->net); 1135 1132 1136 1133 /* disable endpoints, forcing (synchronous) completion
+3
drivers/usb/gadget/function/uvc_video.c
··· 195 195 printk(KERN_INFO "Failed to queue request (%d).\n", ret); 196 196 usb_ep_set_halt(ep); 197 197 spin_unlock_irqrestore(&video->queue.irqlock, flags); 198 + uvc_queue_cancel(queue, 0); 198 199 goto requeue; 199 200 } 200 201 spin_unlock_irqrestore(&video->queue.irqlock, flags); ··· 282 281 static int 283 282 uvc_video_pump(struct uvc_video *video) 284 283 { 284 + struct uvc_video_queue *queue = &video->queue; 285 285 struct usb_request *req; 286 286 struct uvc_buffer *buf; 287 287 unsigned long flags; ··· 324 322 printk(KERN_INFO "Failed to queue request (%d)\n", ret); 325 323 usb_ep_set_halt(video->ep); 326 324 spin_unlock_irqrestore(&video->queue.irqlock, flags); 325 + uvc_queue_cancel(queue, 0); 327 326 break; 328 327 } 329 328 spin_unlock_irqrestore(&video->queue.irqlock, flags);
+3 -3
drivers/usb/gadget/legacy/Makefile
··· 2 2 # USB gadget drivers 3 3 # 4 4 5 - ccflags-y := -I$(PWD)/drivers/usb/gadget/ 6 - ccflags-y += -I$(PWD)/drivers/usb/gadget/udc/ 7 - ccflags-y += -I$(PWD)/drivers/usb/gadget/function/ 5 + ccflags-y := -Idrivers/usb/gadget/ 6 + ccflags-y += -Idrivers/usb/gadget/udc/ 7 + ccflags-y += -Idrivers/usb/gadget/function/ 8 8 9 9 g_zero-y := zero.o 10 10 g_audio-y := audio.o
+2
drivers/usb/gadget/legacy/dbgp.c
··· 222 222 { 223 223 #ifdef CONFIG_USB_G_DBGP_SERIAL 224 224 kfree(dbgp.serial); 225 + dbgp.serial = NULL; 225 226 #endif 226 227 if (dbgp.req) { 227 228 kfree(dbgp.req->buf); 228 229 usb_ep_free_request(gadget->ep0, dbgp.req); 230 + dbgp.req = NULL; 229 231 } 230 232 231 233 gadget->ep0->driver_data = NULL;
+1 -1
drivers/usb/gadget/legacy/inode.c
··· 440 440 441 441 value = -ENOMEM; 442 442 kbuf = memdup_user(buf, len); 443 - if (!kbuf) { 443 + if (IS_ERR(kbuf)) { 444 444 value = PTR_ERR(kbuf); 445 445 goto free1; 446 446 }
+2 -1
drivers/usb/gadget/udc/Kconfig
··· 332 332 gadget drivers to also be dynamically linked. 333 333 334 334 config USB_EG20T 335 - tristate "Intel EG20T PCH/LAPIS Semiconductor IOH(ML7213/ML7831) UDC" 335 + tristate "Intel QUARK X1000/EG20T PCH/LAPIS Semiconductor IOH(ML7213/ML7831) UDC" 336 336 depends on PCI 337 337 help 338 338 This is a USB device driver for EG20T PCH. ··· 353 353 ML7213/ML7831 is companion chip for Intel Atom E6xx series. 354 354 ML7213/ML7831 is completely compatible for Intel EG20T PCH. 355 355 356 + This driver can be used with Intel's Quark X1000 SOC platform 356 357 # 357 358 # LAST -- dummy/emulated controller 358 359 #
+1 -1
drivers/usb/gadget/udc/atmel_usba_udc.c
··· 1661 1661 if (dma_status) { 1662 1662 int i; 1663 1663 1664 - for (i = 1; i < USBA_NR_DMAS; i++) 1664 + for (i = 1; i <= USBA_NR_DMAS; i++) 1665 1665 if (dma_status & (1 << i)) 1666 1666 usba_dma_irq(udc, &udc->usba_ep[i]); 1667 1667 }
+6 -2
drivers/usb/gadget/udc/fusb300_udc.c
··· 1398 1398 1399 1399 /* initialize udc */ 1400 1400 fusb300 = kzalloc(sizeof(struct fusb300), GFP_KERNEL); 1401 - if (fusb300 == NULL) 1401 + if (fusb300 == NULL) { 1402 + ret = -ENOMEM; 1402 1403 goto clean_up; 1404 + } 1403 1405 1404 1406 for (i = 0; i < FUSB300_MAX_NUM_EP; i++) { 1405 1407 _ep[i] = kzalloc(sizeof(struct fusb300_ep), GFP_KERNEL); 1406 - if (_ep[i] == NULL) 1408 + if (_ep[i] == NULL) { 1409 + ret = -ENOMEM; 1407 1410 goto clean_up; 1411 + } 1408 1412 fusb300->ep[i] = _ep[i]; 1409 1413 } 1410 1414
+19 -3
drivers/usb/gadget/udc/pch_udc.c
··· 343 343 * @setup_data: Received setup data 344 344 * @phys_addr: of device memory 345 345 * @base_addr: for mapped device memory 346 + * @bar: Indicates which PCI BAR for USB regs 346 347 * @irq: IRQ line for the device 347 348 * @cfg_data: current cfg, intf, and alt in use 348 349 * @vbus_gpio: GPIO informaton for detecting VBUS ··· 371 370 struct usb_ctrlrequest setup_data; 372 371 unsigned long phys_addr; 373 372 void __iomem *base_addr; 373 + unsigned bar; 374 374 unsigned irq; 375 375 struct pch_udc_cfg_data cfg_data; 376 376 struct pch_vbus_gpio_data vbus_gpio; 377 377 }; 378 378 #define to_pch_udc(g) (container_of((g), struct pch_udc_dev, gadget)) 379 379 380 + #define PCH_UDC_PCI_BAR_QUARK_X1000 0 380 381 #define PCH_UDC_PCI_BAR 1 381 382 #define PCI_DEVICE_ID_INTEL_EG20T_UDC 0x8808 383 + #define PCI_DEVICE_ID_INTEL_QUARK_X1000_UDC 0x0939 382 384 #define PCI_VENDOR_ID_ROHM 0x10DB 383 385 #define PCI_DEVICE_ID_ML7213_IOH_UDC 0x801D 384 386 #define PCI_DEVICE_ID_ML7831_IOH_UDC 0x8808 ··· 3080 3076 iounmap(dev->base_addr); 3081 3077 if (dev->mem_region) 3082 3078 release_mem_region(dev->phys_addr, 3083 - pci_resource_len(pdev, PCH_UDC_PCI_BAR)); 3079 + pci_resource_len(pdev, dev->bar)); 3084 3080 if (dev->active) 3085 3081 pci_disable_device(pdev); 3086 3082 kfree(dev); ··· 3148 3144 dev->active = 1; 3149 3145 pci_set_drvdata(pdev, dev); 3150 3146 3147 + /* Determine BAR based on PCI ID */ 3148 + if (id->device == PCI_DEVICE_ID_INTEL_QUARK_X1000_UDC) 3149 + dev->bar = PCH_UDC_PCI_BAR_QUARK_X1000; 3150 + else 3151 + dev->bar = PCH_UDC_PCI_BAR; 3152 + 3151 3153 /* PCI resource allocation */ 3152 - resource = pci_resource_start(pdev, 1); 3153 - len = pci_resource_len(pdev, 1); 3154 + resource = pci_resource_start(pdev, dev->bar); 3155 + len = pci_resource_len(pdev, dev->bar); 3154 3156 3155 3157 if (!request_mem_region(resource, len, KBUILD_MODNAME)) { 3156 3158 dev_err(&pdev->dev, "%s: pci device used already\n", __func__); ··· 3221 3211 } 3222 3212 3223 3213 static const struct pci_device_id pch_udc_pcidev_id[] = { 3214 + { 3215 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 3216 + PCI_DEVICE_ID_INTEL_QUARK_X1000_UDC), 3217 + .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe, 3218 + .class_mask = 0xffffffff, 3219 + }, 3224 3220 { 3225 3221 PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EG20T_UDC), 3226 3222 .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe,
+2 -2
drivers/usb/gadget/udc/r8a66597-udc.c
··· 1868 1868 1869 1869 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1870 1870 reg = devm_ioremap_resource(&pdev->dev, res); 1871 - if (!reg) 1872 - return -ENODEV; 1871 + if (IS_ERR(reg)) 1872 + return PTR_ERR(reg); 1873 1873 1874 1874 ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 1875 1875 irq = ires->start;
+1 -1
drivers/usb/musb/ux500_dma.c
··· 96 96 struct musb *musb = ux500_channel->controller->private_data; 97 97 98 98 dev_dbg(musb->controller, 99 - "packet_sz=%d, mode=%d, dma_addr=0x%llu, len=%d is_tx=%d\n", 99 + "packet_sz=%d, mode=%d, dma_addr=0x%llx, len=%d is_tx=%d\n", 100 100 packet_sz, mode, (unsigned long long) dma_addr, 101 101 len, ux500_channel->is_tx); 102 102
+1 -3
drivers/usb/phy/phy-gpio-vbus-usb.c
··· 260 260 261 261 gpio_vbus->phy.otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg), 262 262 GFP_KERNEL); 263 - if (!gpio_vbus->phy.otg) { 264 - kfree(gpio_vbus); 263 + if (!gpio_vbus->phy.otg) 265 264 return -ENOMEM; 266 - } 267 265 268 266 platform_set_drvdata(pdev, gpio_vbus); 269 267 gpio_vbus->dev = &pdev->dev;
+2 -2
drivers/usb/phy/phy-msm-usb.c
··· 1601 1601 */ 1602 1602 if (motg->phy_number) { 1603 1603 phy_select = devm_ioremap_nocache(&pdev->dev, USB2_PHY_SEL, 4); 1604 - if (IS_ERR(phy_select)) 1605 - return PTR_ERR(phy_select); 1604 + if (!phy_select) 1605 + return -ENOMEM; 1606 1606 /* Enable second PHY with the OTG port */ 1607 1607 writel(0x1, phy_select); 1608 1608 }
+1 -1
drivers/usb/phy/phy-samsung-usb.h
··· 216 216 217 217 #define EXYNOS5_DRD_PHYPARAM1 (0x20) 218 218 219 - #define PHYPARAM1_PCS_TXDEEMPH_MASK (0x1f << 0) 219 + #define PHYPARAM1_PCS_TXDEEMPH_MASK (0x3f << 0) 220 220 #define PHYPARAM1_PCS_TXDEEMPH (0x1c) 221 221 222 222 #define EXYNOS5_DRD_PHYTERM (0x24)
+3
drivers/usb/phy/phy.c
··· 232 232 phy = __usb_find_phy_dev(dev, &phy_bind_list, index); 233 233 if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { 234 234 dev_dbg(dev, "unable to find transceiver\n"); 235 + if (!IS_ERR(phy)) 236 + phy = ERR_PTR(-ENODEV); 237 + 235 238 goto err0; 236 239 } 237 240