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

Commit e5ebc319 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

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

parents acd267d4 fad2c576
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);