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

Commit 7eef74a3 authored by Xiaojun Sang's avatar Xiaojun Sang
Browse files

soc: swr: release transaction slot at failure



Transaction slot is not freed when failure happens. Accumulated
error may lead to breach of transaction slot limit. Free the
transaction slot at failure.

Change-Id: I8588be18a820306d2a596fe2bf4a97346076b9b9
Signed-off-by: default avatarXiaojun Sang <xsang@codeaurora.org>
parent 5fbd9fb1
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -1660,6 +1660,7 @@ static int swrm_connect_port(struct swr_master *master,
	mutex_lock(&swrm->mlock);
	mutex_lock(&swrm->devlock);
	if (!swrm->dev_up) {
		swr_port_response(master, portinfo->tid);
		mutex_unlock(&swrm->devlock);
		mutex_unlock(&swrm->mlock);
		return -EINVAL;
@@ -1728,6 +1729,7 @@ static int swrm_connect_port(struct swr_master *master,

port_fail:
mem_fail:
	swr_port_response(master, portinfo->tid);
	/* cleanup  port reqs in error condition */
	swrm_cleanup_disabled_port_reqs(master);
	mutex_unlock(&swrm->mlock);
@@ -1764,8 +1766,7 @@ static int swrm_disconnect_port(struct swr_master *master,
			dev_err(&master->dev,
				"%s: mstr portid for slv port %d not found\n",
				__func__, portinfo->port_id[i]);
			mutex_unlock(&swrm->mlock);
			return -EINVAL;
			goto err;
		}
		mport = &(swrm->mport_cfg[mstr_port_id]);
		/* get port req */
@@ -1775,8 +1776,7 @@ static int swrm_disconnect_port(struct swr_master *master,
		if (!port_req) {
			dev_err(&master->dev, "%s:port not enabled : port %d\n",
					 __func__, portinfo->port_id[i]);
			mutex_unlock(&swrm->mlock);
			return -EINVAL;
			goto err;
		}
		port_req->req_ch &= ~portinfo->ch_en[i];
		mport->req_ch &= ~mstr_ch_mask;
@@ -1793,6 +1793,11 @@ static int swrm_disconnect_port(struct swr_master *master,
	mutex_unlock(&swrm->mlock);

	return 0;

err:
	swr_port_response(master, portinfo->tid);
	mutex_unlock(&swrm->mlock);
	return -EINVAL;
}

static int swrm_find_alert_slave(struct swr_mstr_ctrl *swrm,