From patchwork Wed Oct 20 12:06:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 12572239 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B4B5C433F5 for ; Wed, 20 Oct 2021 12:06:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F41C161359 for ; Wed, 20 Oct 2021 12:06:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229864AbhJTMJK (ORCPT ); Wed, 20 Oct 2021 08:09:10 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:54837 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230092AbhJTMJJ (ORCPT ); Wed, 20 Oct 2021 08:09:09 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20211020120654euoutp01e77bbb8fead1659e90bce9240c894c5b~vu73z2DNh1439514395euoutp01R for ; Wed, 20 Oct 2021 12:06:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20211020120654euoutp01e77bbb8fead1659e90bce9240c894c5b~vu73z2DNh1439514395euoutp01R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634731614; bh=8ssmdz378H2O6GPkTWYZCibFa9nC5r5ueHzA0hIFHVo=; h=From:To:Cc:Subject:Date:References:From; b=u/5Lxkg6fJ6AP96ZQSZe0pSxJX7Ut/idMVsgo7Hc/PwikEEY36Bso6YO7dtvwiUWX X8JGng4vG4/oDa/zh+XHAiqvT3g4MJFwXtk6McrTmI4OtH7MKPDDCvCO5SgpprldUs mlSnTSrZVcaPC0nytrnzB3J2ok2k1fHl8LTeQgHM= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20211020120653eucas1p18d0a90d20c1e55bd931a6cbdc19baa2d~vu73Xa5rI2464724647eucas1p1n; Wed, 20 Oct 2021 12:06:53 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id ED.25.42068.D5600716; Wed, 20 Oct 2021 13:06:53 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20211020120653eucas1p176e7d48624cd773f2d96c06994e21856~vu72srT8A1153911539eucas1p1R; Wed, 20 Oct 2021 12:06:53 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211020120653eusmtrp2dbbcef9489ba0e7510c901ea1d8d5709~vu72r4SZ21871218712eusmtrp2B; Wed, 20 Oct 2021 12:06:53 +0000 (GMT) X-AuditID: cbfec7f4-c89ff7000002a454-5f-6170065d59f8 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E8.7C.20981.D5600716; Wed, 20 Oct 2021 13:06:53 +0100 (BST) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20211020120652eusmtip1f97a50283e9634607e59aeb8e70cb4f6~vu72LtMRP2013220132eusmtip1J; Wed, 20 Oct 2021 12:06:52 +0000 (GMT) From: Marek Szyprowski To: linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Gross , Bjorn Andersson , "Rafael J . Wysocki" , Daniel Lezcano , AngeloGioacchino Del Regno , Stephan Gerhold , Arnd Bergmann , Marek Szyprowski Subject: [PATCH] cpuidle: qcom_spm: make driver multi-arch friendly Date: Wed, 20 Oct 2021 14:06:43 +0200 Message-Id: <20211020120643.28231-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLIsWRmVeSWpSXmKPExsWy7djPc7qxbAWJBsf2yFuce/ybxWLmyVYm i7+TjrFbnN7/jsVi3mdZi4n7z7JbXN41h83ic+8RRou1R+6yW8z9MpXZ4sZcEwduj9+/JjF6 tC2w99i0qpPN4861PWwefVtWMXp0nmX0+LxJLoA9issmJTUnsyy1SN8ugSvj4JtG9oL/3BXb ptk3ME7m6mLk5JAQMJE4MPEVexcjF4eQwApGiY833kM5Xxgl1q66zQLhfGaUWPn8BQtMy5kb 35ghEssZJXqm32eCa9nxewIjSBWbgKFE19suNhBbRCBa4uvPq2BFzAKvmCQ2b3jFBJIQFnCW WHf+LTuIzSKgKjHn6kKwBl4BW4kjPQeYIdbJS6zecABsnYTAUg6Jn7cvs0MkXCRudPQzQtjC Eq+Ob4GKy0j83zmfCaKhmVHi4bm17BBOD6PE5aYZUB3WEnfO/QJaxwF0k6bE+l36EGFHiaYl zewgYQkBPokbbwVBwsxA5qRt05khwrwSHW1CENVqErOOr4Nbe/DCJaibPSR+rzgP9ouQQKzE 7I3f2Ccwys1C2LWAkXEVo3hqaXFuemqxUV5quV5xYm5xaV66XnJ+7iZGYAo5/e/4lx2My199 1DvEyMTBeIhRgoNZSYR3d0V+ohBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHepC1r4oUE0hNLUrNT UwtSi2CyTBycUg1MgQy8QXl8Pvu4trewfpPfrC4t+1iI/W/PopopniYC3X/SZcobHyZWnXB9 K3Ck/UratVPu2qVV7bYZqk+8/1mJn/eeke4c+rL+l4XXuQM9Ny6e22HvzKR9uDIlrWi/iele TvF7r2/93eDEIv/J9fYqE93Hwf7qYaptuXUxZ0vfSa0R2Gs/68SNRwYXxKK9Ju3J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un6 +/GpR69Y7U/zOn7GSweX7KgW3fUpbtkXp+suSz9XfZ+xo4xJgnNB6Obrx3bv+q4ud8I+Jf7A 5TLtm2qpco5PqnyOLd8Q1LLa5s2TOp2e3p8KSizFGYmGWsxFxYkActV4lOUCAAA= X-CMS-MailID: 20211020120653eucas1p176e7d48624cd773f2d96c06994e21856 X-Msg-Generator: CA X-RootMTR: 20211020120653eucas1p176e7d48624cd773f2d96c06994e21856 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20211020120653eucas1p176e7d48624cd773f2d96c06994e21856 References: Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- 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);