Skip to content

Commit e04a0a5

Browse files
committed
Merge tag 'usb-3.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here are a number of small USB fixes for 3.12-rc2. One is a revert of a EHCI change that isn't quite ready for 3.12. Others are minor things, gadget fixes, Kconfig fixes, and some quirks and documentation updates. All have been in linux-next for a bit" * tag 'usb-3.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: pl2303: distinguish between original and cloned HX chips USB: Faraday fotg210: fix email addresses USB: fix typo in usb serial simple driver Kconfig Revert "USB: EHCI: support running URB giveback in tasklet context" usb: s3c-hsotg: do not disconnect gadget when receiving ErlySusp intr usb: s3c-hsotg: fix unregistration function usb: gadget: f_mass_storage: reset endpoint driver data when disabled usb: host: fsl-mph-dr-of: Staticize local symbols usb: gadget: f_eem: Staticize eem_alloc usb: gadget: f_ecm: Staticize ecm_alloc usb: phy: omap-usb3: Fix return value usb: dwc3: gadget: avoid memory leak when failing to allocate all eps usb: dwc3: remove extcon dependency usb: gadget: add '__ref' for rndis_config_register() and cdc_config_register() usb: dwc3: pci: add support for BayTrail usb: gadget: cdc2: fix conversion to new interface of f_ecm usb: gadget: fix a bug and a WARN_ON in dummy-hcd usb: gadget: mv_u3d_core: fix violation of locking discipline in mv_u3d_ep_disable()
2 parents d8524ae + 42f4891 commit e04a0a5

31 files changed

+81
-72
lines changed

drivers/usb/dwc3/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
config USB_DWC3
22
tristate "DesignWare USB3 DRD Core Support"
33
depends on (USB || USB_GADGET) && HAS_DMA
4-
depends on EXTCON
54
select USB_XHCI_PLATFORM if USB_SUPPORT && USB_XHCI_HCD
65
help
76
Say Y or M here if your system has a Dual Role SuperSpeed

drivers/usb/dwc3/dwc3-pci.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
/* FIXME define these in <linux/pci_ids.h> */
2929
#define PCI_VENDOR_ID_SYNOPSYS 0x16c3
3030
#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3 0xabcd
31+
#define PCI_DEVICE_ID_INTEL_BYT 0x0f37
3132

3233
struct dwc3_pci {
3334
struct device *dev;
@@ -187,6 +188,7 @@ static DEFINE_PCI_DEVICE_TABLE(dwc3_pci_id_table) = {
187188
PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS,
188189
PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3),
189190
},
191+
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT), },
190192
{ } /* Terminating Entry */
191193
};
192194
MODULE_DEVICE_TABLE(pci, dwc3_pci_id_table);

drivers/usb/dwc3/gadget.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2611,15 +2611,13 @@ int dwc3_gadget_init(struct dwc3 *dwc)
26112611
ret = usb_add_gadget_udc(dwc->dev, &dwc->gadget);
26122612
if (ret) {
26132613
dev_err(dwc->dev, "failed to register udc\n");
2614-
goto err5;
2614+
goto err4;
26152615
}
26162616

26172617
return 0;
26182618

2619-
err5:
2620-
dwc3_gadget_free_endpoints(dwc);
2621-
26222619
err4:
2620+
dwc3_gadget_free_endpoints(dwc);
26232621
dma_free_coherent(dwc->dev, DWC3_EP0_BOUNCE_SIZE,
26242622
dwc->ep0_bounce, dwc->ep0_bounce_addr);
26252623

drivers/usb/gadget/cdc2.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,6 @@ static int __init cdc_do_config(struct usb_configuration *c)
113113
c->bmAttributes |= USB_CONFIG_ATT_WAKEUP;
114114
}
115115

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-
122116
f_ecm = usb_get_function(fi_ecm);
123117
if (IS_ERR(f_ecm)) {
124118
status = PTR_ERR(f_ecm);
@@ -129,35 +123,24 @@ static int __init cdc_do_config(struct usb_configuration *c)
129123
if (status)
130124
goto err_add_ecm;
131125

132-
fi_serial = usb_get_function_instance("acm");
133-
if (IS_ERR(fi_serial)) {
134-
status = PTR_ERR(fi_serial);
135-
goto err_get_acm;
136-
}
137-
138126
f_acm = usb_get_function(fi_serial);
139127
if (IS_ERR(f_acm)) {
140128
status = PTR_ERR(f_acm);
141-
goto err_func_acm;
129+
goto err_get_acm;
142130
}
143131

144132
status = usb_add_function(c, f_acm);
145133
if (status)
146134
goto err_add_acm;
147-
148135
return 0;
149136

150137
err_add_acm:
151138
usb_put_function(f_acm);
152-
err_func_acm:
153-
usb_put_function_instance(fi_serial);
154139
err_get_acm:
155140
usb_remove_function(c, f_ecm);
156141
err_add_ecm:
157142
usb_put_function(f_ecm);
158143
err_get_ecm:
159-
usb_put_function_instance(fi_ecm);
160-
err_func_ecm:
161144
return status;
162145
}
163146

drivers/usb/gadget/dummy_hcd.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,9 @@ static int dummy_udc_stop(struct usb_gadget *g,
923923
struct dummy_hcd *dum_hcd = gadget_to_dummy_hcd(g);
924924
struct dummy *dum = dum_hcd->dum;
925925

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);
928929

929930
dum->driver = NULL;
930931

@@ -1000,8 +1001,8 @@ static int dummy_udc_remove(struct platform_device *pdev)
10001001
{
10011002
struct dummy *dum = platform_get_drvdata(pdev);
10021003

1003-
usb_del_gadget_udc(&dum->gadget);
10041004
device_remove_file(&dum->gadget.dev, &dev_attr_function);
1005+
usb_del_gadget_udc(&dum->gadget);
10051006
return 0;
10061007
}
10071008

drivers/usb/gadget/f_ecm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ static void ecm_unbind(struct usb_configuration *c, struct usb_function *f)
995995
usb_ep_free_request(ecm->notify, ecm->notify_req);
996996
}
997997

998-
struct usb_function *ecm_alloc(struct usb_function_instance *fi)
998+
static struct usb_function *ecm_alloc(struct usb_function_instance *fi)
999999
{
10001000
struct f_ecm *ecm;
10011001
struct f_ecm_opts *opts;

drivers/usb/gadget/f_eem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ static void eem_unbind(struct usb_configuration *c, struct usb_function *f)
624624
usb_free_all_descriptors(f);
625625
}
626626

627-
struct usb_function *eem_alloc(struct usb_function_instance *fi)
627+
static struct usb_function *eem_alloc(struct usb_function_instance *fi)
628628
{
629629
struct f_eem *eem;
630630
struct f_eem_opts *opts;

drivers/usb/gadget/f_mass_storage.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2260,10 +2260,12 @@ static int do_set_interface(struct fsg_common *common, struct fsg_dev *new_fsg)
22602260
/* Disable the endpoints */
22612261
if (fsg->bulk_in_enabled) {
22622262
usb_ep_disable(fsg->bulk_in);
2263+
fsg->bulk_in->driver_data = NULL;
22632264
fsg->bulk_in_enabled = 0;
22642265
}
22652266
if (fsg->bulk_out_enabled) {
22662267
usb_ep_disable(fsg->bulk_out);
2268+
fsg->bulk_out->driver_data = NULL;
22672269
fsg->bulk_out_enabled = 0;
22682270
}
22692271

drivers/usb/gadget/fotg210-udc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,6 @@ static struct platform_driver fotg210_driver = {
12141214

12151215
module_platform_driver(fotg210_driver);
12161216

1217-
MODULE_AUTHOR("Yuan-Hsin Chen <yhchen@faraday-tech.com>");
1217+
MODULE_AUTHOR("Yuan-Hsin Chen, Feng-Hsin Chiang <john453@faraday-tech.com>");
12181218
MODULE_LICENSE("GPL");
12191219
MODULE_DESCRIPTION(DRIVER_DESC);

drivers/usb/gadget/fusb300_udc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
MODULE_DESCRIPTION("FUSB300 USB gadget driver");
2424
MODULE_LICENSE("GPL");
25-
MODULE_AUTHOR("Yuan Hsin Chen <yhchen@faraday-tech.com>");
25+
MODULE_AUTHOR("Yuan-Hsin Chen, Feng-Hsin Chiang <john453@faraday-tech.com>");
2626
MODULE_ALIAS("platform:fusb300_udc");
2727

2828
#define DRIVER_VERSION "20 October 2010"

drivers/usb/gadget/multi.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ static __init int rndis_do_config(struct usb_configuration *c)
179179
return ret;
180180
}
181181

182-
static int rndis_config_register(struct usb_composite_dev *cdev)
182+
static __ref int rndis_config_register(struct usb_composite_dev *cdev)
183183
{
184184
static struct usb_configuration config = {
185185
.bConfigurationValue = MULTI_RNDIS_CONFIG_NUM,
@@ -194,7 +194,7 @@ static int rndis_config_register(struct usb_composite_dev *cdev)
194194

195195
#else
196196

197-
static int rndis_config_register(struct usb_composite_dev *cdev)
197+
static __ref int rndis_config_register(struct usb_composite_dev *cdev)
198198
{
199199
return 0;
200200
}
@@ -241,7 +241,7 @@ static __init int cdc_do_config(struct usb_configuration *c)
241241
return ret;
242242
}
243243

244-
static int cdc_config_register(struct usb_composite_dev *cdev)
244+
static __ref int cdc_config_register(struct usb_composite_dev *cdev)
245245
{
246246
static struct usb_configuration config = {
247247
.bConfigurationValue = MULTI_CDC_CONFIG_NUM,
@@ -256,7 +256,7 @@ static int cdc_config_register(struct usb_composite_dev *cdev)
256256

257257
#else
258258

259-
static int cdc_config_register(struct usb_composite_dev *cdev)
259+
static __ref int cdc_config_register(struct usb_composite_dev *cdev)
260260
{
261261
return 0;
262262
}

drivers/usb/gadget/mv_u3d_core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,7 @@ static int mv_u3d_ep_disable(struct usb_ep *_ep)
645645
struct mv_u3d_ep *ep;
646646
struct mv_u3d_ep_context *ep_context;
647647
u32 epxcr, direction;
648+
unsigned long flags;
648649

649650
if (!_ep)
650651
return -EINVAL;
@@ -661,7 +662,9 @@ static int mv_u3d_ep_disable(struct usb_ep *_ep)
661662
direction = mv_u3d_ep_dir(ep);
662663

663664
/* nuke all pending requests (does flush) */
665+
spin_lock_irqsave(&u3d->lock, flags);
664666
mv_u3d_nuke(ep, -ESHUTDOWN);
667+
spin_unlock_irqrestore(&u3d->lock, flags);
665668

666669
/* Disable the endpoint for Rx or Tx and reset the endpoint type */
667670
if (direction == MV_U3D_EP_DIR_OUT) {

drivers/usb/gadget/s3c-hsotg.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2475,8 +2475,6 @@ static irqreturn_t s3c_hsotg_irq(int irq, void *pw)
24752475
if (gintsts & GINTSTS_ErlySusp) {
24762476
dev_dbg(hsotg->dev, "GINTSTS_ErlySusp\n");
24772477
writel(GINTSTS_ErlySusp, hsotg->regs + GINTSTS);
2478-
2479-
s3c_hsotg_disconnect(hsotg);
24802478
}
24812479

24822480
/*
@@ -2962,25 +2960,22 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget,
29622960
if (!hsotg)
29632961
return -ENODEV;
29642962

2965-
if (!driver || driver != hsotg->driver || !driver->unbind)
2966-
return -EINVAL;
2967-
29682963
/* all endpoints should be shutdown */
29692964
for (ep = 0; ep < hsotg->num_of_eps; ep++)
29702965
s3c_hsotg_ep_disable(&hsotg->eps[ep].ep);
29712966

29722967
spin_lock_irqsave(&hsotg->lock, flags);
29732968

29742969
s3c_hsotg_phy_disable(hsotg);
2975-
regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);
29762970

2977-
hsotg->driver = NULL;
2971+
if (!driver)
2972+
hsotg->driver = NULL;
2973+
29782974
hsotg->gadget.speed = USB_SPEED_UNKNOWN;
29792975

29802976
spin_unlock_irqrestore(&hsotg->lock, flags);
29812977

2982-
dev_info(hsotg->dev, "unregistered gadget driver '%s'\n",
2983-
driver->driver.name);
2978+
regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);
29842979

29852980
return 0;
29862981
}

drivers/usb/host/ehci-fsl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ static const struct hc_driver ehci_fsl_hc_driver = {
669669
* generic hardware linkage
670670
*/
671671
.irq = ehci_irq,
672-
.flags = HCD_USB2 | HCD_MEMORY | HCD_BH,
672+
.flags = HCD_USB2 | HCD_MEMORY,
673673

674674
/*
675675
* basic lifecycle operations

drivers/usb/host/ehci-grlib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static const struct hc_driver ehci_grlib_hc_driver = {
4343
* generic hardware linkage
4444
*/
4545
.irq = ehci_irq,
46-
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
46+
.flags = HCD_MEMORY | HCD_USB2,
4747

4848
/*
4949
* basic lifecycle operations

drivers/usb/host/ehci-hcd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ static const struct hc_driver ehci_hc_driver = {
11581158
* generic hardware linkage
11591159
*/
11601160
.irq = ehci_irq,
1161-
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
1161+
.flags = HCD_MEMORY | HCD_USB2,
11621162

11631163
/*
11641164
* basic lifecycle operations

drivers/usb/host/ehci-mv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static const struct hc_driver mv_ehci_hc_driver = {
9696
* generic hardware linkage
9797
*/
9898
.irq = ehci_irq,
99-
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
99+
.flags = HCD_MEMORY | HCD_USB2,
100100

101101
/*
102102
* basic lifecycle operations

drivers/usb/host/ehci-octeon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static const struct hc_driver ehci_octeon_hc_driver = {
5151
* generic hardware linkage
5252
*/
5353
.irq = ehci_irq,
54-
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
54+
.flags = HCD_MEMORY | HCD_USB2,
5555

5656
/*
5757
* basic lifecycle operations

drivers/usb/host/ehci-pmcmsp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static const struct hc_driver ehci_msp_hc_driver = {
286286
#else
287287
.irq = ehci_irq,
288288
#endif
289-
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
289+
.flags = HCD_MEMORY | HCD_USB2,
290290

291291
/*
292292
* basic lifecycle operations

drivers/usb/host/ehci-ppc-of.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static const struct hc_driver ehci_ppc_of_hc_driver = {
2828
* generic hardware linkage
2929
*/
3030
.irq = ehci_irq,
31-
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
31+
.flags = HCD_MEMORY | HCD_USB2,
3232

3333
/*
3434
* basic lifecycle operations

drivers/usb/host/ehci-ps3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static const struct hc_driver ps3_ehci_hc_driver = {
7171
.product_desc = "PS3 EHCI Host Controller",
7272
.hcd_priv_size = sizeof(struct ehci_hcd),
7373
.irq = ehci_irq,
74-
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
74+
.flags = HCD_MEMORY | HCD_USB2,
7575
.reset = ps3_ehci_hc_reset,
7676
.start = ehci_run,
7777
.stop = ehci_stop,

drivers/usb/host/ehci-q.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ static int qtd_copy_status (
247247

248248
static void
249249
ehci_urb_done(struct ehci_hcd *ehci, struct urb *urb, int status)
250+
__releases(ehci->lock)
251+
__acquires(ehci->lock)
250252
{
251253
if (usb_pipetype(urb->pipe) == PIPE_INTERRUPT) {
252254
/* ... update hc-wide periodic stats */
@@ -272,8 +274,11 @@ ehci_urb_done(struct ehci_hcd *ehci, struct urb *urb, int status)
272274
urb->actual_length, urb->transfer_buffer_length);
273275
#endif
274276

277+
/* complete() can reenter this HCD */
275278
usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
279+
spin_unlock (&ehci->lock);
276280
usb_hcd_giveback_urb(ehci_to_hcd(ehci), urb, status);
281+
spin_lock (&ehci->lock);
277282
}
278283

279284
static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh);

drivers/usb/host/ehci-sead3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const struct hc_driver ehci_sead3_hc_driver = {
5555
* generic hardware linkage
5656
*/
5757
.irq = ehci_irq,
58-
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
58+
.flags = HCD_MEMORY | HCD_USB2,
5959

6060
/*
6161
* basic lifecycle operations

drivers/usb/host/ehci-sh.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static const struct hc_driver ehci_sh_hc_driver = {
3636
* generic hardware linkage
3737
*/
3838
.irq = ehci_irq,
39-
.flags = HCD_USB2 | HCD_MEMORY | HCD_BH,
39+
.flags = HCD_USB2 | HCD_MEMORY,
4040

4141
/*
4242
* basic lifecycle operations

drivers/usb/host/ehci-tilegx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static const struct hc_driver ehci_tilegx_hc_driver = {
6161
* Generic hardware linkage.
6262
*/
6363
.irq = ehci_irq,
64-
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
64+
.flags = HCD_MEMORY | HCD_USB2,
6565

6666
/*
6767
* Basic lifecycle operations.

drivers/usb/host/ehci-w90x900.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static const struct hc_driver ehci_w90x900_hc_driver = {
108108
* generic hardware linkage
109109
*/
110110
.irq = ehci_irq,
111-
.flags = HCD_USB2|HCD_MEMORY|HCD_BH,
111+
.flags = HCD_USB2|HCD_MEMORY,
112112

113113
/*
114114
* basic lifecycle operations

drivers/usb/host/ehci-xilinx-of.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static const struct hc_driver ehci_xilinx_of_hc_driver = {
7979
* generic hardware linkage
8080
*/
8181
.irq = ehci_irq,
82-
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
82+
.flags = HCD_MEMORY | HCD_USB2,
8383

8484
/*
8585
* basic lifecycle operations

0 commit comments

Comments
 (0)