소스 검색

rpmsg: smd: Reduce restrictions when finding channel

SMD channels are created by the remotes in "opening" state, but
sometimes as we close and try to reopen them they linger in closing
state.

Following the search for a matching channel the create_ept() will verify
that the channel is in a suitable state, so we can lax the restrictions
of the search function to work around above difference in behaviour.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Bjorn Andersson 8 년 전
부모
커밋
66dca399e6
1개의 변경된 파일4개의 추가작업 그리고 11개의 파일을 삭제
  1. 4 11
      drivers/rpmsg/qcom_smd.c

+ 4 - 11
drivers/rpmsg/qcom_smd.c

@@ -820,20 +820,13 @@ qcom_smd_find_channel(struct qcom_smd_edge *edge, const char *name)
 	struct qcom_smd_channel *channel;
 	struct qcom_smd_channel *ret = NULL;
 	unsigned long flags;
-	unsigned state;
 
 	spin_lock_irqsave(&edge->channels_lock, flags);
 	list_for_each_entry(channel, &edge->channels, list) {
-		if (strcmp(channel->name, name))
-			continue;
-
-		state = GET_RX_CHANNEL_INFO(channel, state);
-		if (state != SMD_CHANNEL_OPENING &&
-		    state != SMD_CHANNEL_OPENED)
-			continue;
-
-		ret = channel;
-		break;
+		if (!strcmp(channel->name, name)) {
+			ret = channel;
+			break;
+		}
 	}
 	spin_unlock_irqrestore(&edge->channels_lock, flags);