Skip to content

Commit e917b73

Browse files
z3ntuandersson
authored andcommitted
remoteproc: qcom_q6v5_pas: Make single-PD handling more robust
Only go into the if condition for single-PD handling when there's actually just one power domain specified there. Otherwise it'll be an issue in the dts and we should fail in the regular code path. This also mirrors the latest changes in the qcom_q6v5_mss driver. Suggested-by: Stephan Gerhold <stephan.gerhold@linaro.org> Fixes: 17ee2fb ("remoteproc: qcom: pas: Vote for active/proxy power domains") Signed-off-by: Luca Weiss <luca@lucaweiss.eu> Reviewed-by: Stephan Gerhold <stephan.gerhold@linaro.org> Link: https://lore.kernel.org/r/20250128-pas-singlepd-v1-2-85d9ae4b0093@lucaweiss.eu Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent ba785ff commit e917b73

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/remoteproc/qcom_q6v5_pas.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -501,16 +501,16 @@ static int adsp_pds_attach(struct device *dev, struct device **devs,
501501
if (!pd_names)
502502
return 0;
503503

504+
while (pd_names[num_pds])
505+
num_pds++;
506+
504507
/* Handle single power domain */
505-
if (dev->pm_domain) {
508+
if (num_pds == 1 && dev->pm_domain) {
506509
devs[0] = dev;
507510
pm_runtime_enable(dev);
508511
return 1;
509512
}
510513

511-
while (pd_names[num_pds])
512-
num_pds++;
513-
514514
for (i = 0; i < num_pds; i++) {
515515
devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]);
516516
if (IS_ERR_OR_NULL(devs[i])) {
@@ -535,7 +535,7 @@ static void adsp_pds_detach(struct qcom_adsp *adsp, struct device **pds,
535535
int i;
536536

537537
/* Handle single power domain */
538-
if (dev->pm_domain && pd_count) {
538+
if (pd_count == 1 && dev->pm_domain) {
539539
pm_runtime_disable(dev);
540540
return;
541541
}

0 commit comments

Comments
 (0)