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

Commit 9d9d7008 authored by Sagar Dharia's avatar Sagar Dharia Committed by David Keitel
Browse files

slim: msm: Return success for ch-remove type of messages during SSR



During SSR, all channels are removed and ports are disconnected since
slimbus HW is not functional. Return success to clients for such
calls so that client can mark channel/port state constistent with HW

Change-Id: I9b18f8e7ffe233090c9612d0811a7d36645d0329
Signed-off-by: default avatarSagar Dharia <sdharia@codeaurora.org>
parent 04d4a60c
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -839,8 +839,26 @@ static int ngd_xferandwait_ack(struct slim_controller *ctrl,
{
	struct msm_slim_ctrl *dev = slim_get_ctrldata(ctrl);
	unsigned long flags;
	int ret;

	if (dev->state == MSM_CTRL_DOWN) {
		/*
		 * no need to send anything to the bus due to SSR
		 * transactions related to channel removal marked as success
		 * since HW is down
		 */
		if ((txn->mt == SLIM_MSG_MT_DEST_REFERRED_USER) &&
			((txn->mc >= SLIM_USR_MC_CHAN_CTRL &&
			  txn->mc <= SLIM_USR_MC_REQ_BW) ||
			txn->mc == SLIM_USR_MC_DISCONNECT_PORT)) {
			spin_lock_irqsave(&ctrl->txn_lock, flags);
			ctrl->txnt[txn->tid] = NULL;
			spin_unlock_irqrestore(&ctrl->txn_lock, flags);
			return 0;
		}
	}

	int ret = ngd_xfer_msg(ctrl, txn);
	ret = ngd_xfer_msg(ctrl, txn);
	if (!ret) {
		int timeout;
		timeout = wait_for_completion_timeout(txn->comp, HZ);