Commit 98241a77 authored by Viken Dadhaniya's avatar Viken Dadhaniya Committed by Greg Kroah-Hartman

slimbus: qcom-ngd-ctrl: Add timeout for wait operation

In current driver qcom_slim_ngd_up_worker() indefinitely
waiting for ctrl->qmi_up completion object. This is
resulting in workqueue lockup on Kthread.

Added wait_for_completion_interruptible_timeout to
allow the thread to wait for specific timeout period and
bail out instead waiting infinitely.

Fixes: a899d324 ("slimbus: qcom-ngd-ctrl: add Sub System Restart support")
Cc: stable@vger.kernel.org
Reviewed-by: default avatarKonrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: default avatarViken Dadhaniya <quic_vdadhani@quicinc.com>
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240430091238.35209-2-srinivas.kandagatla@linaro.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 00e7d3be
...@@ -1451,7 +1451,11 @@ static void qcom_slim_ngd_up_worker(struct work_struct *work) ...@@ -1451,7 +1451,11 @@ static void qcom_slim_ngd_up_worker(struct work_struct *work)
ctrl = container_of(work, struct qcom_slim_ngd_ctrl, ngd_up_work); ctrl = container_of(work, struct qcom_slim_ngd_ctrl, ngd_up_work);
/* Make sure qmi service is up before continuing */ /* Make sure qmi service is up before continuing */
wait_for_completion_interruptible(&ctrl->qmi_up); if (!wait_for_completion_interruptible_timeout(&ctrl->qmi_up,
msecs_to_jiffies(MSEC_PER_SEC))) {
dev_err(ctrl->dev, "QMI wait timeout\n");
return;
}
mutex_lock(&ctrl->ssr_lock); mutex_lock(&ctrl->ssr_lock);
qcom_slim_ngd_enable(ctrl, true); qcom_slim_ngd_enable(ctrl, true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment