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

Commit c04d8710 authored by Kiran Gunda's avatar Kiran Gunda
Browse files

Slim_ngd: Modify waiting mechanism in kthread



wait_for_completion_timeout() is not a good option in
kthread as it leads to scheduling the kthread on the every timeout.
Hence modify it to wait_for_completion() from
wait_for_completion_timeout().

Change-Id: Iaa29e997fd1cd5cb02f9ba44e69e1700b31736ae
Signed-off-by: default avatarKiran Gunda <kgunda@codeaurora.org>
parent cac2a5e0
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -1074,11 +1074,7 @@ static int ngd_slim_rx_msgq_thread(void *data)

	while (!kthread_should_stop()) {
		set_current_state(TASK_INTERRUPTIBLE);
		ret = wait_for_completion_interruptible(notify);
		if (ret) {
			dev_err(dev->dev, "rx thread wait err:%d", ret);
			continue;
		}
		wait_for_completion(notify);
		/* 1 irq notification per message */
		if (dev->use_rx_msgqs != MSM_MSGQ_ENABLED) {
			msm_slim_rx_dequeue(dev, (u8 *)buffer);
@@ -1116,12 +1112,7 @@ static int ngd_notify_slaves(void *data)
	int ret, i = 0;
	while (!kthread_should_stop()) {
		set_current_state(TASK_INTERRUPTIBLE);
		ret = wait_for_completion_timeout(&dev->qmi.slave_notify,
								HZ);
		if (!ret) {
			dev_dbg(dev->dev, "slave thread wait err:%d", ret);
			continue;
		}
		wait_for_completion(&dev->qmi.slave_notify);
		/* Probe devices for first notification */
		if (!i) {
			dev->err = 0;