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

Commit 7cfadaf9 authored by Ravinder Konka's avatar Ravinder Konka
Browse files

ipa: Fix holb monitor response handling from Uc



At the point when ISR routine is triggered, if the IPA
clients are 0, ISR handling will be deferred using
power_mgmt_wq and same workqueue is used to send
holb monitoring command after Uc is loaded. As a result
response to holb monitoring command will not be honored.
Make a change to use a different wq for sending holb
monitoring command.

Change-Id: I611155901e928fa8d9bbcbdf2511cd98aa36df2c
Acked-by: default avatarChaitanya Pratapa <cpratapa@qti.qualcomm.com>
Signed-off-by: default avatarRavinder Konka <rkonka@codeaurora.org>
parent 64ac3318
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -17,7 +17,9 @@
#define IPA_PKT_FLUSH_TO_US 100
#define IPA_PKT_FLUSH_TO_US 100
#define IPA_UC_POLL_SLEEP_USEC 100
#define IPA_UC_POLL_SLEEP_USEC 100
#define IPA_UC_POLL_MAX_RETRY 10000
#define IPA_UC_POLL_MAX_RETRY 10000
#define HOLB_WORKQUEUE_NAME "ipa_holb_wq"


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


@@ -470,7 +472,7 @@ static void ipa_uc_response_hdlr(enum ipa_irq_type interrupt,
		 * pipe if valid.
		 * pipe if valid.
		 */
		 */
		if (ipa_ctx->ipa_hw_type == IPA_HW_v2_6L)
		if (ipa_ctx->ipa_hw_type == IPA_HW_v2_6L)
			queue_work(ipa_ctx->power_mgmt_wq, &ipa_holb_work);
			queue_work(ipa_holb_wq, &ipa_holb_work);
	} else if (ipa_ctx->uc_ctx.uc_sram_mmio->responseOp ==
	} else if (ipa_ctx->uc_ctx.uc_sram_mmio->responseOp ==
		   IPA_HW_2_CPU_RESPONSE_CMD_COMPLETED) {
		   IPA_HW_2_CPU_RESPONSE_CMD_COMPLETED) {
		uc_rsp.raw32b = ipa_ctx->uc_ctx.uc_sram_mmio->responseParams;
		uc_rsp.raw32b = ipa_ctx->uc_ctx.uc_sram_mmio->responseParams;
@@ -508,6 +510,13 @@ int ipa_uc_interface_init(void)
		return 0;
		return 0;
	}
	}


	ipa_holb_wq = create_singlethread_workqueue(
			HOLB_WORKQUEUE_NAME);
	if (!ipa_holb_wq) {
		IPAERR("HOLB workqueue creation failed\n");
		return -ENOMEM;
	}

	mutex_init(&ipa_ctx->uc_ctx.uc_lock);
	mutex_init(&ipa_ctx->uc_ctx.uc_lock);


	if (ipa_ctx->ipa_hw_type >= IPA_HW_v2_5) {
	if (ipa_ctx->ipa_hw_type >= IPA_HW_v2_5) {