From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Stephan Gerhold <stephan@gerhold.net>,
Bjorn Andersson <andersson@kernel.org>
Cc: Andy Gross <agross@kernel.org>, Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org
Subject: Re: [PATCH 04/14] soc: qcom: smd-rpm: Match rpmsg channel instead of compatible
Date: Mon, 5 Jun 2023 20:49:13 +0200 [thread overview]
Message-ID: <84c94ba5-fee4-c37a-9900-f9a1ad589c33@linaro.org> (raw)
In-Reply-To: <20230531-rpm-rproc-v1-4-e0a3b6de1f14@gerhold.net>
On 5.06.2023 09:08, Stephan Gerhold wrote:
> There is an ever growing list of compatibles in the smd-rpm.c driver.
> A fallback compatible would help here but would still require keeping
> the current list around for backwards compatibility.
>
> As an alternative, let's switch the driver to match the rpmsg_device_id
> instead, which is always "rpm_requests" on all platforms. Add a check
> to ensure that there is a device tree node defined for the device since
> otherwise the of_platform_populate() call will operate on the root node (/).
>
> Similar approaches with matching rpmsg_device_id are already used in
> qcom_sysmon, qcom_glink_ssr, qrtr, and rpmsg_wwan_ctrl.
>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
Tested-by: Konrad Dybcio <konrad.dybcio@linaro.org> # SM6375 (G-Link)
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Konrad
> drivers/soc/qcom/smd-rpm.c | 35 +++++++++--------------------------
> 1 file changed, 9 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/soc/qcom/smd-rpm.c b/drivers/soc/qcom/smd-rpm.c
> index 0c1aa809cc4e..13d8c52330d0 100644
> --- a/drivers/soc/qcom/smd-rpm.c
> +++ b/drivers/soc/qcom/smd-rpm.c
> @@ -199,6 +199,9 @@ static int qcom_smd_rpm_probe(struct rpmsg_device *rpdev)
> struct qcom_smd_rpm *rpm;
> int ret;
>
> + if (!rpdev->dev.of_node)
> + return -EINVAL;
> +
> rpm = devm_kzalloc(&rpdev->dev, sizeof(*rpm), GFP_KERNEL);
> if (!rpm)
> return -ENOMEM;
> @@ -230,38 +233,18 @@ static void qcom_smd_rpm_remove(struct rpmsg_device *rpdev)
> of_platform_depopulate(&rpdev->dev);
> }
>
> -static const struct of_device_id qcom_smd_rpm_of_match[] = {
> - { .compatible = "qcom,rpm-apq8084" },
> - { .compatible = "qcom,rpm-ipq6018" },
> - { .compatible = "qcom,rpm-ipq9574" },
> - { .compatible = "qcom,rpm-msm8226" },
> - { .compatible = "qcom,rpm-msm8909" },
> - { .compatible = "qcom,rpm-msm8916" },
> - { .compatible = "qcom,rpm-msm8936" },
> - { .compatible = "qcom,rpm-msm8953" },
> - { .compatible = "qcom,rpm-msm8974" },
> - { .compatible = "qcom,rpm-msm8976" },
> - { .compatible = "qcom,rpm-msm8994" },
> - { .compatible = "qcom,rpm-msm8996" },
> - { .compatible = "qcom,rpm-msm8998" },
> - { .compatible = "qcom,rpm-sdm660" },
> - { .compatible = "qcom,rpm-sm6115" },
> - { .compatible = "qcom,rpm-sm6125" },
> - { .compatible = "qcom,rpm-sm6375" },
> - { .compatible = "qcom,rpm-qcm2290" },
> - { .compatible = "qcom,rpm-qcs404" },
> - {}
> +static const struct rpmsg_device_id qcom_smd_rpm_id_table[] = {
> + { .name = "rpm_requests", },
> + { /* sentinel */ }
> };
> -MODULE_DEVICE_TABLE(of, qcom_smd_rpm_of_match);
> +MODULE_DEVICE_TABLE(rpmsg, qcom_smd_rpm_id_table);
>
> static struct rpmsg_driver qcom_smd_rpm_driver = {
> .probe = qcom_smd_rpm_probe,
> .remove = qcom_smd_rpm_remove,
> .callback = qcom_smd_rpm_callback,
> - .drv = {
> - .name = "qcom_smd_rpm",
> - .of_match_table = qcom_smd_rpm_of_match,
> - },
> + .id_table = qcom_smd_rpm_id_table,
> + .drv.name = "qcom_smd_rpm",
> };
>
> static int __init qcom_smd_rpm_init(void)
>
next prev parent reply other threads:[~2023-06-05 18:49 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-05 7:08 [PATCH 00/14] Add dedicated device tree node for RPM processor/subsystem Stephan Gerhold
2023-06-05 7:08 ` [PATCH 01/14] dt-bindings soc: qcom: smd-rpm: Fix sort order Stephan Gerhold
2023-06-06 6:25 ` Krzysztof Kozlowski
2023-06-05 7:08 ` [PATCH 02/14] dt-bindings: soc: qcom: smd-rpm: Add MSM8909 to qcom,smd-channels Stephan Gerhold
2023-06-06 6:26 ` Krzysztof Kozlowski
2023-06-05 7:08 ` [PATCH 03/14] dt-bindings: soc: qcom: smd-rpm: Add some more compatibles Stephan Gerhold
2023-06-06 6:27 ` Krzysztof Kozlowski
2023-06-05 7:08 ` [PATCH 04/14] soc: qcom: smd-rpm: Match rpmsg channel instead of compatible Stephan Gerhold
2023-06-05 18:49 ` Konrad Dybcio [this message]
2023-06-05 7:08 ` [PATCH 05/14] dt-bindings: remoteproc: Add Qualcomm RPM processor/subsystem Stephan Gerhold
2023-06-05 8:33 ` Rob Herring
2023-06-05 9:16 ` Stephan Gerhold
2023-06-06 6:36 ` Krzysztof Kozlowski
2023-06-06 8:55 ` Stephan Gerhold
2023-06-07 8:32 ` Krzysztof Kozlowski
2023-06-05 7:08 ` [PATCH 06/14] dt-bindings: soc: qcom: smd-rpm: Use qcom,rpm-proc in example Stephan Gerhold
2023-06-05 8:33 ` Rob Herring
2023-06-05 9:20 ` Stephan Gerhold
2023-06-06 6:37 ` Krzysztof Kozlowski
2023-06-06 9:06 ` Stephan Gerhold
2023-06-06 9:17 ` Krzysztof Kozlowski
2023-06-05 7:08 ` [PATCH 07/14] dt-bindings: qcom: smd: Mark as deprecated Stephan Gerhold
2023-06-05 7:08 ` [PATCH 08/14] soc: qcom: smem: Add qcom_smem_is_available() Stephan Gerhold
2023-06-05 18:53 ` Konrad Dybcio
2023-06-05 19:13 ` Stephan Gerhold
2023-06-05 7:08 ` [PATCH 09/14] rpmsg: qcom_smd: Use qcom_smem_is_available() Stephan Gerhold
2023-06-05 18:56 ` Konrad Dybcio
2023-06-05 19:18 ` Stephan Gerhold
2023-06-05 19:45 ` Konrad Dybcio
2023-06-05 7:08 ` [PATCH 10/14] soc: qcom: Add RPM processor/subsystem driver Stephan Gerhold
2023-06-05 19:06 ` Konrad Dybcio
2023-06-05 19:51 ` Stephan Gerhold
2023-06-05 19:55 ` Konrad Dybcio
2023-06-05 20:31 ` kernel test robot
2023-06-05 7:08 ` [PATCH 11/14] arm64: dts: qcom: Add rpm-proc node for SMD platforms Stephan Gerhold
2023-06-05 19:07 ` Konrad Dybcio
2023-06-05 7:08 ` [PATCH 12/14] arm64: dts: qcom: Add rpm-proc node for GLINK gplatforms Stephan Gerhold
2023-06-05 19:43 ` Konrad Dybcio
2023-06-05 19:55 ` Stephan Gerhold
2023-06-05 7:08 ` [PATCH 13/14] ARM: dts: qcom: Add rpm-proc node for SMD platforms Stephan Gerhold
2023-06-05 7:08 ` [PATCH 14/14] ARM: dts: qcom: apq8064: Drop redundant /smd node Stephan Gerhold
2023-06-05 19:00 ` Konrad Dybcio
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=84c94ba5-fee4-c37a-9900-f9a1ad589c33@linaro.org \
--to=konrad.dybcio@linaro.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=robh+dt@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).