All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	AngeloGioacchino Del Regno 
	<angelogioacchino.delregno@somainline.org>,
	Stephan Gerhold <stephan@gerhold.net>,
	Arnd Bergmann <arnd@arndb.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: [PATCH] cpuidle: qcom_spm: make driver multi-arch friendly
Date: Wed, 20 Oct 2021 14:06:43 +0200	[thread overview]
Message-ID: <20211020120643.28231-1-m.szyprowski@samsung.com> (raw)
In-Reply-To: CGME20211020120653eucas1p176e7d48624cd773f2d96c06994e21856@eucas1p1.samsung.com

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@samsung.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


           reply	other threads:[~2021-10-20 12:06 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CGME20211020120653eucas1p176e7d48624cd773f2d96c06994e21856@eucas1p1.samsung.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211020120643.28231-1-m.szyprowski@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=agross@kernel.org \
    --cc=angelogioacchino.delregno@somainline.org \
    --cc=arnd@arndb.de \
    --cc=bjorn.andersson@linaro.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=stephan@gerhold.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.