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

Commit d23cacb3 authored by Amir Samuelov's avatar Amir Samuelov Committed by Gerrit - the friendly Code Review server
Browse files

spcom: open channel return EBUSY when channel in use



The char device /dev/sp_kernel is used for loading SP application and
creating new channel char device, therefore might be temporary busy.
Return EBUSY error to user system call open() so it can retry.

Change-Id: I230577fe6b03ac7afd7175f72f9a3fa80db5a524
Signed-off-by: default avatarAmir Samuelov <amirs@codeaurora.org>
parent ace73576
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -718,8 +718,10 @@ static int spcom_open(struct spcom_channel *ch, unsigned int timeout_msec)

	/* only one client/server may use the channel */
	if (ch->ref_count) {
		pr_err("channel [%s] already in use.\n", name);
		goto exit_err;
		pr_err("channel [%s] is BUSY, already in use by pid [%d].\n",
			name, ch->pid);
		mutex_unlock(&ch->lock);
		return -EBUSY;
	}

	pr_debug("ch [%s] opened by PID [%d], count [%d]\n",