Skip to content
This repository was archived by the owner on Sep 24, 2020. It is now read-only.

Commit f74875d

Browse files
lategoodbyeFelipe Balbi
authored andcommitted
usb: dwc2: fix kernel oops during driver probe
This patch make sure that all necessary members of dwc2_hsotg are initialized before the irq handler is requested. So the kernel oops triggered by dwc2_handle_common_intr has been fixed. dwc2 20980000.usb: Configuration mismatch. Forcing host mode dwc2 20980000.usb: no platform data or transceiver defined Unable to handle kernel paging request at virtual address cc860040 pgd = c0004000 [cc860040] *pgd=0b41e811, *pte=00000000, *ppte=00000000 Internal error: Oops: 7 [#1] ARM CPU: 0 PID: 1 Comm: swapper Not tainted 4.3.0-rc3+ #19 Hardware name: BCM2835 task: cb494000 ti: cb4d0000 task.ti: cb4d0000 PC is at dwc2_is_controller_alive+0x18/0x34 LR is at dwc2_handle_common_intr+0x24/0xb60 Acked-by: John Youn <[email protected]> Tested-by: Marek Szyprowski <[email protected]> Signed-off-by: Stefan Wahren <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent 5c256b6 commit f74875d

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

drivers/usb/dwc2/platform.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -367,20 +367,6 @@ static int dwc2_driver_probe(struct platform_device *dev)
367367
if (retval)
368368
return retval;
369369

370-
irq = platform_get_irq(dev, 0);
371-
if (irq < 0) {
372-
dev_err(&dev->dev, "missing IRQ resource\n");
373-
return irq;
374-
}
375-
376-
dev_dbg(hsotg->dev, "registering common handler for irq%d\n",
377-
irq);
378-
retval = devm_request_irq(hsotg->dev, irq,
379-
dwc2_handle_common_intr, IRQF_SHARED,
380-
dev_name(hsotg->dev), hsotg);
381-
if (retval)
382-
return retval;
383-
384370
res = platform_get_resource(dev, IORESOURCE_MEM, 0);
385371
hsotg->regs = devm_ioremap_resource(&dev->dev, res);
386372
if (IS_ERR(hsotg->regs))
@@ -415,6 +401,20 @@ static int dwc2_driver_probe(struct platform_device *dev)
415401

416402
dwc2_set_all_params(hsotg->core_params, -1);
417403

404+
irq = platform_get_irq(dev, 0);
405+
if (irq < 0) {
406+
dev_err(&dev->dev, "missing IRQ resource\n");
407+
return irq;
408+
}
409+
410+
dev_dbg(hsotg->dev, "registering common handler for irq%d\n",
411+
irq);
412+
retval = devm_request_irq(hsotg->dev, irq,
413+
dwc2_handle_common_intr, IRQF_SHARED,
414+
dev_name(hsotg->dev), hsotg);
415+
if (retval)
416+
return retval;
417+
418418
retval = dwc2_lowlevel_hw_enable(hsotg);
419419
if (retval)
420420
return retval;

0 commit comments

Comments
 (0)