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

amba: bus: Drop dev_pm_domain_detach() call

Starting with commit f99508074e78 ("PM: domains: Detach on
device_unbind_cleanup()"), there is no longer a need to call
dev_pm_domain_detach() in the bus remove function. The
device_unbind_cleanup() function now handles this to avoid
invoking devres cleanup handlers while the PM domain is
powered off, which could otherwise lead to failures as
described in the above-mentioned commit.

Drop the explicit dev_pm_domain_detach() call and rely instead
on the flags passed to dev_pm_domain_attach() to power off the
domain.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Claudiu Beznea and committed by
Ulf Hansson
3ee40825 d4aa5960

+3 -6
+3 -6
drivers/amba/bus.c
··· 291 291 if (ret < 0) 292 292 break; 293 293 294 - ret = dev_pm_domain_attach(dev, PD_FLAG_ATTACH_POWER_ON); 294 + ret = dev_pm_domain_attach(dev, PD_FLAG_ATTACH_POWER_ON | 295 + PD_FLAG_DETACH_POWER_OFF); 295 296 if (ret) 296 297 break; 297 298 298 299 ret = amba_get_enable_pclk(pcdev); 299 - if (ret) { 300 - dev_pm_domain_detach(dev, true); 300 + if (ret) 301 301 break; 302 - } 303 302 304 303 pm_runtime_get_noresume(dev); 305 304 pm_runtime_set_active(dev); ··· 313 314 pm_runtime_put_noidle(dev); 314 315 315 316 amba_put_disable_pclk(pcdev); 316 - dev_pm_domain_detach(dev, true); 317 317 } while (0); 318 318 319 319 return ret; ··· 334 336 pm_runtime_put_noidle(dev); 335 337 336 338 amba_put_disable_pclk(pcdev); 337 - dev_pm_domain_detach(dev, true); 338 339 } 339 340 340 341 static void amba_shutdown(struct device *dev)