Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

remoteproc: qcom: q6v5: Add interconnect path proxy vote

Many remoteproc instances requires that Linux casts a proxy vote for an
interconnect path during boot, until they can do it themselves. Add
support for voting for a single path.

As this is a shared problem between both PAS and MSS drivers, the path
is acquired and votes casted from the common helper code.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Georgi Djakov <djakov@kernel.org>
Link: https://lore.kernel.org/r/20220225033224.2238425-1-bjorn.andersson@linaro.org

+24 -2
+21 -2
drivers/remoteproc/qcom_q6v5.c
··· 8 8 */ 9 9 #include <linux/kernel.h> 10 10 #include <linux/platform_device.h> 11 + #include <linux/interconnect.h> 11 12 #include <linux/interrupt.h> 12 13 #include <linux/module.h> 13 14 #include <linux/soc/qcom/qcom_aoss.h> ··· 52 51 { 53 52 int ret; 54 53 55 - ret = q6v5_load_state_toggle(q6v5, true); 56 - if (ret) 54 + ret = icc_set_bw(q6v5->path, 0, UINT_MAX); 55 + if (ret < 0) { 56 + dev_err(q6v5->dev, "failed to set bandwidth request\n"); 57 57 return ret; 58 + } 59 + 60 + ret = q6v5_load_state_toggle(q6v5, true); 61 + if (ret) { 62 + icc_set_bw(q6v5->path, 0, 0); 63 + return ret; 64 + } 58 65 59 66 reinit_completion(&q6v5->start_done); 60 67 reinit_completion(&q6v5->stop_done); ··· 86 77 { 87 78 disable_irq(q6v5->handover_irq); 88 79 q6v5_load_state_toggle(q6v5, false); 80 + 81 + /* Disable interconnect vote, in case handover never happened */ 82 + icc_set_bw(q6v5->path, 0, 0); 89 83 90 84 return !q6v5->handover_issued; 91 85 } ··· 171 159 172 160 if (q6v5->handover) 173 161 q6v5->handover(q6v5); 162 + 163 + icc_set_bw(q6v5->path, 0, 0); 174 164 175 165 q6v5->handover_issued = true; 176 166 ··· 345 331 qmp_put(q6v5->qmp); 346 332 return load_state ? -ENOMEM : -EINVAL; 347 333 } 334 + 335 + q6v5->path = devm_of_icc_get(&pdev->dev, NULL); 336 + if (IS_ERR(q6v5->path)) 337 + return dev_err_probe(&pdev->dev, PTR_ERR(q6v5->path), 338 + "failed to acquire interconnect path\n"); 348 339 349 340 return 0; 350 341 }
+3
drivers/remoteproc/qcom_q6v5.h
··· 7 7 #include <linux/completion.h> 8 8 #include <linux/soc/qcom/qcom_aoss.h> 9 9 10 + struct icc_path; 10 11 struct rproc; 11 12 struct qcom_smem_state; 12 13 struct qcom_sysmon; ··· 18 17 19 18 struct qcom_smem_state *state; 20 19 struct qmp *qmp; 20 + 21 + struct icc_path *path; 21 22 22 23 unsigned stop_bit; 23 24