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

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

Merge "drivers: mailbox: rpmh: Correct matching of tcs command sequence"

parents 64190449 f546be08
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -695,10 +695,11 @@ static int find_match(struct tcs_mbox *tcs, struct tcs_cmd *cmd, int len)
		}
		}
		/* sanity check to ensure the seq is same */
		/* sanity check to ensure the seq is same */
		for (j = 1; j < len; j++) {
		for (j = 1; j < len; j++) {
			WARN((tcs->cmd_addr[i + j] != cmd[j].addr),
			if (tcs->cmd_addr[i + j] != cmd[j].addr) {
				"Message does not match previous sequence.\n");
				pr_debug("Message does not match previous sequence.\n");
				return -EINVAL;
				return -EINVAL;
			}
			}
		}
		found = true;
		found = true;
		break;
		break;
	}
	}
@@ -725,12 +726,12 @@ static int find_slots(struct tcs_mbox *tcs, struct tcs_mbox_msg *msg)
	do {
	do {
		slot = bitmap_find_next_zero_area(tcs->slots, MAX_TCS_SLOTS,
		slot = bitmap_find_next_zero_area(tcs->slots, MAX_TCS_SLOTS,
						n, msg->num_payload, 0);
						n, msg->num_payload, 0);
		if (slot == MAX_TCS_SLOTS)
		if (slot >= MAX_TCS_SLOTS)
			break;
			break;
		n += tcs->ncpt;
		n += tcs->ncpt;
	} while (slot + msg->num_payload - 1 >= n);
	} while (slot + msg->num_payload - 1 >= n);


	return (slot != MAX_TCS_SLOTS) ? slot : -ENOMEM;
	return (slot < MAX_TCS_SLOTS) ? slot : -ENOMEM;
}
}


static int tcs_mbox_write(struct mbox_chan *chan, struct tcs_mbox_msg *msg,
static int tcs_mbox_write(struct mbox_chan *chan, struct tcs_mbox_msg *msg,