Skip to content

Commit

Permalink
Merge tag 'fixes-for-v4.3-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 writes:

usb: fixes for v4.3-rc2

First series of fixes for v4.3-rc cycle. The major points are
a fix to a regression which would let gadget driver disable
an endpoint that's already disabled and a fix to MUSB to make
sure IRQs are masked when we're going to suspend and unmasked
on resume.

Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Greg Kroah-Hartman committed Sep 17, 2015
2 parents 6ff33f3 + 762982d commit aa1471a
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 27 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/dwc3/dwc3-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,6 @@ static int dwc3_omap_probe(struct platform_device *pdev)
goto err1;
}

dwc3_omap_enable_irqs(omap);

ret = dwc3_omap_extcon_register(omap);
if (ret < 0)
goto err2;
Expand All @@ -526,6 +524,8 @@ static int dwc3_omap_probe(struct platform_device *pdev)
goto err3;
}

dwc3_omap_enable_irqs(omap);

return 0;

err3:
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/gadget/epautoconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ void usb_ep_autoconfig_reset (struct usb_gadget *gadget)

list_for_each_entry (ep, &gadget->ep_list, ep_list) {
ep->claimed = false;
ep->driver_data = NULL;
}
gadget->in_epnum = 0;
gadget->out_epnum = 0;
Expand Down
43 changes: 20 additions & 23 deletions drivers/usb/gadget/udc/amd5536udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3138,8 +3138,8 @@ static void udc_pci_remove(struct pci_dev *pdev)
writel(AMD_BIT(UDC_DEVCFG_SOFTRESET), &dev->regs->cfg);
if (dev->irq_registered)
free_irq(pdev->irq, dev);
if (dev->regs)
iounmap(dev->regs);
if (dev->virt_addr)
iounmap(dev->virt_addr);
if (dev->mem_region)
release_mem_region(pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0));
Expand Down Expand Up @@ -3226,17 +3226,13 @@ static int udc_pci_probe(

/* init */
dev = kzalloc(sizeof(struct udc), GFP_KERNEL);
if (!dev) {
retval = -ENOMEM;
goto finished;
}
if (!dev)
return -ENOMEM;

/* pci setup */
if (pci_enable_device(pdev) < 0) {
kfree(dev);
dev = NULL;
retval = -ENODEV;
goto finished;
goto err_pcidev;
}
dev->active = 1;

Expand All @@ -3246,28 +3242,22 @@ static int udc_pci_probe(

if (!request_mem_region(resource, len, name)) {
dev_dbg(&pdev->dev, "pci device used already\n");
kfree(dev);
dev = NULL;
retval = -EBUSY;
goto finished;
goto err_memreg;
}
dev->mem_region = 1;

dev->virt_addr = ioremap_nocache(resource, len);
if (dev->virt_addr == NULL) {
dev_dbg(&pdev->dev, "start address cannot be mapped\n");
kfree(dev);
dev = NULL;
retval = -EFAULT;
goto finished;
goto err_ioremap;
}

if (!pdev->irq) {
dev_err(&pdev->dev, "irq not set\n");
kfree(dev);
dev = NULL;
retval = -ENODEV;
goto finished;
goto err_irq;
}

spin_lock_init(&dev->lock);
Expand All @@ -3283,10 +3273,8 @@ static int udc_pci_probe(

if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) {
dev_dbg(&pdev->dev, "request_irq(%d) fail\n", pdev->irq);
kfree(dev);
dev = NULL;
retval = -EBUSY;
goto finished;
goto err_irq;
}
dev->irq_registered = 1;

Expand Down Expand Up @@ -3314,8 +3302,17 @@ static int udc_pci_probe(
return 0;

finished:
if (dev)
udc_pci_remove(pdev);
udc_pci_remove(pdev);
return retval;

err_irq:
iounmap(dev->virt_addr);
err_ioremap:
release_mem_region(resource, len);
err_memreg:
pci_disable_device(pdev);
err_pcidev:
kfree(dev);
return retval;
}

Expand Down
7 changes: 7 additions & 0 deletions drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,7 @@ void musb_start(struct musb *musb)
* (c) peripheral initiates, using SRP
*/
if (musb->port_mode != MUSB_PORT_MODE_HOST &&
musb->xceiv->otg->state != OTG_STATE_A_WAIT_BCON &&
(devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS) {
musb->is_active = 1;
} else {
Expand Down Expand Up @@ -2448,6 +2449,9 @@ static int musb_suspend(struct device *dev)
struct musb *musb = dev_to_musb(dev);
unsigned long flags;

musb_platform_disable(musb);
musb_generic_disable(musb);

spin_lock_irqsave(&musb->lock, flags);

if (is_peripheral_active(musb)) {
Expand Down Expand Up @@ -2501,6 +2505,9 @@ static int musb_resume(struct device *dev)
pm_runtime_disable(dev);
pm_runtime_set_active(dev);
pm_runtime_enable(dev);

musb_start(musb);

return 0;
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/musb/ux500.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ static const struct of_device_id ux500_match[] = {
{}
};

MODULE_DEVICE_TABLE(of, ux500_match);

static struct platform_driver ux500_driver = {
.probe = ux500_probe,
.remove = ux500_remove,
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/phy/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ config USB_MSM_OTG
config USB_QCOM_8X16_PHY
tristate "Qualcomm APQ8016/MSM8916 on-chip USB PHY controller support"
depends on ARCH_QCOM || COMPILE_TEST
depends on RESET_CONTROLLER
depends on RESET_CONTROLLER && EXTCON
select USB_PHY
select USB_ULPI_VIEWPORT
help
Expand Down
3 changes: 2 additions & 1 deletion drivers/usb/phy/phy-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
clk_rate = pdata->clk_rate;
needs_vcc = pdata->needs_vcc;
if (gpio_is_valid(pdata->gpio_reset)) {
err = devm_gpio_request_one(dev, pdata->gpio_reset, 0,
err = devm_gpio_request_one(dev, pdata->gpio_reset,
GPIOF_ACTIVE_LOW,
dev_name(dev));
if (!err)
nop->gpiod_reset =
Expand Down

0 comments on commit aa1471a

Please sign in to comment.