ASoC: tegra: Fix AHUB probe issue

Make sure to call pm_runtime_enable() before the
of_platform_populate() which will ensure ahub runtime
resume would be called to enable ahub clock before accessing
any ahub modules registers in modules probe. Calling
of_platform_populate() in parent driver probe results in all
of its child device probe to be completed before it exits the
parent probe call.

The issue caught during MVC child device probe tries to access a
register in probe call which depends on the ahub clock that gets
enabled during AHUB RPM resume. But ahub RPM resume not called as
pm_runtime_enable() in ahub parent driver happens after the
of_platform_populate(). This was observed when drivers were built
as part of kernel image.

Bug 3752938

Change-Id: Ifeb4085961d89877f79ff521adb6dfdf4e51907c
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2762027
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Mohan Kumar
2022-08-17 08:11:15 +05:30
committed by Sameer Pujar
parent 685ae3b3e1
commit 54bd04b640

View File

@@ -2,7 +2,7 @@
// //
// tegra210_ahub.c - Tegra210 AHUB driver // tegra210_ahub.c - Tegra210 AHUB driver
// //
// Copyright (c) 2020-2021 NVIDIA CORPORATION. All rights reserved. // Copyright (c) 2020-2022 NVIDIA CORPORATION. All rights reserved.
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/device.h> #include <linux/device.h>
@@ -1562,12 +1562,14 @@ static int tegra_ahub_probe(struct platform_device *pdev)
return err; return err;
} }
err = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
if (err)
return err;
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
err = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
if (err) {
pm_runtime_disable(&pdev->dev);
return err;
}
return 0; return 0;
} }