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

Commit cc0c11d5 authored by Gauri Joshi's avatar Gauri Joshi
Browse files

msm: mhi: Avoid channel read while in mhi suspend



Client may initiate read transfers when MHI state is in suspend
state. Change adds a check to prevent read transfers.

Change-Id: I51954a3493a845ed1778713c10b20400d95489a8
Signed-off-by: default avatarSubramanian Ananthanarayanan <skananth@codeaurora.org>
Signed-off-by: default avatarGauri Joshi <gaurjosh@codeaurora.org>
parent 4866db2d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2969,6 +2969,14 @@ int mhi_dev_read_channel(struct mhi_req *mreq)
		mhi_log(MHI_MSG_ERROR, "invalid mhi request\n");
		return -ENXIO;
	}

	if (atomic_read(&mhi_ctx->is_suspended)) {
		mhi_log(MHI_MSG_ERROR,
			"mhi still in suspend, return %d for read ch:%d\n",
				rc, mreq->client->channel->ch_id);
		return -ENODEV;
	}

	handle_client = mreq->client;
	ch = handle_client->channel;
	usr_buf_remaining = mreq->len;