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

Commit 2ccab9be authored by Sagar Dharia's avatar Sagar Dharia
Browse files

slim_ngd: Return success for resource removal requests if HW restarts



Channel and ports are removed when HW restarts. Return success to
client channel removal, port disconnection requests when slimbus HW
is restarting.

Change-Id: Ifc9a3bb80023c823a7776a16fe32e5b59b181350
Signed-off-by: default avatarSagar Dharia <sdharia@codeaurora.org>
parent 47bfc95a
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -312,12 +312,15 @@ static int ngd_xfer_msg(struct slim_controller *ctrl, struct slim_msg_txn *txn)
			 * Returning 0 on the disconnections and
			 * removals will ensure consistent state of channels,
			 * ports with the HW
			 * Remote requests to remove channel/port will be
			 * returned from the path where they wait on
			 * acknowledgement from ADSP
			 */
			if ((txn->mt == SLIM_MSG_MT_DEST_REFERRED_USER) &&
				((mc == SLIM_USR_MC_CHAN_CTRL ||
				mc == SLIM_USR_MC_DISCONNECT_PORT ||
				mc == SLIM_USR_MC_RECONFIG_NOW)))
				return 0;
				return -EREMOTEIO;
			if ((txn->mt == SLIM_MSG_MT_CORE) &&
				((mc == SLIM_MSG_MC_DISCONNECT_PORT ||
				mc == SLIM_MSG_MC_NEXT_REMOVE_CHANNEL ||
@@ -554,7 +557,9 @@ static int ngd_xferandwait_ack(struct slim_controller *ctrl,
		else
			ret = txn->ec;
	}

	if (ret) {
		if (ret != -EREMOTEIO || txn->mc != SLIM_USR_MC_CHAN_CTRL)
			pr_err("master msg:0x%x,tid:%d ret:%d", txn->mc,
				txn->tid, ret);
		mutex_lock(&ctrl->m_ctrl);
@@ -681,7 +686,10 @@ static int ngd_allocbw(struct slim_device *sb, int *subfrmc, int *clkgear)
		txn.mc = SLIM_USR_MC_CHAN_CTRL;
		txn.rl = txn.len + 4;
		ret = ngd_xferandwait_ack(ctrl, &txn);
		if (ret)
		/* HW restarting, channel removal should succeed */
		if (ret == -EREMOTEIO)
			return 0;
		else if (ret)
			return ret;

		txn.mc = SLIM_USR_MC_RECONFIG_NOW;