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

Commit acc7f267 authored by Nitin Rawat's avatar Nitin Rawat
Browse files

scsi: ufs: Check boundary condition on pm qos active_reqs



OEMs implement their own UFS features based on QCOM's
UFS infrastructure, and they can call UFS PM QoS interfaces
from their code.

Adding boundary condition for active_reqs will help to
catch and throw warning in case of any abnormality.

Change-Id: Ibd9d3b5c5bde2260ec08d48ba858c4f3b7ff0d9d
Signed-off-by: default avatarNitin Rawat <nitirawa@codeaurora.org>
parent 74de7711
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1631,6 +1631,10 @@ static void __ufs_qcom_pm_qos_req_end(struct ufs_qcom_host *host, int req_cpu)
	if (!host->pm_qos.groups || !host->pm_qos.is_enabled)
		return;

	if (group->active_reqs <= 0)
		pr_err_ratelimited("ufshcd-qcom: active req coount is negative: %d\n",
					group->active_reqs);

	group = &host->pm_qos.groups[ufs_qcom_cpu_to_group(host, req_cpu)];

	if (--group->active_reqs)