Skip to content

Commit

Permalink
Merge tag 'fixes-for-v3.8-rc2' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/balbi/usb into usb-linus

Felipe says:
	usb: fixes for v3.8-rc2

	Here is the first set of fixes for v3.8-rc cycle.

	There is a build fix for musb's dsps glue layer caused
	by some header cleanup on the OMAP tree.

	Marvel's USB drivers got a fix up for clk API usage
	switching over to clk_prepare() calls.

	u_serial has a bug fix for a missing wake_up() which
	would make gs_cleanup() wait forever for gs_close()
	to finish.

	A minor bug fix on dwc3's debugfs interface which
	would make us read wrong addresses when dumping
	all registers.

	dummy_hcd learned how to enumerate g_multi.

	s3c-hsotg now understands that we shouldn't kfree()
	memory allocated with devm_*.

	Other than that, there are a bunch of other minor fixes
	on renesas_usbhs, tcm_usb_gadget and amd5536udc.

	All patches have been pending on mailing for many weeks
	and shouldn't cause any problems.
  • Loading branch information
gregkh committed Jan 7, 2013
2 parents d1c3ed6 + 2ac788f commit e460239
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion drivers/usb/dwc3/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#define dump_register(nm) \
{ \
.name = __stringify(nm), \
.offset = DWC3_ ##nm, \
.offset = DWC3_ ##nm - DWC3_GLOBALS_REGS_START, \
}

static const struct debugfs_reg32 dwc3_regs[] = {
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/amd5536udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3231,7 +3231,7 @@ static int udc_pci_probe(
}

if (!pdev->irq) {
dev_err(&dev->pdev->dev, "irq not set\n");
dev_err(&pdev->dev, "irq not set\n");
kfree(dev);
dev = NULL;
retval = -ENODEV;
Expand All @@ -3250,7 +3250,7 @@ static int udc_pci_probe(
dev->txfifo = (u32 __iomem *)(dev->virt_addr + UDC_TXFIFO_ADDR);

if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) {
dev_dbg(&dev->pdev->dev, "request_irq(%d) fail\n", pdev->irq);
dev_dbg(&pdev->dev, "request_irq(%d) fail\n", pdev->irq);
kfree(dev);
dev = NULL;
retval = -EBUSY;
Expand Down
9 changes: 5 additions & 4 deletions drivers/usb/gadget/dummy_hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,18 @@ static const char ep0name[] = "ep0";
static const char *const ep_name[] = {
ep0name, /* everyone has ep0 */

/* act like a net2280: high speed, six configurable endpoints */
"ep-a", "ep-b", "ep-c", "ep-d", "ep-e", "ep-f",

/* or like pxa250: fifteen fixed function endpoints */
/* act like a pxa250: fifteen fixed function endpoints */
"ep1in-bulk", "ep2out-bulk", "ep3in-iso", "ep4out-iso", "ep5in-int",
"ep6in-bulk", "ep7out-bulk", "ep8in-iso", "ep9out-iso", "ep10in-int",
"ep11in-bulk", "ep12out-bulk", "ep13in-iso", "ep14out-iso",
"ep15in-int",

/* or like sa1100: two fixed function endpoints */
"ep1out-bulk", "ep2in-bulk",

/* and now some generic EPs so we have enough in multi config */
"ep3out", "ep4in", "ep5out", "ep6out", "ep7in", "ep8out", "ep9in",
"ep10out", "ep11out", "ep12in", "ep13out", "ep14in", "ep15out",
};
#define DUMMY_ENDPOINTS ARRAY_SIZE(ep_name)

Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/mv_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,15 +1012,15 @@ static void udc_clock_enable(struct mv_udc *udc)
unsigned int i;

for (i = 0; i < udc->clknum; i++)
clk_enable(udc->clk[i]);
clk_prepare_enable(udc->clk[i]);
}

static void udc_clock_disable(struct mv_udc *udc)
{
unsigned int i;

for (i = 0; i < udc->clknum; i++)
clk_disable(udc->clk[i]);
clk_disable_unprepare(udc->clk[i]);
}

static void udc_stop(struct mv_udc *udc)
Expand Down
5 changes: 2 additions & 3 deletions drivers/usb/gadget/s3c-hsotg.c
Original file line number Diff line number Diff line change
Expand Up @@ -3477,12 +3477,11 @@ static void s3c_hsotg_delete_debug(struct s3c_hsotg *hsotg)
/**
* s3c_hsotg_release - release callback for hsotg device
* @dev: Device to for which release is called
*
* Nothing to do as the resource is allocated using devm_ API.
*/
static void s3c_hsotg_release(struct device *dev)
{
struct s3c_hsotg *hsotg = dev_get_drvdata(dev);

kfree(hsotg);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion drivers/usb/gadget/tcm_usb_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1794,9 +1794,10 @@ static int tcm_usbg_drop_nexus(struct usbg_tpg *tpg)
tpg->tpg_nexus = NULL;

kfree(tv_nexus);
ret = 0;
out:
mutex_unlock(&tpg->tpg_mutex);
return 0;
return ret;
}

static ssize_t tcm_usbg_tpg_store_nexus(
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/u_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ static void gs_close(struct tty_struct *tty, struct file *file)
pr_debug("gs_close: ttyGS%d (%p,%p) done!\n",
port->port_num, tty, file);

wake_up_interruptible(&port->port.close_wait);
wake_up(&port->port.close_wait);
exit:
spin_unlock_irq(&port->port_lock);
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/host/ehci-mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ static void ehci_clock_enable(struct ehci_hcd_mv *ehci_mv)
unsigned int i;

for (i = 0; i < ehci_mv->clknum; i++)
clk_enable(ehci_mv->clk[i]);
clk_prepare_enable(ehci_mv->clk[i]);
}

static void ehci_clock_disable(struct ehci_hcd_mv *ehci_mv)
{
unsigned int i;

for (i = 0; i < ehci_mv->clknum; i++)
clk_disable(ehci_mv->clk[i]);
clk_disable_unprepare(ehci_mv->clk[i]);
}

static int mv_ehci_enable(struct ehci_hcd_mv *ehci_mv)
Expand Down
5 changes: 1 addition & 4 deletions drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2298,10 +2298,7 @@ static int __init musb_init(void)
if (usb_disabled())
return 0;

pr_info("%s: version " MUSB_VERSION ", "
"?dma?"
", "
"otg (peripheral+host)",
pr_info("%s: version " MUSB_VERSION ", ?dma?, otg (peripheral+host)\n",
musb_driver_name);
return platform_driver_register(&musb_driver);
}
Expand Down
5 changes: 5 additions & 0 deletions drivers/usb/musb/musb_dsps.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ static const resource_size_t dsps_control_module_phys[] = {
DSPS_AM33XX_CONTROL_MODULE_PHYS_1,
};

#define USBPHY_CM_PWRDN (1 << 0)
#define USBPHY_OTG_PWRDN (1 << 1)
#define USBPHY_OTGVDET_EN (1 << 19)
#define USBPHY_OTGSESSEND_EN (1 << 20)

/**
* musb_dsps_phy_control - phy on/off
* @glue: struct dsps_glue *
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/otg/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ config AB8500_USB

config FSL_USB2_OTG
bool "Freescale USB OTG Transceiver Driver"
depends on USB_EHCI_FSL && USB_GADGET_FSL_USB2 && USB_SUSPEND
depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_SUSPEND
select USB_OTG
select USB_OTG_UTILS
help
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/otg/mv_otg.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,15 @@ static void otg_clock_enable(struct mv_otg *mvotg)
unsigned int i;

for (i = 0; i < mvotg->clknum; i++)
clk_enable(mvotg->clk[i]);
clk_prepare_enable(mvotg->clk[i]);
}

static void otg_clock_disable(struct mv_otg *mvotg)
{
unsigned int i;

for (i = 0; i < mvotg->clknum; i++)
clk_disable(mvotg->clk[i]);
clk_disable_unprepare(mvotg->clk[i]);
}

static int mv_otg_enable_internal(struct mv_otg *mvotg)
Expand Down
22 changes: 9 additions & 13 deletions drivers/usb/renesas_usbhs/mod_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,15 +545,6 @@ static int usbhsg_pipe_disable(struct usbhsg_uep *uep)
return 0;
}

static void usbhsg_uep_init(struct usbhsg_gpriv *gpriv)
{
int i;
struct usbhsg_uep *uep;

usbhsg_for_each_uep_with_dcp(uep, gpriv, i)
uep->pipe = NULL;
}

/*
*
* usb_ep_ops
Expand Down Expand Up @@ -610,7 +601,12 @@ static int usbhsg_ep_disable(struct usb_ep *ep)
{
struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep);

return usbhsg_pipe_disable(uep);
usbhsg_pipe_disable(uep);

uep->pipe->mod_private = NULL;
uep->pipe = NULL;

return 0;
}

static struct usb_request *usbhsg_ep_alloc_request(struct usb_ep *ep,
Expand Down Expand Up @@ -761,9 +757,8 @@ static int usbhsg_try_start(struct usbhs_priv *priv, u32 status)
usbhs_pipe_init(priv,
usbhsg_dma_map_ctrl);
usbhs_fifo_init(priv);
usbhsg_uep_init(gpriv);

/* dcp init */
/* dcp init instead of usbhsg_ep_enable() */
dcp->pipe = usbhs_dcp_malloc(priv);
dcp->pipe->mod_private = dcp;
usbhs_pipe_config_update(dcp->pipe, 0, 0, 64);
Expand Down Expand Up @@ -825,7 +820,7 @@ static int usbhsg_try_stop(struct usbhs_priv *priv, u32 status)
usbhs_sys_set_test_mode(priv, 0);
usbhs_sys_function_ctrl(priv, 0);

usbhsg_pipe_disable(dcp);
usbhsg_ep_disable(&dcp->ep);

dev_dbg(dev, "stop gadget\n");

Expand Down Expand Up @@ -998,6 +993,7 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv)
*/
usbhsg_for_each_uep_with_dcp(uep, gpriv, i) {
uep->gpriv = gpriv;
uep->pipe = NULL;
snprintf(uep->ep_name, EP_NAME_SIZE, "ep%d", i);

uep->ep.name = uep->ep_name;
Expand Down
3 changes: 2 additions & 1 deletion drivers/usb/renesas_usbhs/mod_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,10 @@ static void usbhsh_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt)
status = -ESHUTDOWN;

urb->actual_length = pkt->actual;
usbhsh_ureq_free(hpriv, ureq);

usbhsh_endpoint_sequence_save(hpriv, urb, pkt);
usbhsh_ureq_free(hpriv, ureq);

usbhsh_pipe_detach(hpriv, usbhsh_ep_to_uep(urb->ep));

usb_hcd_unlink_urb_from_ep(hcd, urb);
Expand Down

0 comments on commit e460239

Please sign in to comment.