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

Commit 2900b3c5 authored by Bala Kishore Pati's avatar Bala Kishore Pati
Browse files

ASoC: bg_glink: Add timeout of 3secs for RX intent req



Audio driver currently does not specify any timeout for
requesting glink RX intents. If the remote processor is
not responding to the glink_tx call, and wait forever
and blocks all the audio threads.
Add a 3sec timeout and unblock the audio threads if
an intent is not queued within that time.

Change-Id: Idf040ceb9696e15f279344c9599727cebc8d9f2e
Signed-off-by: default avatarBala Kishore Pati <balakishorepati@codeaurora.org>
parent b6f0076d
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@

#define GLINK_LINK_STATE_UP_WAIT_TIMEOUT 5000
#define APR_MAXIMUM_NUM_OF_RETRIES 2
#define BG_RX_INTENT_REQ_TIMEOUT_MS 3000
#define BG_GLINK_NAME "bg-cdc-glink"
#define BG_GLINK_EDGE "bg"
#define BG_MAX_NO_OF_INTENTS 20
@@ -284,6 +285,7 @@ void *bg_cdc_channel_open(struct platform_device *pdev,
	open_cfg.notify_rx_intent_req = bg_cdc_glink_notify_rx_intent_req;
	open_cfg.notify_remote_rx_intent = bg_cdc_glink_notify_remote_rx_intent;
	open_cfg.notify_tx_abort = bg_cdc_glink_notify_tx_abort;
	open_cfg.rx_intent_req_timeout_ms = BG_RX_INTENT_REQ_TIMEOUT_MS;
	open_cfg.priv = ch_info;

	ch_info->channel_state = GLINK_REMOTE_DISCONNECTED;
@@ -304,18 +306,6 @@ void *bg_cdc_channel_open(struct platform_device *pdev,
		rc = -ETIMEDOUT;
		goto close_link;
	}

	/*
	 * Remote intent is not required for GLINK <--> BG
	 * designed not to fail the open call.
	 */
	rc = wait_event_timeout(ch_info->wait,
		ch_info->if_remote_intent_ready, 5 * HZ);
	if (rc == 0)
		dev_err(&pdev->dev, "%s: TIMEOUT for remote intent readiness\n",
			__func__);

	pr_err("Remote is ready !!!\n");
	rc = bg_cdc_glink_rx_intents_config(ch_info,
				ch_cfg->num_of_intents, ch_cfg->intents_size);
	if (rc) {