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

Commit 07fce61d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa: use timeout mechanism for holb monitoring command"

parents f6cac22a de960a9e
Loading
Loading
Loading
Loading
+27 −3
Original line number Diff line number Diff line
@@ -18,6 +18,9 @@
#define IPA_UC_POLL_SLEEP_USEC 100
#define IPA_UC_POLL_MAX_RETRY 10000

static void ipa_start_monitor_holb(struct work_struct *work);
static DECLARE_WORK(ipa_holb_work, ipa_start_monitor_holb);

/**
 * enum ipa_cpu_2_hw_commands - Values that represent the commands from the CPU
 * IPA_CPU_2_HW_CMD_NO_OP : No operation is required.
@@ -463,8 +466,11 @@ static void ipa_uc_response_hdlr(enum ipa_irq_type interrupt,
			if (uc_hdlrs[i].ipa_uc_loaded_hdlr)
				uc_hdlrs[i].ipa_uc_loaded_hdlr();
		}
		/* Enable holb monitoring on IPA-USB Producer pipe if valid. */
		ipa_uc_monitor_holb(IPA_CLIENT_USB_CONS, true);
		/* Queue the work to enable holb monitoring on IPA-USB Producer
		 * pipe if valid.
		 */
		if (ipa_ctx->ipa_hw_type == IPA_HW_v2_6L)
			queue_work(ipa_ctx->power_mgmt_wq, &ipa_holb_work);
	} else if (ipa_ctx->uc_ctx.uc_sram_mmio->responseOp ==
		   IPA_HW_2_CPU_RESPONSE_CMD_COMPLETED) {
		uc_rsp.raw32b = ipa_ctx->uc_ctx.uc_sram_mmio->responseParams;
@@ -791,12 +797,30 @@ int ipa_uc_monitor_holb(enum ipa_client_type ipa_client, bool enable)

	ret = ipa_uc_send_cmd(cmd.raw32b,
				IPA_CPU_2_HW_CMD_UPDATE_HOLB_MONITORING, 0,
				true, 10*HZ);
				false, 10*HZ);

	return ret;
}
EXPORT_SYMBOL(ipa_uc_monitor_holb);

/**
 * ipa_start_monitor_holb() - Send HOLB command to monitor IPA-USB
 * producer pipe.
 *
 * This function is called after uc is loaded to start monitoring
 * IPA pipe towrds USB in case if USB is already connected.
 *
 * Return codes:
 * None
 */
static void ipa_start_monitor_holb(struct work_struct *work)
{
	IPADBG("starting holb monitoring on IPA_CLIENT_USB_CONS\n");
	IPA2_ACTIVE_CLIENTS_INC_SIMPLE();
	ipa_uc_monitor_holb(IPA_CLIENT_USB_CONS, true);
	IPA2_ACTIVE_CLIENTS_DEC_SIMPLE();
}


/**
 * ipa_uc_notify_clk_state() - notify to uC of clock enable / disable