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

Commit c2727348 authored by Skylar Chang's avatar Skylar Chang Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa: fix usb pm initialization



Initialize PM related members in IPA_USB always,
even if PM is not used. This is to avoid any race
conditions between different init functions.

Change-Id: I537b00030ee52f387cf92a9ec7065aa82191a979
CRs-Fixed: 2259107
Acked-by: default avatarAdy Abraham <adya@qti.qualcomm.com>
Signed-off-by: default avatarSkylar Chang <chiaweic@codeaurora.org>
parent 8f554946
Loading
Loading
Loading
Loading
+8 −13
Original line number Diff line number Diff line
@@ -2952,6 +2952,7 @@ static int __init ipa3_usb_init(void)
	int i;
	unsigned long flags;
	int res;
	struct ipa3_usb_pm_context *pm_ctx;

	pr_debug("entry\n");
	ipa3_usb_ctx = kzalloc(sizeof(struct ipa3_usb_context), GFP_KERNEL);
@@ -2971,19 +2972,13 @@ static int __init ipa3_usb_init(void)
	ipa3_usb_ctx->dl_data_pending = false;
	mutex_init(&ipa3_usb_ctx->general_mutex);

	if (ipa_pm_is_used()) {
		struct ipa3_usb_pm_context *pm_ctx;

		pm_ctx =
			&ipa3_usb_ctx->ttype_ctx[IPA_USB_TRANSPORT_TETH].pm_ctx;
	/* init PM related members */
	pm_ctx = &ipa3_usb_ctx->ttype_ctx[IPA_USB_TRANSPORT_TETH].pm_ctx;
	pm_ctx->hdl = ~0;
		pm_ctx->remote_wakeup_work =
			&ipa3_usb_notify_remote_wakeup_work;
	pm_ctx->remote_wakeup_work = &ipa3_usb_notify_remote_wakeup_work;
	pm_ctx = &ipa3_usb_ctx->ttype_ctx[IPA_USB_TRANSPORT_DPL].pm_ctx;
	pm_ctx->hdl = ~0;
		pm_ctx->remote_wakeup_work =
			&ipa3_usb_dpl_notify_remote_wakeup_work;
	}
	pm_ctx->remote_wakeup_work = &ipa3_usb_dpl_notify_remote_wakeup_work;

	for (i = 0; i < IPA_USB_TRANSPORT_MAX; i++) {
		ipa3_usb_ctx->ttype_ctx[i].rm_ctx.prod_valid = false;