aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Poulain <loic.poulain@linaro.org>2020-02-12 18:54:03 +0100
committerVinod Koul <vkoul@kernel.org>2020-10-28 19:42:31 +0530
commit43cf198db3d84e3e2b4ff25631db1d2815de6f0f (patch)
treed9bfd4e37e72a59eca01cd6bd1662f042aed9130
parent5e64b51e45a8c04881a829e70dadcf2988b9db07 (diff)
remoteproc: qcom: wcnss: Add iris completion barriertracking-qcomlt-remoteproc
There is no guarantee that the iris pointer will be assigned before remoteproc subsystem starts the wcnss rproc, actually it depends how fast rproc subsystem is able to get the firmware to trigger the start. This leads to sporadic wifi/bluetooth initialization issue on db410c with the following output: remoteproc remoteproc1: powering up a204000.wcnss remoteproc remoteproc1: Booting fw image qcom/msm8916/wcnss.mdt... qcom-wcnss-pil a204000.wcnss: no iris registered remoteproc remoteproc1: can't start rproc a204000.wcnss: -22 This patch introduces a 'iris_assigned' completion barrier to fix this issue. Maybe not the most elegant way, but it does the trick. Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
-rw-r--r--drivers/remoteproc/qcom_wcnss.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c
index ef80f5b8f20b..93523f9aac6a 100644
--- a/drivers/remoteproc/qcom_wcnss.c
+++ b/drivers/remoteproc/qcom_wcnss.c
@@ -85,6 +85,7 @@ struct qcom_wcnss {
struct completion start_done;
struct completion stop_done;
+ struct completion iris_assigned;
phys_addr_t mem_phys;
phys_addr_t mem_reloc;
@@ -139,6 +140,7 @@ void qcom_wcnss_assign_iris(struct qcom_wcnss *wcnss,
wcnss->iris = iris;
wcnss->use_48mhz_xo = use_48mhz_xo;
+ complete(&wcnss->iris_assigned);
mutex_unlock(&wcnss->iris_lock);
}
@@ -221,6 +223,10 @@ static int wcnss_start(struct rproc *rproc)
struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv;
int ret;
+ /* Grant some time for iris registration */
+ wait_for_completion_timeout(&wcnss->iris_assigned,
+ msecs_to_jiffies(5000));
+
mutex_lock(&wcnss->iris_lock);
if (!wcnss->iris) {
dev_err(wcnss->dev, "no iris registered\n");
@@ -503,6 +509,7 @@ static int wcnss_probe(struct platform_device *pdev)
init_completion(&wcnss->start_done);
init_completion(&wcnss->stop_done);
+ init_completion(&wcnss->iris_assigned);
mutex_init(&wcnss->iris_lock);