[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20211020120643.28231-1-m.szyprowski@samsung.com>
Date: Wed, 20 Oct 2021 14:06:43 +0200
From: Marek Szyprowski <m.szyprowski@...sung.com>
To: linux-arm-msm@...r.kernel.org, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...ainline.org>,
Stephan Gerhold <stephan@...hold.net>,
Arnd Bergmann <arnd@...db.de>,
Marek Szyprowski <m.szyprowski@...sung.com>
Subject: [PATCH] cpuidle: qcom_spm: make driver multi-arch friendly
Avoid returning -EPROBE_DEFER from spm_cpuidle_drv_probe() on non-qcom
based systems. This makes the driver multi-arch friendly again after
commit 60f3692b5f0b ("cpuidle: qcom_spm: Detach state machine from main
SPM handling").
Signed-off-by: Marek Szyprowski <m.szyprowski@...sung.com>
---
This fixes the issue I've reported some time ago:
https://lore.kernel.org/all/86e3e09f-a8d7-3dff-3fc6-ddd7d30c5d78@samsung.com/
---
drivers/cpuidle/cpuidle-qcom-spm.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/cpuidle/cpuidle-qcom-spm.c b/drivers/cpuidle/cpuidle-qcom-spm.c
index 01e77913a414..1ee056fdfbb8 100644
--- a/drivers/cpuidle/cpuidle-qcom-spm.c
+++ b/drivers/cpuidle/cpuidle-qcom-spm.c
@@ -129,12 +129,26 @@ static int spm_cpuidle_register(struct device *cpuidle_dev, int cpu)
return cpuidle_register(&data->cpuidle_driver, NULL);
}
+static int spm_dev_check(struct device_driver *drv, void *data)
+{
+ if (strcmp(drv->name, "qcom_spm") == 0) {
+ struct device_node *np;
+
+ np = of_find_matching_node(NULL, drv->of_match_table);
+ if (np) {
+ of_node_put(np);
+ return -EPROBE_DEFER;
+ }
+ }
+ return -ENODEV;
+}
+
static int spm_cpuidle_drv_probe(struct platform_device *pdev)
{
int cpu, ret;
if (!qcom_scm_is_available())
- return -EPROBE_DEFER;
+ return bus_for_each_drv(pdev->dev.bus, NULL, NULL, spm_dev_check);
for_each_possible_cpu(cpu) {
ret = spm_cpuidle_register(&pdev->dev, cpu);
--
2.17.1
Powered by blists - more mailing lists