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

Configure Feed

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

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

Felipe writes:

usb: fixes for v3.12-rc2

Here's first set of fixes for v3.12-rc series, patches have
been soaking in linux-usb for a while now.

We have the usual sparse and build warnings, a Kconfig fix
to a mismerge on dwc3 Kconfig, fix for a possible memory leak
in dwc3, s3c-hsotg won't disconnect when bus goes idle, locking
fix in mv_u3d_core, endpoint disable fix in f_mass_storage.

We also have one device ID added to dwc3's PCI glue layer in order
to support Intel's BayTrail devices.

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

+28 -45
-1
drivers/usb/dwc3/Kconfig
··· 1 1 config USB_DWC3 2 2 tristate "DesignWare USB3 DRD Core Support" 3 3 depends on (USB || USB_GADGET) && HAS_DMA 4 - depends on EXTCON 5 4 select USB_XHCI_PLATFORM if USB_SUPPORT && USB_XHCI_HCD 6 5 help 7 6 Say Y or M here if your system has a Dual Role SuperSpeed
+2
drivers/usb/dwc3/dwc3-pci.c
··· 28 28 /* FIXME define these in <linux/pci_ids.h> */ 29 29 #define PCI_VENDOR_ID_SYNOPSYS 0x16c3 30 30 #define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3 0xabcd 31 + #define PCI_DEVICE_ID_INTEL_BYT 0x0f37 31 32 32 33 struct dwc3_pci { 33 34 struct device *dev; ··· 188 187 PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS, 189 188 PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3), 190 189 }, 190 + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT), }, 191 191 { } /* Terminating Entry */ 192 192 }; 193 193 MODULE_DEVICE_TABLE(pci, dwc3_pci_id_table);
+2 -4
drivers/usb/dwc3/gadget.c
··· 2611 2611 ret = usb_add_gadget_udc(dwc->dev, &dwc->gadget); 2612 2612 if (ret) { 2613 2613 dev_err(dwc->dev, "failed to register udc\n"); 2614 - goto err5; 2614 + goto err4; 2615 2615 } 2616 2616 2617 2617 return 0; 2618 2618 2619 - err5: 2620 - dwc3_gadget_free_endpoints(dwc); 2621 - 2622 2619 err4: 2620 + dwc3_gadget_free_endpoints(dwc); 2623 2621 dma_free_coherent(dwc->dev, DWC3_EP0_BOUNCE_SIZE, 2624 2622 dwc->ep0_bounce, dwc->ep0_bounce_addr); 2625 2623
+1 -18
drivers/usb/gadget/cdc2.c
··· 113 113 c->bmAttributes |= USB_CONFIG_ATT_WAKEUP; 114 114 } 115 115 116 - fi_ecm = usb_get_function_instance("ecm"); 117 - if (IS_ERR(fi_ecm)) { 118 - status = PTR_ERR(fi_ecm); 119 - goto err_func_ecm; 120 - } 121 - 122 116 f_ecm = usb_get_function(fi_ecm); 123 117 if (IS_ERR(f_ecm)) { 124 118 status = PTR_ERR(f_ecm); ··· 123 129 if (status) 124 130 goto err_add_ecm; 125 131 126 - fi_serial = usb_get_function_instance("acm"); 127 - if (IS_ERR(fi_serial)) { 128 - status = PTR_ERR(fi_serial); 129 - goto err_get_acm; 130 - } 131 - 132 132 f_acm = usb_get_function(fi_serial); 133 133 if (IS_ERR(f_acm)) { 134 134 status = PTR_ERR(f_acm); 135 - goto err_func_acm; 135 + goto err_get_acm; 136 136 } 137 137 138 138 status = usb_add_function(c, f_acm); 139 139 if (status) 140 140 goto err_add_acm; 141 - 142 141 return 0; 143 142 144 143 err_add_acm: 145 144 usb_put_function(f_acm); 146 - err_func_acm: 147 - usb_put_function_instance(fi_serial); 148 145 err_get_acm: 149 146 usb_remove_function(c, f_ecm); 150 147 err_add_ecm: 151 148 usb_put_function(f_ecm); 152 149 err_get_ecm: 153 - usb_put_function_instance(fi_ecm); 154 - err_func_ecm: 155 150 return status; 156 151 } 157 152
+4 -3
drivers/usb/gadget/dummy_hcd.c
··· 923 923 struct dummy_hcd *dum_hcd = gadget_to_dummy_hcd(g); 924 924 struct dummy *dum = dum_hcd->dum; 925 925 926 - dev_dbg(udc_dev(dum), "unregister gadget driver '%s'\n", 927 - driver->driver.name); 926 + if (driver) 927 + dev_dbg(udc_dev(dum), "unregister gadget driver '%s'\n", 928 + driver->driver.name); 928 929 929 930 dum->driver = NULL; 930 931 ··· 1001 1000 { 1002 1001 struct dummy *dum = platform_get_drvdata(pdev); 1003 1002 1004 - usb_del_gadget_udc(&dum->gadget); 1005 1003 device_remove_file(&dum->gadget.dev, &dev_attr_function); 1004 + usb_del_gadget_udc(&dum->gadget); 1006 1005 return 0; 1007 1006 } 1008 1007
+1 -1
drivers/usb/gadget/f_ecm.c
··· 995 995 usb_ep_free_request(ecm->notify, ecm->notify_req); 996 996 } 997 997 998 - struct usb_function *ecm_alloc(struct usb_function_instance *fi) 998 + static struct usb_function *ecm_alloc(struct usb_function_instance *fi) 999 999 { 1000 1000 struct f_ecm *ecm; 1001 1001 struct f_ecm_opts *opts;
+1 -1
drivers/usb/gadget/f_eem.c
··· 624 624 usb_free_all_descriptors(f); 625 625 } 626 626 627 - struct usb_function *eem_alloc(struct usb_function_instance *fi) 627 + static struct usb_function *eem_alloc(struct usb_function_instance *fi) 628 628 { 629 629 struct f_eem *eem; 630 630 struct f_eem_opts *opts;
+2
drivers/usb/gadget/f_mass_storage.c
··· 2260 2260 /* Disable the endpoints */ 2261 2261 if (fsg->bulk_in_enabled) { 2262 2262 usb_ep_disable(fsg->bulk_in); 2263 + fsg->bulk_in->driver_data = NULL; 2263 2264 fsg->bulk_in_enabled = 0; 2264 2265 } 2265 2266 if (fsg->bulk_out_enabled) { 2266 2267 usb_ep_disable(fsg->bulk_out); 2268 + fsg->bulk_out->driver_data = NULL; 2267 2269 fsg->bulk_out_enabled = 0; 2268 2270 } 2269 2271
+4 -4
drivers/usb/gadget/multi.c
··· 179 179 return ret; 180 180 } 181 181 182 - static int rndis_config_register(struct usb_composite_dev *cdev) 182 + static __ref int rndis_config_register(struct usb_composite_dev *cdev) 183 183 { 184 184 static struct usb_configuration config = { 185 185 .bConfigurationValue = MULTI_RNDIS_CONFIG_NUM, ··· 194 194 195 195 #else 196 196 197 - static int rndis_config_register(struct usb_composite_dev *cdev) 197 + static __ref int rndis_config_register(struct usb_composite_dev *cdev) 198 198 { 199 199 return 0; 200 200 } ··· 241 241 return ret; 242 242 } 243 243 244 - static int cdc_config_register(struct usb_composite_dev *cdev) 244 + static __ref int cdc_config_register(struct usb_composite_dev *cdev) 245 245 { 246 246 static struct usb_configuration config = { 247 247 .bConfigurationValue = MULTI_CDC_CONFIG_NUM, ··· 256 256 257 257 #else 258 258 259 - static int cdc_config_register(struct usb_composite_dev *cdev) 259 + static __ref int cdc_config_register(struct usb_composite_dev *cdev) 260 260 { 261 261 return 0; 262 262 }
+3
drivers/usb/gadget/mv_u3d_core.c
··· 645 645 struct mv_u3d_ep *ep; 646 646 struct mv_u3d_ep_context *ep_context; 647 647 u32 epxcr, direction; 648 + unsigned long flags; 648 649 649 650 if (!_ep) 650 651 return -EINVAL; ··· 662 661 direction = mv_u3d_ep_dir(ep); 663 662 664 663 /* nuke all pending requests (does flush) */ 664 + spin_lock_irqsave(&u3d->lock, flags); 665 665 mv_u3d_nuke(ep, -ESHUTDOWN); 666 + spin_unlock_irqrestore(&u3d->lock, flags); 666 667 667 668 /* Disable the endpoint for Rx or Tx and reset the endpoint type */ 668 669 if (direction == MV_U3D_EP_DIR_OUT) {
+4 -9
drivers/usb/gadget/s3c-hsotg.c
··· 2475 2475 if (gintsts & GINTSTS_ErlySusp) { 2476 2476 dev_dbg(hsotg->dev, "GINTSTS_ErlySusp\n"); 2477 2477 writel(GINTSTS_ErlySusp, hsotg->regs + GINTSTS); 2478 - 2479 - s3c_hsotg_disconnect(hsotg); 2480 2478 } 2481 2479 2482 2480 /* ··· 2960 2962 if (!hsotg) 2961 2963 return -ENODEV; 2962 2964 2963 - if (!driver || driver != hsotg->driver || !driver->unbind) 2964 - return -EINVAL; 2965 - 2966 2965 /* all endpoints should be shutdown */ 2967 2966 for (ep = 0; ep < hsotg->num_of_eps; ep++) 2968 2967 s3c_hsotg_ep_disable(&hsotg->eps[ep].ep); ··· 2967 2972 spin_lock_irqsave(&hsotg->lock, flags); 2968 2973 2969 2974 s3c_hsotg_phy_disable(hsotg); 2970 - regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies); 2971 2975 2972 - hsotg->driver = NULL; 2976 + if (!driver) 2977 + hsotg->driver = NULL; 2978 + 2973 2979 hsotg->gadget.speed = USB_SPEED_UNKNOWN; 2974 2980 2975 2981 spin_unlock_irqrestore(&hsotg->lock, flags); 2976 2982 2977 - dev_info(hsotg->dev, "unregistered gadget driver '%s'\n", 2978 - driver->driver.name); 2983 + regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies); 2979 2984 2980 2985 return 0; 2981 2986 }
+3 -3
drivers/usb/host/fsl-mph-dr-of.c
··· 24 24 enum fsl_usb2_operating_modes op_mode; /* operating mode */ 25 25 }; 26 26 27 - struct fsl_usb2_dev_data dr_mode_data[] = { 27 + static struct fsl_usb2_dev_data dr_mode_data[] = { 28 28 { 29 29 .dr_mode = "host", 30 30 .drivers = { "fsl-ehci", NULL, NULL, }, ··· 42 42 }, 43 43 }; 44 44 45 - struct fsl_usb2_dev_data *get_dr_mode_data(struct device_node *np) 45 + static struct fsl_usb2_dev_data *get_dr_mode_data(struct device_node *np) 46 46 { 47 47 const unsigned char *prop; 48 48 int i; ··· 75 75 return FSL_USB2_PHY_NONE; 76 76 } 77 77 78 - struct platform_device *fsl_usb2_device_register( 78 + static struct platform_device *fsl_usb2_device_register( 79 79 struct platform_device *ofdev, 80 80 struct fsl_usb2_platform_data *pdata, 81 81 const char *name, int id)
+1 -1
drivers/usb/phy/phy-omap-usb3.c
··· 79 79 return &dpll_map[i].params; 80 80 } 81 81 82 - return 0; 82 + return NULL; 83 83 } 84 84 85 85 static int omap_usb3_suspend(struct usb_phy *x, int suspend)