diff options
| author | Amir Samuelov <amirs@codeaurora.org> | 2017-05-28 16:11:37 +0300 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-05-30 02:54:46 -0700 |
| commit | d23cacb3acdba8c0253c70df71b9663becad229e (patch) | |
| tree | ea4d1bb29d699b996f3a10e62d578a68cdcbe65c | |
| parent | ace73576d2eb567f552a699109b32d0917fccdbd (diff) | |
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: Amir Samuelov <amirs@codeaurora.org>
| -rw-r--r-- | drivers/soc/qcom/spcom.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/soc/qcom/spcom.c b/drivers/soc/qcom/spcom.c index 0e1e4ae975b0..d1f300e6afb7 100644 --- a/drivers/soc/qcom/spcom.c +++ b/drivers/soc/qcom/spcom.c @@ -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", |
