summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorAjay Agarwal <ajaya@codeaurora.org>2017-07-28 10:56:24 +0530
committerAjay Agarwal <ajaya@codeaurora.org>2017-11-08 11:27:35 +0530
commit76cde531db9964f5b00fe9577391762666d3d28d (patch)
tree8057aaddf9d303e46d75e222678430ffa0dad6b2 /drivers/usb/dwc3
parentc64b5ccbba33214094f8eed3f1117c7a8d9720f0 (diff)
dwc3: Do not perform core reinitialisation for host only mode
Cuurently as a part of start host, after the block reset we are performing core init and gadget restart of the dwc3 controller. This causes crash for host only controller where ep0 and ep1 have not been initialised but are being dereferenced. Also, HW reinitialisation is not required for start or restart host routine. Change-Id: Ie2b781ecb03a1d0a02c5f4305d518adc18dc6ade Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/dwc3-msm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c
index d92a33097461..26422a659bfc 100644
--- a/drivers/usb/dwc3/dwc3-msm.c
+++ b/drivers/usb/dwc3/dwc3-msm.c
@@ -224,6 +224,7 @@ struct dwc3_msm {
struct notifier_block id_nb;
struct notifier_block host_nb;
+ bool host_only_mode;
int pwr_event_irq;
atomic_t in_p3;
@@ -3224,6 +3225,7 @@ static int dwc3_msm_probe(struct platform_device *pdev)
if (host_mode ||
(dwc->is_drd && !of_property_read_bool(node, "extcon"))) {
dev_dbg(&pdev->dev, "DWC3 in default host mode\n");
+ mdwc->host_only_mode = true;
mdwc->id_state = DWC3_ID_GROUND;
dwc3_ext_event_notify(mdwc);
}
@@ -3598,7 +3600,9 @@ static int dwc3_otg_start_host(struct dwc3_msm *mdwc, int on)
mdwc->in_host_mode = false;
/* re-init core and OTG registers as block reset clears these */
- dwc3_post_host_reset_core_init(dwc);
+ if (!mdwc->host_only_mode)
+ dwc3_post_host_reset_core_init(dwc);
+
pm_runtime_mark_last_busy(mdwc->dev);
pm_runtime_put_sync_autosuspend(mdwc->dev);
dbg_event(0xFF, "StopHost psync",