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

Commit 5e5bc9a7 authored by Yan He's avatar Yan He Committed by Stephen Boyd
Browse files

msm: sps: update the checking of free slots



There is a new BAM use case where the client driver does not use
either interrupt or polling for a pipe. Thus, add a new way to
check the free slots in descriptor FIFO for this case.

Change-Id: I133b938718d0c3654309e65ac0670fe1725a937f
Signed-off-by: default avatarYan He <yanhe@codeaurora.org>
parent 2071905f
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1355,6 +1355,7 @@ int sps_bam_pipe_transfer(struct sps_bam *dev,
	void *user;
	int n;
	int result;
	struct sps_pipe *pipe = dev->pipes[pipe_index];

	if (transfer->iovec_count == 0) {
		SPS_ERR("sps:iovec count zero: BAM 0x%x pipe %d\n",
@@ -1362,7 +1363,13 @@ int sps_bam_pipe_transfer(struct sps_bam *dev,
		return SPS_ERROR;
	}

	if (!pipe->sys.ack_xfers && pipe->polled) {
		sps_bam_pipe_get_unused_desc_num(dev, pipe_index,
					&count);
		count = pipe->desc_size - count - 1;
	} else
		sps_bam_get_free_count(dev, pipe_index, &count);

	if (count < transfer->iovec_count) {
		SPS_ERR("sps:Insufficient free desc: BAM 0x%x pipe %d: %d\n",
			BAM_ID(dev), pipe_index, count);