mirror of
https://github.com/torvalds/linux
synced 2024-10-23 19:57:28 +00:00
usb: dwc3: core: modify IO memory resource after deferred probe completes
When deferred probe happens driver will try to ioremap multiple times and will fail. Memory resource.start variable is a global variable, modifications in this field will be accumulated on every probe. Fix this by moving the above operations after driver hold all required PHY's. Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
a554aea67a
commit
2e112345c2
|
@ -384,21 +384,6 @@ static int dwc3_probe(struct platform_device *pdev)
|
||||||
dev_err(dev, "missing memory resource\n");
|
dev_err(dev, "missing memory resource\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
dwc->xhci_resources[0].start = res->start;
|
|
||||||
dwc->xhci_resources[0].end = dwc->xhci_resources[0].start +
|
|
||||||
DWC3_XHCI_REGS_END;
|
|
||||||
dwc->xhci_resources[0].flags = res->flags;
|
|
||||||
dwc->xhci_resources[0].name = res->name;
|
|
||||||
|
|
||||||
res->start += DWC3_GLOBALS_REGS_START;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Request memory region but exclude xHCI regs,
|
|
||||||
* since it will be requested by the xhci-plat driver.
|
|
||||||
*/
|
|
||||||
regs = devm_ioremap_resource(dev, res);
|
|
||||||
if (IS_ERR(regs))
|
|
||||||
return PTR_ERR(regs);
|
|
||||||
|
|
||||||
if (node) {
|
if (node) {
|
||||||
dwc->maximum_speed = of_usb_get_maximum_speed(node);
|
dwc->maximum_speed = of_usb_get_maximum_speed(node);
|
||||||
|
@ -452,6 +437,22 @@ static int dwc3_probe(struct platform_device *pdev)
|
||||||
return -EPROBE_DEFER;
|
return -EPROBE_DEFER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dwc->xhci_resources[0].start = res->start;
|
||||||
|
dwc->xhci_resources[0].end = dwc->xhci_resources[0].start +
|
||||||
|
DWC3_XHCI_REGS_END;
|
||||||
|
dwc->xhci_resources[0].flags = res->flags;
|
||||||
|
dwc->xhci_resources[0].name = res->name;
|
||||||
|
|
||||||
|
res->start += DWC3_GLOBALS_REGS_START;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Request memory region but exclude xHCI regs,
|
||||||
|
* since it will be requested by the xhci-plat driver.
|
||||||
|
*/
|
||||||
|
regs = devm_ioremap_resource(dev, res);
|
||||||
|
if (IS_ERR(regs))
|
||||||
|
return PTR_ERR(regs);
|
||||||
|
|
||||||
usb_phy_set_suspend(dwc->usb2_phy, 0);
|
usb_phy_set_suspend(dwc->usb2_phy, 0);
|
||||||
usb_phy_set_suspend(dwc->usb3_phy, 0);
|
usb_phy_set_suspend(dwc->usb3_phy, 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue