Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14c79662 authored by Ajay Agarwal's avatar Ajay Agarwal Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 7bf36025
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -223,6 +223,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;
@@ -3215,6 +3216,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);
	}
@@ -3589,7 +3591,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 */
		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",