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

Commit b8b74a9b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: qcom: smd: Return -EBUSY for a port that exists but is already open"

parents 58cde467 5c83fb84
Loading
Loading
Loading
Loading
+14 −1
Original line number Original line Diff line number Diff line
@@ -1936,8 +1936,21 @@ int smd_named_open_on_edge(const char *name, uint32_t edge,


	ch = smd_get_channel(name, edge);
	ch = smd_get_channel(name, edge);
	if (!ch) {
	if (!ch) {
		/* check closing list for port */
		spin_lock_irqsave(&smd_lock, flags);
		spin_lock_irqsave(&smd_lock, flags);
		/* check opened list for port */
		list_for_each_entry(ch,
			&remote_info[edge_to_pids[edge].remote_pid].ch_list,
			ch_list) {
			if (!strcmp(name, ch->name)) {
				/* channel is already open */
				spin_unlock_irqrestore(&smd_lock, flags);
				SMD_DBG("smd_open: channel '%s' already open\n",
					ch->name);
				return -EBUSY;
			}
		}

		/* check closing list for port */
		list_for_each_entry(ch, &smd_ch_closing_list, ch_list) {
		list_for_each_entry(ch, &smd_ch_closing_list, ch_list) {
			if (!strncmp(name, ch->name, 20) &&
			if (!strncmp(name, ch->name, 20) &&
				(edge == ch->type)) {
				(edge == ch->type)) {