aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc2/gadget.c
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2014-09-09 04:44:12 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-09 13:17:48 -0400
commiteb3c56c5ccdd252940cb0ec0541fcdc94894bd8d (patch)
treeb135a01110e9de6fe5c919f8909ecd7742561d05 /drivers/usb/dwc2/gadget.c
parentb510df5a36c066da3a188f4ade3404118b63c6de (diff)
usb: dwc2/gadget: delay enabling irq once hardware is configured properly
This patch fixes kernel panic/interrupt storm/etc issues if bootloader left s3c-hsotg module in enabled state. Now interrupt handler is enabled only after proper configuration of hardware registers. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Cc: stable <stable@vger.kernel.org> # 3.16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/dwc2/gadget.c')
-rw-r--r--drivers/usb/dwc2/gadget.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 474eae2e1692..43fd3d567fc5 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3441,13 +3441,6 @@ static int s3c_hsotg_probe(struct platform_device *pdev)
3441 3441
3442 hsotg->irq = ret; 3442 hsotg->irq = ret;
3443 3443
3444 ret = devm_request_irq(&pdev->dev, hsotg->irq, s3c_hsotg_irq, 0,
3445 dev_name(dev), hsotg);
3446 if (ret < 0) {
3447 dev_err(dev, "cannot claim IRQ\n");
3448 goto err_clk;
3449 }
3450
3451 dev_info(dev, "regs %p, irq %d\n", hsotg->regs, hsotg->irq); 3444 dev_info(dev, "regs %p, irq %d\n", hsotg->regs, hsotg->irq);
3452 3445
3453 hsotg->gadget.max_speed = USB_SPEED_HIGH; 3446 hsotg->gadget.max_speed = USB_SPEED_HIGH;
@@ -3495,6 +3488,17 @@ static int s3c_hsotg_probe(struct platform_device *pdev)
3495 s3c_hsotg_init(hsotg); 3488 s3c_hsotg_init(hsotg);
3496 s3c_hsotg_hw_cfg(hsotg); 3489 s3c_hsotg_hw_cfg(hsotg);
3497 3490
3491 ret = devm_request_irq(&pdev->dev, hsotg->irq, s3c_hsotg_irq, 0,
3492 dev_name(dev), hsotg);
3493 if (ret < 0) {
3494 s3c_hsotg_phy_disable(hsotg);
3495 clk_disable_unprepare(hsotg->clk);
3496 regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies),
3497 hsotg->supplies);
3498 dev_err(dev, "cannot claim IRQ\n");
3499 goto err_clk;
3500 }
3501
3498 /* hsotg->num_of_eps holds number of EPs other than ep0 */ 3502 /* hsotg->num_of_eps holds number of EPs other than ep0 */
3499 3503
3500 if (hsotg->num_of_eps == 0) { 3504 if (hsotg->num_of_eps == 0) {