Commit aa1471a3 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'fixes-for-v4.3-rc2' of...

Merge tag 'fixes-for-v4.3-rc2' of git://git.kernel.org/pub/scm/linux/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: default avatarFelipe Balbi <balbi@ti.com>
parents 6ff33f39 762982db
...@@ -514,8 +514,6 @@ static int dwc3_omap_probe(struct platform_device *pdev) ...@@ -514,8 +514,6 @@ static int dwc3_omap_probe(struct platform_device *pdev)
goto err1; goto err1;
} }
dwc3_omap_enable_irqs(omap);
ret = dwc3_omap_extcon_register(omap); ret = dwc3_omap_extcon_register(omap);
if (ret < 0) if (ret < 0)
goto err2; goto err2;
...@@ -526,6 +524,8 @@ static int dwc3_omap_probe(struct platform_device *pdev) ...@@ -526,6 +524,8 @@ static int dwc3_omap_probe(struct platform_device *pdev)
goto err3; goto err3;
} }
dwc3_omap_enable_irqs(omap);
return 0; return 0;
err3: err3:
......
...@@ -186,6 +186,7 @@ void usb_ep_autoconfig_reset (struct usb_gadget *gadget) ...@@ -186,6 +186,7 @@ void usb_ep_autoconfig_reset (struct usb_gadget *gadget)
list_for_each_entry (ep, &gadget->ep_list, ep_list) { list_for_each_entry (ep, &gadget->ep_list, ep_list) {
ep->claimed = false; ep->claimed = false;
ep->driver_data = NULL;
} }
gadget->in_epnum = 0; gadget->in_epnum = 0;
gadget->out_epnum = 0; gadget->out_epnum = 0;
......
...@@ -3138,8 +3138,8 @@ static void udc_pci_remove(struct pci_dev *pdev) ...@@ -3138,8 +3138,8 @@ static void udc_pci_remove(struct pci_dev *pdev)
writel(AMD_BIT(UDC_DEVCFG_SOFTRESET), &dev->regs->cfg); writel(AMD_BIT(UDC_DEVCFG_SOFTRESET), &dev->regs->cfg);
if (dev->irq_registered) if (dev->irq_registered)
free_irq(pdev->irq, dev); free_irq(pdev->irq, dev);
if (dev->regs) if (dev->virt_addr)
iounmap(dev->regs); iounmap(dev->virt_addr);
if (dev->mem_region) if (dev->mem_region)
release_mem_region(pci_resource_start(pdev, 0), release_mem_region(pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0)); pci_resource_len(pdev, 0));
...@@ -3226,17 +3226,13 @@ static int udc_pci_probe( ...@@ -3226,17 +3226,13 @@ static int udc_pci_probe(
/* init */ /* init */
dev = kzalloc(sizeof(struct udc), GFP_KERNEL); dev = kzalloc(sizeof(struct udc), GFP_KERNEL);
if (!dev) { if (!dev)
retval = -ENOMEM; return -ENOMEM;
goto finished;
}
/* pci setup */ /* pci setup */
if (pci_enable_device(pdev) < 0) { if (pci_enable_device(pdev) < 0) {
kfree(dev);
dev = NULL;
retval = -ENODEV; retval = -ENODEV;
goto finished; goto err_pcidev;
} }
dev->active = 1; dev->active = 1;
...@@ -3246,28 +3242,22 @@ static int udc_pci_probe( ...@@ -3246,28 +3242,22 @@ static int udc_pci_probe(
if (!request_mem_region(resource, len, name)) { if (!request_mem_region(resource, len, name)) {
dev_dbg(&pdev->dev, "pci device used already\n"); dev_dbg(&pdev->dev, "pci device used already\n");
kfree(dev);
dev = NULL;
retval = -EBUSY; retval = -EBUSY;
goto finished; goto err_memreg;
} }
dev->mem_region = 1; dev->mem_region = 1;
dev->virt_addr = ioremap_nocache(resource, len); dev->virt_addr = ioremap_nocache(resource, len);
if (dev->virt_addr == NULL) { if (dev->virt_addr == NULL) {
dev_dbg(&pdev->dev, "start address cannot be mapped\n"); dev_dbg(&pdev->dev, "start address cannot be mapped\n");
kfree(dev);
dev = NULL;
retval = -EFAULT; retval = -EFAULT;
goto finished; goto err_ioremap;
} }
if (!pdev->irq) { if (!pdev->irq) {
dev_err(&pdev->dev, "irq not set\n"); dev_err(&pdev->dev, "irq not set\n");
kfree(dev);
dev = NULL;
retval = -ENODEV; retval = -ENODEV;
goto finished; goto err_irq;
} }
spin_lock_init(&dev->lock); spin_lock_init(&dev->lock);
...@@ -3283,10 +3273,8 @@ static int udc_pci_probe( ...@@ -3283,10 +3273,8 @@ static int udc_pci_probe(
if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) { if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) {
dev_dbg(&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; retval = -EBUSY;
goto finished; goto err_irq;
} }
dev->irq_registered = 1; dev->irq_registered = 1;
...@@ -3314,8 +3302,17 @@ static int udc_pci_probe( ...@@ -3314,8 +3302,17 @@ static int udc_pci_probe(
return 0; return 0;
finished: 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; return retval;
} }
......
...@@ -1051,6 +1051,7 @@ void musb_start(struct musb *musb) ...@@ -1051,6 +1051,7 @@ void musb_start(struct musb *musb)
* (c) peripheral initiates, using SRP * (c) peripheral initiates, using SRP
*/ */
if (musb->port_mode != MUSB_PORT_MODE_HOST && if (musb->port_mode != MUSB_PORT_MODE_HOST &&
musb->xceiv->otg->state != OTG_STATE_A_WAIT_BCON &&
(devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS) { (devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS) {
musb->is_active = 1; musb->is_active = 1;
} else { } else {
...@@ -2448,6 +2449,9 @@ static int musb_suspend(struct device *dev) ...@@ -2448,6 +2449,9 @@ static int musb_suspend(struct device *dev)
struct musb *musb = dev_to_musb(dev); struct musb *musb = dev_to_musb(dev);
unsigned long flags; unsigned long flags;
musb_platform_disable(musb);
musb_generic_disable(musb);
spin_lock_irqsave(&musb->lock, flags); spin_lock_irqsave(&musb->lock, flags);
if (is_peripheral_active(musb)) { if (is_peripheral_active(musb)) {
...@@ -2501,6 +2505,9 @@ static int musb_resume(struct device *dev) ...@@ -2501,6 +2505,9 @@ static int musb_resume(struct device *dev)
pm_runtime_disable(dev); pm_runtime_disable(dev);
pm_runtime_set_active(dev); pm_runtime_set_active(dev);
pm_runtime_enable(dev); pm_runtime_enable(dev);
musb_start(musb);
return 0; return 0;
} }
......
...@@ -379,6 +379,8 @@ static const struct of_device_id ux500_match[] = { ...@@ -379,6 +379,8 @@ static const struct of_device_id ux500_match[] = {
{} {}
}; };
MODULE_DEVICE_TABLE(of, ux500_match);
static struct platform_driver ux500_driver = { static struct platform_driver ux500_driver = {
.probe = ux500_probe, .probe = ux500_probe,
.remove = ux500_remove, .remove = ux500_remove,
......
...@@ -155,7 +155,7 @@ config USB_MSM_OTG ...@@ -155,7 +155,7 @@ config USB_MSM_OTG
config USB_QCOM_8X16_PHY config USB_QCOM_8X16_PHY
tristate "Qualcomm APQ8016/MSM8916 on-chip USB PHY controller support" tristate "Qualcomm APQ8016/MSM8916 on-chip USB PHY controller support"
depends on ARCH_QCOM || COMPILE_TEST depends on ARCH_QCOM || COMPILE_TEST
depends on RESET_CONTROLLER depends on RESET_CONTROLLER && EXTCON
select USB_PHY select USB_PHY
select USB_ULPI_VIEWPORT select USB_ULPI_VIEWPORT
help help
......
...@@ -232,7 +232,8 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop, ...@@ -232,7 +232,8 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
clk_rate = pdata->clk_rate; clk_rate = pdata->clk_rate;
needs_vcc = pdata->needs_vcc; needs_vcc = pdata->needs_vcc;
if (gpio_is_valid(pdata->gpio_reset)) { 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)); dev_name(dev));
if (!err) if (!err)
nop->gpiod_reset = nop->gpiod_reset =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment