Skip to content

Commit 73fd28b

Browse files
z3ntugregkh
authored andcommitted
remoteproc: qcom_q6v5_pas: Make single-PD handling more robust
[ Upstream commit e917b73 ] 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 <[email protected]> Fixes: 17ee2fb ("remoteproc: qcom: pas: Vote for active/proxy power domains") Signed-off-by: Luca Weiss <[email protected]> Reviewed-by: Stephan Gerhold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 26c0229 commit 73fd28b

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
@@ -509,16 +509,16 @@ static int adsp_pds_attach(struct device *dev, struct device **devs,
509509
if (!pd_names)
510510
return 0;
511511

512+
while (pd_names[num_pds])
513+
num_pds++;
514+
512515
/* Handle single power domain */
513-
if (dev->pm_domain) {
516+
if (num_pds == 1 && dev->pm_domain) {
514517
devs[0] = dev;
515518
pm_runtime_enable(dev);
516519
return 1;
517520
}
518521

519-
while (pd_names[num_pds])
520-
num_pds++;
521-
522522
for (i = 0; i < num_pds; i++) {
523523
devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]);
524524
if (IS_ERR_OR_NULL(devs[i])) {
@@ -543,7 +543,7 @@ static void adsp_pds_detach(struct qcom_adsp *adsp, struct device **pds,
543543
int i;
544544

545545
/* Handle single power domain */
546-
if (dev->pm_domain && pd_count) {
546+
if (pd_count == 1 && dev->pm_domain) {
547547
pm_runtime_disable(dev);
548548
return;
549549
}

0 commit comments

Comments
 (0)