Skip to content

Commit

Permalink
Merge tag 'usb-3.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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()
  • Loading branch information
torvalds committed Sep 23, 2013
2 parents d8524ae + 42f4891 commit e04a0a5
Show file tree
Hide file tree
Showing 31 changed files with 81 additions and 72 deletions.
1 change: 0 additions & 1 deletion drivers/usb/dwc3/Kconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
config USB_DWC3
tristate "DesignWare USB3 DRD Core Support"
depends on (USB || USB_GADGET) && HAS_DMA
depends on EXTCON
select USB_XHCI_PLATFORM if USB_SUPPORT && USB_XHCI_HCD
help
Say Y or M here if your system has a Dual Role SuperSpeed
Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/dwc3/dwc3-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
/* FIXME define these in <linux/pci_ids.h> */
#define PCI_VENDOR_ID_SYNOPSYS 0x16c3
#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3 0xabcd
#define PCI_DEVICE_ID_INTEL_BYT 0x0f37

struct dwc3_pci {
struct device *dev;
Expand Down Expand Up @@ -187,6 +188,7 @@ static DEFINE_PCI_DEVICE_TABLE(dwc3_pci_id_table) = {
PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS,
PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3),
},
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT), },
{ } /* Terminating Entry */
};
MODULE_DEVICE_TABLE(pci, dwc3_pci_id_table);
Expand Down
6 changes: 2 additions & 4 deletions drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -2611,15 +2611,13 @@ int dwc3_gadget_init(struct dwc3 *dwc)
ret = usb_add_gadget_udc(dwc->dev, &dwc->gadget);
if (ret) {
dev_err(dwc->dev, "failed to register udc\n");
goto err5;
goto err4;
}

return 0;

err5:
dwc3_gadget_free_endpoints(dwc);

err4:
dwc3_gadget_free_endpoints(dwc);
dma_free_coherent(dwc->dev, DWC3_EP0_BOUNCE_SIZE,
dwc->ep0_bounce, dwc->ep0_bounce_addr);

Expand Down
19 changes: 1 addition & 18 deletions drivers/usb/gadget/cdc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ static int __init cdc_do_config(struct usb_configuration *c)
c->bmAttributes |= USB_CONFIG_ATT_WAKEUP;
}

fi_ecm = usb_get_function_instance("ecm");
if (IS_ERR(fi_ecm)) {
status = PTR_ERR(fi_ecm);
goto err_func_ecm;
}

f_ecm = usb_get_function(fi_ecm);
if (IS_ERR(f_ecm)) {
status = PTR_ERR(f_ecm);
Expand All @@ -129,35 +123,24 @@ static int __init cdc_do_config(struct usb_configuration *c)
if (status)
goto err_add_ecm;

fi_serial = usb_get_function_instance("acm");
if (IS_ERR(fi_serial)) {
status = PTR_ERR(fi_serial);
goto err_get_acm;
}

f_acm = usb_get_function(fi_serial);
if (IS_ERR(f_acm)) {
status = PTR_ERR(f_acm);
goto err_func_acm;
goto err_get_acm;
}

status = usb_add_function(c, f_acm);
if (status)
goto err_add_acm;

return 0;

err_add_acm:
usb_put_function(f_acm);
err_func_acm:
usb_put_function_instance(fi_serial);
err_get_acm:
usb_remove_function(c, f_ecm);
err_add_ecm:
usb_put_function(f_ecm);
err_get_ecm:
usb_put_function_instance(fi_ecm);
err_func_ecm:
return status;
}

Expand Down
7 changes: 4 additions & 3 deletions drivers/usb/gadget/dummy_hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,8 +923,9 @@ static int dummy_udc_stop(struct usb_gadget *g,
struct dummy_hcd *dum_hcd = gadget_to_dummy_hcd(g);
struct dummy *dum = dum_hcd->dum;

dev_dbg(udc_dev(dum), "unregister gadget driver '%s'\n",
driver->driver.name);
if (driver)
dev_dbg(udc_dev(dum), "unregister gadget driver '%s'\n",
driver->driver.name);

dum->driver = NULL;

Expand Down Expand Up @@ -1000,8 +1001,8 @@ static int dummy_udc_remove(struct platform_device *pdev)
{
struct dummy *dum = platform_get_drvdata(pdev);

usb_del_gadget_udc(&dum->gadget);
device_remove_file(&dum->gadget.dev, &dev_attr_function);
usb_del_gadget_udc(&dum->gadget);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/f_ecm.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ static void ecm_unbind(struct usb_configuration *c, struct usb_function *f)
usb_ep_free_request(ecm->notify, ecm->notify_req);
}

struct usb_function *ecm_alloc(struct usb_function_instance *fi)
static struct usb_function *ecm_alloc(struct usb_function_instance *fi)
{
struct f_ecm *ecm;
struct f_ecm_opts *opts;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/f_eem.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ static void eem_unbind(struct usb_configuration *c, struct usb_function *f)
usb_free_all_descriptors(f);
}

struct usb_function *eem_alloc(struct usb_function_instance *fi)
static struct usb_function *eem_alloc(struct usb_function_instance *fi)
{
struct f_eem *eem;
struct f_eem_opts *opts;
Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/gadget/f_mass_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -2260,10 +2260,12 @@ static int do_set_interface(struct fsg_common *common, struct fsg_dev *new_fsg)
/* Disable the endpoints */
if (fsg->bulk_in_enabled) {
usb_ep_disable(fsg->bulk_in);
fsg->bulk_in->driver_data = NULL;
fsg->bulk_in_enabled = 0;
}
if (fsg->bulk_out_enabled) {
usb_ep_disable(fsg->bulk_out);
fsg->bulk_out->driver_data = NULL;
fsg->bulk_out_enabled = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/fotg210-udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,6 @@ static struct platform_driver fotg210_driver = {

module_platform_driver(fotg210_driver);

MODULE_AUTHOR("Yuan-Hsin Chen <yhchen@faraday-tech.com>");
MODULE_AUTHOR("Yuan-Hsin Chen, Feng-Hsin Chiang <john453@faraday-tech.com>");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION(DRIVER_DESC);
2 changes: 1 addition & 1 deletion drivers/usb/gadget/fusb300_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

#define DRIVER_VERSION "20 October 2010"
Expand Down
8 changes: 4 additions & 4 deletions drivers/usb/gadget/multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ static __init int rndis_do_config(struct usb_configuration *c)
return ret;
}

static int rndis_config_register(struct usb_composite_dev *cdev)
static __ref int rndis_config_register(struct usb_composite_dev *cdev)
{
static struct usb_configuration config = {
.bConfigurationValue = MULTI_RNDIS_CONFIG_NUM,
Expand All @@ -194,7 +194,7 @@ static int rndis_config_register(struct usb_composite_dev *cdev)

#else

static int rndis_config_register(struct usb_composite_dev *cdev)
static __ref int rndis_config_register(struct usb_composite_dev *cdev)
{
return 0;
}
Expand Down Expand Up @@ -241,7 +241,7 @@ static __init int cdc_do_config(struct usb_configuration *c)
return ret;
}

static int cdc_config_register(struct usb_composite_dev *cdev)
static __ref int cdc_config_register(struct usb_composite_dev *cdev)
{
static struct usb_configuration config = {
.bConfigurationValue = MULTI_CDC_CONFIG_NUM,
Expand All @@ -256,7 +256,7 @@ static int cdc_config_register(struct usb_composite_dev *cdev)

#else

static int cdc_config_register(struct usb_composite_dev *cdev)
static __ref int cdc_config_register(struct usb_composite_dev *cdev)
{
return 0;
}
Expand Down
3 changes: 3 additions & 0 deletions drivers/usb/gadget/mv_u3d_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ static int mv_u3d_ep_disable(struct usb_ep *_ep)
struct mv_u3d_ep *ep;
struct mv_u3d_ep_context *ep_context;
u32 epxcr, direction;
unsigned long flags;

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

/* nuke all pending requests (does flush) */
spin_lock_irqsave(&u3d->lock, flags);
mv_u3d_nuke(ep, -ESHUTDOWN);
spin_unlock_irqrestore(&u3d->lock, flags);

/* Disable the endpoint for Rx or Tx and reset the endpoint type */
if (direction == MV_U3D_EP_DIR_OUT) {
Expand Down
13 changes: 4 additions & 9 deletions drivers/usb/gadget/s3c-hsotg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2475,8 +2475,6 @@ static irqreturn_t s3c_hsotg_irq(int irq, void *pw)
if (gintsts & GINTSTS_ErlySusp) {
dev_dbg(hsotg->dev, "GINTSTS_ErlySusp\n");
writel(GINTSTS_ErlySusp, hsotg->regs + GINTSTS);

s3c_hsotg_disconnect(hsotg);
}

/*
Expand Down Expand Up @@ -2962,25 +2960,22 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget,
if (!hsotg)
return -ENODEV;

if (!driver || driver != hsotg->driver || !driver->unbind)
return -EINVAL;

/* all endpoints should be shutdown */
for (ep = 0; ep < hsotg->num_of_eps; ep++)
s3c_hsotg_ep_disable(&hsotg->eps[ep].ep);

spin_lock_irqsave(&hsotg->lock, flags);

s3c_hsotg_phy_disable(hsotg);
regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);

hsotg->driver = NULL;
if (!driver)
hsotg->driver = NULL;

hsotg->gadget.speed = USB_SPEED_UNKNOWN;

spin_unlock_irqrestore(&hsotg->lock, flags);

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

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-fsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ static const struct hc_driver ehci_fsl_hc_driver = {
* generic hardware linkage
*/
.irq = ehci_irq,
.flags = HCD_USB2 | HCD_MEMORY | HCD_BH,
.flags = HCD_USB2 | HCD_MEMORY,

/*
* basic lifecycle operations
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-grlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static const struct hc_driver ehci_grlib_hc_driver = {
* generic hardware linkage
*/
.irq = ehci_irq,
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
.flags = HCD_MEMORY | HCD_USB2,

/*
* basic lifecycle operations
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ static const struct hc_driver ehci_hc_driver = {
* generic hardware linkage
*/
.irq = ehci_irq,
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
.flags = HCD_MEMORY | HCD_USB2,

/*
* basic lifecycle operations
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static const struct hc_driver mv_ehci_hc_driver = {
* generic hardware linkage
*/
.irq = ehci_irq,
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
.flags = HCD_MEMORY | HCD_USB2,

/*
* basic lifecycle operations
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-octeon.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static const struct hc_driver ehci_octeon_hc_driver = {
* generic hardware linkage
*/
.irq = ehci_irq,
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
.flags = HCD_MEMORY | HCD_USB2,

/*
* basic lifecycle operations
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-pmcmsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static const struct hc_driver ehci_msp_hc_driver = {
#else
.irq = ehci_irq,
#endif
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
.flags = HCD_MEMORY | HCD_USB2,

/*
* basic lifecycle operations
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-ppc-of.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static const struct hc_driver ehci_ppc_of_hc_driver = {
* generic hardware linkage
*/
.irq = ehci_irq,
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
.flags = HCD_MEMORY | HCD_USB2,

/*
* basic lifecycle operations
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-ps3.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static const struct hc_driver ps3_ehci_hc_driver = {
.product_desc = "PS3 EHCI Host Controller",
.hcd_priv_size = sizeof(struct ehci_hcd),
.irq = ehci_irq,
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
.flags = HCD_MEMORY | HCD_USB2,
.reset = ps3_ehci_hc_reset,
.start = ehci_run,
.stop = ehci_stop,
Expand Down
5 changes: 5 additions & 0 deletions drivers/usb/host/ehci-q.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ static int qtd_copy_status (

static void
ehci_urb_done(struct ehci_hcd *ehci, struct urb *urb, int status)
__releases(ehci->lock)
__acquires(ehci->lock)
{
if (usb_pipetype(urb->pipe) == PIPE_INTERRUPT) {
/* ... update hc-wide periodic stats */
Expand All @@ -272,8 +274,11 @@ ehci_urb_done(struct ehci_hcd *ehci, struct urb *urb, int status)
urb->actual_length, urb->transfer_buffer_length);
#endif

/* complete() can reenter this HCD */
usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
spin_unlock (&ehci->lock);
usb_hcd_giveback_urb(ehci_to_hcd(ehci), urb, status);
spin_lock (&ehci->lock);
}

static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh);
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-sead3.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const struct hc_driver ehci_sead3_hc_driver = {
* generic hardware linkage
*/
.irq = ehci_irq,
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
.flags = HCD_MEMORY | HCD_USB2,

/*
* basic lifecycle operations
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-sh.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static const struct hc_driver ehci_sh_hc_driver = {
* generic hardware linkage
*/
.irq = ehci_irq,
.flags = HCD_USB2 | HCD_MEMORY | HCD_BH,
.flags = HCD_USB2 | HCD_MEMORY,

/*
* basic lifecycle operations
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-tilegx.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static const struct hc_driver ehci_tilegx_hc_driver = {
* Generic hardware linkage.
*/
.irq = ehci_irq,
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
.flags = HCD_MEMORY | HCD_USB2,

/*
* Basic lifecycle operations.
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-w90x900.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static const struct hc_driver ehci_w90x900_hc_driver = {
* generic hardware linkage
*/
.irq = ehci_irq,
.flags = HCD_USB2|HCD_MEMORY|HCD_BH,
.flags = HCD_USB2|HCD_MEMORY,

/*
* basic lifecycle operations
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-xilinx-of.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static const struct hc_driver ehci_xilinx_of_hc_driver = {
* generic hardware linkage
*/
.irq = ehci_irq,
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
.flags = HCD_MEMORY | HCD_USB2,

/*
* basic lifecycle operations
Expand Down
Loading

0 comments on commit e04a0a5

Please sign in to comment.