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

Commit 85c2118a authored by Chris Lew's avatar Chris Lew
Browse files

neuron: block_client: Wait for channel to init



Wait until all conditions are met instead of busy looping to check if
the channels are finished initializing.

Change-Id: I50bd3bad6ccf3f4957ed0a98cdceed45d49fe851
Acked-by: default avatarChris Henroid <chenroid@qti.qualcomm.com>
Signed-off-by: default avatarChris Lew <clew@codeaurora.org>
parent 304f2f12
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -178,8 +178,8 @@ static int protocol_block_client_thread(void *data)
	skb_req = NULL;
	skb_req = NULL;


	/* Wait for the channels to start */
	/* Wait for the channels to start */
	while (!kthread_should_stop()) {
	wakeup_mask = 0;
	wakeup_mask = 0;
	while (!kthread_should_stop()) {
		if (!channel_dev->max_size || !channel_dev->queue_length)
		if (!channel_dev->max_size || !channel_dev->queue_length)
			wakeup_mask |= CHANNEL_BIT(C_IN);
			wakeup_mask |= CHANNEL_BIT(C_IN);


@@ -190,8 +190,13 @@ static int protocol_block_client_thread(void *data)
			break;
			break;


		wait_event_killable(kdata->wait_q,
		wait_event_killable(kdata->wait_q,
				    kthread_should_stop() ||
				    (kdata->wakeups &&
				    (kdata->wakeups & wakeup_mask));
				    channel_dev->max_size &&
				    channel_dev->queue_length &&
				    channel_dev_r->max_size &&
				    channel_dev_r->queue_length) ||
				    kthread_should_stop());
		wakeup_mask = 0;
	}
	}
	if (kthread_should_stop())
	if (kthread_should_stop())
		return 0;
		return 0;