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

Commit fad2c576 authored by Karthik Parsha's avatar Karthik Parsha Committed by Maulik Shah
Browse files

qcom: rpm-smd: Force smd channel update in interrupt lock context



In the power collapse path, when checking for availability of an ack from
rpm, use smd_is_pkt_avail. This api is designed to be used with
interrupts disabled, and will be able to poll for acks from rpm.

Check for upto 500us to check availability of this ack.

Change-Id: Ie99d0bb9ae17445872e0c37f0797cac3a221daa4
Signed-off-by: default avatarKarthik Parsha <kparsha@codeaurora.org>
Signed-off-by: default avatarMaulik Shah <mkshah@codeaurora.org>
parent 17d7bd58
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -525,6 +525,33 @@ static int msm_rpm_read_sleep_ack(void)
	if (glink_enabled)
		ret = msm_rpm_glink_rx_poll(glink_data->glink_handle);
	else {
		int timeout = 10;

		while (timeout) {
			if (smd_is_pkt_avail(msm_rpm_data.ch_info))
				break;
			/*
			 * Sleep for 50us at a time before checking
			 * for packet availability. The 50us is based
			 * on the the max time rpm could take to process
			 * and send an ack for sleep set request.
			 */
			udelay(50);
			timeout--;
		}

		/*
		 * On timeout return an error and exit the spinlock
		 * control on this cpu. This will allow any other
		 * core that has wokenup and trying to acquire the
		 * spinlock from being locked out.
		 */

		if (!timeout) {
			pr_err("Timed out waiting for RPM ACK\n");
			return -EAGAIN;
		}

		ret = msm_rpm_read_smd_data(buf);
		if (!ret)
			ret = smd_is_pkt_avail(msm_rpm_data.ch_info);