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

Commit a9f299be authored by Konstantin Dorfman's avatar Konstantin Dorfman
Browse files

soc: qcom: spcom: fix poll() for channel connected



Userspace loads SP application and immediately polls for link up on
spcom channel matching the application loaded.

There is a race between rpmsg device arrived and channel state becomes
connected, so poll() called on channel returns 1(link up) to spcomlib.

This change fixes link up logic: instead of checking the channel
completion state, need to check that rpmsg device arrived for the
channel.

Change-Id: I1920a9a55d6ab0cf886996b27e32515df465cc9b
Signed-off-by: default avatarKonstantin Dorfman <kdorfman@codeaurora.org>
parent 246f3f73
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1622,7 +1622,8 @@ static unsigned int spcom_device_poll(struct file *filp,
			pr_debug("ch [%s] poll CH_CONNECT signaled\n", name);
		}
		mutex_lock(&ch->lock);
		done = completion_done(&ch->connect);
		done = (ch->rpdev != NULL);
		pr_debug("ch [%s] reported done=%d\n", name, done);
		mutex_unlock(&ch->lock);
		break;
	default: