Message ID | 20230531-rpm-rproc-v1-10-e0a3b6de1f14@gerhold.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2504228vqr; Mon, 5 Jun 2023 00:19:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6aPcZ81dcQJ0Zf0gzz4YmZKVYQRL85Z+rp4SBfJBzpnkXACLnrL7UuETTVZrnhgVgpWhHn X-Received: by 2002:a9d:7741:0:b0:6a5:de68:4526 with SMTP id t1-20020a9d7741000000b006a5de684526mr9498734otl.4.1685949579094; Mon, 05 Jun 2023 00:19:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685949579; cv=pass; d=google.com; s=arc-20160816; b=KxVjDhCv2lkPM8AeTSkjMuMC/BH+05MbUMP5ybqybKB0UJF6yBnHEo/1z6EMdZRRyQ Lkg0Bdfsv5RTVDIWagW7VmHbc/Qcm85fzNgo9wZM+M4mayxhz8OtD8MDEhukQIz3Y8ya KVPuWHF4GJzyw0g+aPFIxwIOHGoodq/+oozddpmcPRQJmKkskGdWuIQLJ9O4jpHKEaY2 o3uLXXv+fYbPn7KGWNzV2x/La/af4t6ZtE1aRrldik+cY3AjVgMiR2lfAT7651fnCh85 MBIF4PPy09emqQ8AVC/RFHyS6x7ZQh2xQZEKPcFTwOwokrplZ45L5csQAGYIJMr9kQP/ GcFA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature:dkim-signature; bh=HXm1VPTXAHe9VxfUC/BDKK9cTt+IOrtmh6/3aJodKcc=; b=kAyd4QPGscyiWm9UK7P7DahUGELKNQZmGcHhQGt0/6iMbR5r7ZjpoydRlBjMfmkuat JhgctWvEkVW70h6NMvgLSzrXAJ8bdhLH1arqlf9BTu9bBgsZ9ahwVrT11BssKi42U4Y2 y5CPR9Fxgezk48ZrCETpfJgzGjPA4SVKbKBa2IOTr+7/s0orMRI+4uadQmWTrNf5gOpS nTdnriASjTwbt77eohSHn3/BGiiaiTqm7AdDTav6bunXEbLaQk8c9oEXSR3N7vJ8B5ze mdUvJkWdu+bmxTDZrKCMe/LpHwaLoMQiLy2XPF+mqAwFtn2bG3TDBUfM0U6SvOzqt9Ub MxRQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b=i2xM3Mvk; dkim=neutral (no key) header.i=@gerhold.net; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x19-20020a63b213000000b00543cc95d776si40283pge.660.2023.06.05.00.19.23; Mon, 05 Jun 2023 00:19:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b=i2xM3Mvk; dkim=neutral (no key) header.i=@gerhold.net; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229887AbjFEHK7 (ORCPT <rfc822;pfffrao@gmail.com> + 99 others); Mon, 5 Jun 2023 03:10:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231764AbjFEHKV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 5 Jun 2023 03:10:21 -0400 Received: from mo4-p03-ob.smtp.rzone.de (mo4-p03-ob.smtp.rzone.de [85.215.255.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEF62E49; Mon, 5 Jun 2023 00:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685948956; cv=none; d=strato.com; s=strato-dkim-0002; b=tEseBMuPiyHNkdf3PJVTdgcri1s7a/qwOZ4iHULrsTwXURbFpBHrAwtUVwkjnUdITH DJ8QKFpKujtdfD+SsQtcfQVeBlAftQ51zRO2+sMYrQPGzddpZu8QEzQPZksjSc6lWPmE tuswhqTx2ZOGo14qF81z6Yh64srURVGHjF56hcMZG7tu1aWsXZ74izG8miL3AmQ50m5F g4r/8Sit8awpzb2MJzHw4tqbeCc2gfZOMTyHawoTgIGuaBK/NnxuKMLcBeF8SsG7z7le g8Hty7caITEHcaygOZnmTAoHhblGQRw4WY7y2QBW65MJLowNqLQGDElfBDtwbObv6C8k XpPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1685948956; s=strato-dkim-0002; d=strato.com; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=HXm1VPTXAHe9VxfUC/BDKK9cTt+IOrtmh6/3aJodKcc=; b=M+4XqxZYCdp6Yctru+wnT/xOTwkNyA7HTDChDXWXr41Xj6Mw05EqD/tVK7CmOEOCS8 s5utTkbyK9RHv2UMBkTfqyr5GfH7zsNKXOTDd+OsWB1sEUxqO+JtFBk6R1DeFvuBXDIA qFZGWkwWHd33yjo2hUcRoWUwIzxjdbM8yB0yavICkZEhYWvAbbUQzOcVnebz5hytCthB 7PIfv9Yf3s4xW9zqGTH1v5rTHESY4ND37XE5mOxKM9b4qzyReva9xu+Gh9yGqCZDuVQK FKNYrYvppMc/ZfZ2FrN7Ph7yyzpwT11n4ouGwjT+saxUXRw5alUHPIMzIKwG8vbVL84w jqzw== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo03 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1685948956; s=strato-dkim-0002; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=HXm1VPTXAHe9VxfUC/BDKK9cTt+IOrtmh6/3aJodKcc=; b=i2xM3Mvkukrx6fAcPtbzSw8iMYg/lRfWBtU089P4toggKVpFl+NnTjaUmcgVaKU654 S3OcMkSOUXNIV0HjBaBqEUFKdQ1b8eUjK//2ZglCwIk538CbOFNeiy9bO4gVeyex/55e /VpfNS9eQWDfDM9/2OdhTm5yNpC5zouF5SP1liJ1Zqr1I65km22/YXclC2KH8YW0SPWb QuC+U5oaJ0yLuMJqrs77aGaZ2OolaWsvKj+nTycQ4QonfujMhtcXDPfkklv7rm4NXYpX H67kwEL2x6TedLFvZy1CGy2OxC12NPuWtrZtE6xFLEYjgQr0qC5AZqmY0UjAWHNVIeAH wmbA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1685948956; s=strato-dkim-0003; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=HXm1VPTXAHe9VxfUC/BDKK9cTt+IOrtmh6/3aJodKcc=; b=vRpSUz2N6xDNY4VgbmBeVOdliW8t6pv1YcqVpCdV1VN3fihJg9j8wgbvSTeLDih2OB DPb6s2wDBUWMZziRzmAQ== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQjVd4CteZ/7jYgS+mLFY+H0JAn9VOL5nz0=" Received: from [192.168.244.3] by smtp.strato.de (RZmta 49.5.3 DYNA|AUTH) with ESMTPSA id Z82ec2z5579F8a9 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 5 Jun 2023 09:09:15 +0200 (CEST) From: Stephan Gerhold <stephan@gerhold.net> Date: Mon, 05 Jun 2023 09:08:26 +0200 Subject: [PATCH 10/14] soc: qcom: Add RPM processor/subsystem driver MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230531-rpm-rproc-v1-10-e0a3b6de1f14@gerhold.net> References: <20230531-rpm-rproc-v1-0-e0a3b6de1f14@gerhold.net> In-Reply-To: <20230531-rpm-rproc-v1-0-e0a3b6de1f14@gerhold.net> To: Bjorn Andersson <andersson@kernel.org> Cc: Andy Gross <agross@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.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, Stephan Gerhold <stephan@gerhold.net> X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767846265608695016?= X-GMAIL-MSGID: =?utf-8?q?1767846265608695016?= |
Series |
Add dedicated device tree node for RPM processor/subsystem
|
|
Commit Message
Stephan Gerhold
June 5, 2023, 7:08 a.m. UTC
Add a simple driver for the qcom,rpm-proc compatible that registers the
"smd-edge" and populates other children defined in the device tree.
Note that the DT schema belongs to the remoteproc subsystem while this
driver is added inside soc/qcom. I argue that the RPM *is* a remoteproc,
but as an implementation detail in Linux it can currently not benefit
from anything provided by the remoteproc subsystem. The RPM firmware is
usually already loaded and started by earlier components in the boot
chain and is not meant to be ever restarted.
To avoid breaking existing kernel configurations the driver is always
built when smd-rpm.c is also built. They belong closely together anyway.
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
drivers/soc/qcom/Makefile | 2 +-
drivers/soc/qcom/rpm-proc.c | 76 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 77 insertions(+), 1 deletion(-)
Comments
On 5.06.2023 09:08, Stephan Gerhold wrote: > Add a simple driver for the qcom,rpm-proc compatible that registers the > "smd-edge" and populates other children defined in the device tree. > > Note that the DT schema belongs to the remoteproc subsystem while this > driver is added inside soc/qcom. I argue that the RPM *is* a remoteproc, > but as an implementation detail in Linux it can currently not benefit > from anything provided by the remoteproc subsystem. The RPM firmware is > usually already loaded and started by earlier components in the boot > chain and is not meant to be ever restarted. > > To avoid breaking existing kernel configurations the driver is always > built when smd-rpm.c is also built. They belong closely together anyway. > > Signed-off-by: Stephan Gerhold <stephan@gerhold.net> > --- > drivers/soc/qcom/Makefile | 2 +- > drivers/soc/qcom/rpm-proc.c | 76 +++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 77 insertions(+), 1 deletion(-) > > diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile > index 99114c71092b..113b9ff2ad43 100644 > --- a/drivers/soc/qcom/Makefile > +++ b/drivers/soc/qcom/Makefile > @@ -18,7 +18,7 @@ obj-$(CONFIG_QCOM_RPM_MASTER_STATS) += rpm_master_stats.o > obj-$(CONFIG_QCOM_RPMH) += qcom_rpmh.o > qcom_rpmh-y += rpmh-rsc.o > qcom_rpmh-y += rpmh.o > -obj-$(CONFIG_QCOM_SMD_RPM) += smd-rpm.o > +obj-$(CONFIG_QCOM_SMD_RPM) += rpm-proc.o smd-rpm.o > obj-$(CONFIG_QCOM_SMEM) += smem.o > obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o > obj-$(CONFIG_QCOM_SMP2P) += smp2p.o > diff --git a/drivers/soc/qcom/rpm-proc.c b/drivers/soc/qcom/rpm-proc.c > new file mode 100644 > index 000000000000..0652be7f7895 > --- /dev/null > +++ b/drivers/soc/qcom/rpm-proc.c > @@ -0,0 +1,76 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* Copyright (c) 2021-2023, Stephan Gerhold <stephan@gerhold.net> */ > + > +#include <linux/module.h> > +#include <linux/of.h> > +#include <linux/of_platform.h> > +#include <linux/platform_device.h> > +#include <linux/rpmsg/qcom_smd.h> > + > +static int rpm_proc_probe(struct platform_device *pdev) > +{ > + struct qcom_smd_edge *edge = NULL; > + struct device *dev = &pdev->dev; > + struct device_node *edge_node; > + int ret; > + > + edge_node = of_get_child_by_name(dev->of_node, "smd-edge"); > + if (edge_node) { > + edge = qcom_smd_register_edge(dev, edge_node); > + if (IS_ERR(edge)) > + return dev_err_probe(dev, PTR_ERR(edge), > + "Failed to register smd-edge\n"); Need of_node_put in both success and IS_ERR paths > + } > + > + ret = devm_of_platform_populate(dev); > + if (ret) { > + dev_err(dev, "Failed to populate children devices: %d\n", ret); I may be having a brain lag moment but I think it should be "child" singular, otherwise it sounds like they're devices for children! > + goto err; > + } > + > + platform_set_drvdata(pdev, edge); > + return 0; > +err: > + if (edge) > + qcom_smd_unregister_edge(edge); > + return ret; > +} > + > +static void rpm_proc_remove(struct platform_device *pdev) > +{ > + struct qcom_smd_edge *edge = platform_get_drvdata(pdev); > + > + if (edge) > + qcom_smd_unregister_edge(edge); > +} > + > +static const struct of_device_id rpm_proc_of_match[] = { > + { .compatible = "qcom,rpm-proc", }, > + { /* sentinel */ } > +}; > +MODULE_DEVICE_TABLE(of, rpm_proc_of_match); > + > +static struct platform_driver rpm_proc_driver = { > + .probe = rpm_proc_probe, > + .remove_new = rpm_proc_remove, > + .driver = { > + .name = "qcom-rpm-proc", > + .of_match_table = rpm_proc_of_match, > + }, > +}; > + > +static int __init rpm_proc_init(void) > +{ > + return platform_driver_register(&rpm_proc_driver); > +} > +arch_initcall(rpm_proc_init); Maybe we can go as early as core... Konrad > + > +static void __exit rpm_proc_exit(void) > +{ > + platform_driver_unregister(&rpm_proc_driver); > +} > +module_exit(rpm_proc_exit); > + > +MODULE_DESCRIPTION("Qualcomm RPM processor/subsystem driver"); > +MODULE_AUTHOR("Stephan Gerhold <stephan@gerhold.net>"); > +MODULE_LICENSE("GPL"); >
On Mon, Jun 05, 2023 at 09:06:54PM +0200, Konrad Dybcio wrote: > > > On 5.06.2023 09:08, Stephan Gerhold wrote: > > Add a simple driver for the qcom,rpm-proc compatible that registers the > > "smd-edge" and populates other children defined in the device tree. > > > > Note that the DT schema belongs to the remoteproc subsystem while this > > driver is added inside soc/qcom. I argue that the RPM *is* a remoteproc, > > but as an implementation detail in Linux it can currently not benefit > > from anything provided by the remoteproc subsystem. The RPM firmware is > > usually already loaded and started by earlier components in the boot > > chain and is not meant to be ever restarted. > > > > To avoid breaking existing kernel configurations the driver is always > > built when smd-rpm.c is also built. They belong closely together anyway. > > > > Signed-off-by: Stephan Gerhold <stephan@gerhold.net> > > --- > > drivers/soc/qcom/Makefile | 2 +- > > drivers/soc/qcom/rpm-proc.c | 76 +++++++++++++++++++++++++++++++++++++++++++++ > > 2 files changed, 77 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile > > index 99114c71092b..113b9ff2ad43 100644 > > --- a/drivers/soc/qcom/Makefile > > +++ b/drivers/soc/qcom/Makefile > > @@ -18,7 +18,7 @@ obj-$(CONFIG_QCOM_RPM_MASTER_STATS) += rpm_master_stats.o > > obj-$(CONFIG_QCOM_RPMH) += qcom_rpmh.o > > qcom_rpmh-y += rpmh-rsc.o > > qcom_rpmh-y += rpmh.o > > -obj-$(CONFIG_QCOM_SMD_RPM) += smd-rpm.o > > +obj-$(CONFIG_QCOM_SMD_RPM) += rpm-proc.o smd-rpm.o > > obj-$(CONFIG_QCOM_SMEM) += smem.o > > obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o > > obj-$(CONFIG_QCOM_SMP2P) += smp2p.o > > diff --git a/drivers/soc/qcom/rpm-proc.c b/drivers/soc/qcom/rpm-proc.c > > new file mode 100644 > > index 000000000000..0652be7f7895 > > --- /dev/null > > +++ b/drivers/soc/qcom/rpm-proc.c > > @@ -0,0 +1,76 @@ > > +// SPDX-License-Identifier: GPL-2.0-only > > +/* Copyright (c) 2021-2023, Stephan Gerhold <stephan@gerhold.net> */ > > + > > +#include <linux/module.h> > > +#include <linux/of.h> > > +#include <linux/of_platform.h> > > +#include <linux/platform_device.h> > > +#include <linux/rpmsg/qcom_smd.h> > > + > > +static int rpm_proc_probe(struct platform_device *pdev) > > +{ > > + struct qcom_smd_edge *edge = NULL; > > + struct device *dev = &pdev->dev; > > + struct device_node *edge_node; > > + int ret; > > + > > + edge_node = of_get_child_by_name(dev->of_node, "smd-edge"); > > + if (edge_node) { > > + edge = qcom_smd_register_edge(dev, edge_node); > > + if (IS_ERR(edge)) > > + return dev_err_probe(dev, PTR_ERR(edge), > > + "Failed to register smd-edge\n"); > Need of_node_put in both success and IS_ERR paths > Oops. :/ > > + } > > + > > + ret = devm_of_platform_populate(dev); > > + if (ret) { > > + dev_err(dev, "Failed to populate children devices: %d\n", ret); > I may be having a brain lag moment but I think it should be "child" > singular, otherwise it sounds like they're devices for children! > Uh somehow both sounds fine to me so I'll just change it in v2. :) > > + goto err; > > + } > > + > > + platform_set_drvdata(pdev, edge); > > + return 0; > > +err: > > + if (edge) > > + qcom_smd_unregister_edge(edge); > > + return ret; > > +} > > + > > +static void rpm_proc_remove(struct platform_device *pdev) > > +{ > > + struct qcom_smd_edge *edge = platform_get_drvdata(pdev); > > + > > + if (edge) > > + qcom_smd_unregister_edge(edge); > > +} > > + > > +static const struct of_device_id rpm_proc_of_match[] = { > > + { .compatible = "qcom,rpm-proc", }, > > + { /* sentinel */ } > > +}; > > +MODULE_DEVICE_TABLE(of, rpm_proc_of_match); > > + > > +static struct platform_driver rpm_proc_driver = { > > + .probe = rpm_proc_probe, > > + .remove_new = rpm_proc_remove, > > + .driver = { > > + .name = "qcom-rpm-proc", > > + .of_match_table = rpm_proc_of_match, > > + }, > > +}; > > + > > +static int __init rpm_proc_init(void) > > +{ > > + return platform_driver_register(&rpm_proc_driver); > > +} > > +arch_initcall(rpm_proc_init); > Maybe we can go as early as core... > SMEM is arch_initcall() so at least for the SMD case it can never succeed probing in core_initcall() and would likely just cause unnecessary probe deferrals. That's why I chose arch_initcall(). Are you sure anything will really benefit from core_initcall() here? I'd just like to avoid making things worse by using a random way too early initcall level. We have some really weird examples in the tree currently, e.g.: - rpmpd: core_initcall() - smd-rpm: arch_initcall() - glink-rpm: subsys_initcall() But they actually need to be loaded in opposite order... Thanks, Stephan
On 5.06.2023 21:51, Stephan Gerhold wrote: > On Mon, Jun 05, 2023 at 09:06:54PM +0200, Konrad Dybcio wrote: >> >> >> On 5.06.2023 09:08, Stephan Gerhold wrote: >>> Add a simple driver for the qcom,rpm-proc compatible that registers the >>> "smd-edge" and populates other children defined in the device tree. >>> >>> Note that the DT schema belongs to the remoteproc subsystem while this >>> driver is added inside soc/qcom. I argue that the RPM *is* a remoteproc, >>> but as an implementation detail in Linux it can currently not benefit >>> from anything provided by the remoteproc subsystem. The RPM firmware is >>> usually already loaded and started by earlier components in the boot >>> chain and is not meant to be ever restarted. >>> >>> To avoid breaking existing kernel configurations the driver is always >>> built when smd-rpm.c is also built. They belong closely together anyway. >>> >>> Signed-off-by: Stephan Gerhold <stephan@gerhold.net> >>> --- [...] > SMEM is arch_initcall() so at least for the SMD case it can never > succeed probing in core_initcall() and would likely just cause > unnecessary probe deferrals. That's why I chose arch_initcall(). > > Are you sure anything will really benefit from core_initcall() here? > > I'd just like to avoid making things worse by using a random way too > early initcall level. We have some really weird examples in the tree > currently, e.g.: > - rpmpd: core_initcall() > - smd-rpm: arch_initcall() > - glink-rpm: subsys_initcall() > But they actually need to be loaded in opposite order... Yes, we should make some sort of dep graph and clean it up.. Konrad > > Thanks, > Stephan
Hi Stephan,
kernel test robot noticed the following build errors:
[auto build test ERROR on 8d5a57ea6a0b1722725170e32e511701ca7c454c]
url: https://github.com/intel-lab-lkp/linux/commits/Stephan-Gerhold/dt-bindings-soc-qcom-smd-rpm-Fix-sort-order/20230605-151438
base: 8d5a57ea6a0b1722725170e32e511701ca7c454c
patch link: https://lore.kernel.org/r/20230531-rpm-rproc-v1-10-e0a3b6de1f14%40gerhold.net
patch subject: [PATCH 10/14] soc: qcom: Add RPM processor/subsystem driver
config: m68k-randconfig-r023-20230605 (https://download.01.org/0day-ci/archive/20230606/202306060446.CAOHuKLm-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 12.3.0
reproduce (this is a W=1 build):
mkdir -p ~/bin
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/e08a6ffdb1d65902d0c4fed40968ff2e4d83a476
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Stephan-Gerhold/dt-bindings-soc-qcom-smd-rpm-Fix-sort-order/20230605-151438
git checkout e08a6ffdb1d65902d0c4fed40968ff2e4d83a476
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.3.0 ~/bin/make.cross W=1 O=build_dir ARCH=m68k olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.3.0 ~/bin/make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306060446.CAOHuKLm-lkp@intel.com/
All errors (new ones prefixed by >>):
m68k-linux-ld: drivers/soc/qcom/rpm-proc.o: in function `rpm_proc_remove':
>> rpm-proc.c:(.text+0x12): undefined reference to `qcom_smd_unregister_edge'
diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile index 99114c71092b..113b9ff2ad43 100644 --- a/drivers/soc/qcom/Makefile +++ b/drivers/soc/qcom/Makefile @@ -18,7 +18,7 @@ obj-$(CONFIG_QCOM_RPM_MASTER_STATS) += rpm_master_stats.o obj-$(CONFIG_QCOM_RPMH) += qcom_rpmh.o qcom_rpmh-y += rpmh-rsc.o qcom_rpmh-y += rpmh.o -obj-$(CONFIG_QCOM_SMD_RPM) += smd-rpm.o +obj-$(CONFIG_QCOM_SMD_RPM) += rpm-proc.o smd-rpm.o obj-$(CONFIG_QCOM_SMEM) += smem.o obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o obj-$(CONFIG_QCOM_SMP2P) += smp2p.o diff --git a/drivers/soc/qcom/rpm-proc.c b/drivers/soc/qcom/rpm-proc.c new file mode 100644 index 000000000000..0652be7f7895 --- /dev/null +++ b/drivers/soc/qcom/rpm-proc.c @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* Copyright (c) 2021-2023, Stephan Gerhold <stephan@gerhold.net> */ + +#include <linux/module.h> +#include <linux/of.h> +#include <linux/of_platform.h> +#include <linux/platform_device.h> +#include <linux/rpmsg/qcom_smd.h> + +static int rpm_proc_probe(struct platform_device *pdev) +{ + struct qcom_smd_edge *edge = NULL; + struct device *dev = &pdev->dev; + struct device_node *edge_node; + int ret; + + edge_node = of_get_child_by_name(dev->of_node, "smd-edge"); + if (edge_node) { + edge = qcom_smd_register_edge(dev, edge_node); + if (IS_ERR(edge)) + return dev_err_probe(dev, PTR_ERR(edge), + "Failed to register smd-edge\n"); + } + + ret = devm_of_platform_populate(dev); + if (ret) { + dev_err(dev, "Failed to populate children devices: %d\n", ret); + goto err; + } + + platform_set_drvdata(pdev, edge); + return 0; +err: + if (edge) + qcom_smd_unregister_edge(edge); + return ret; +} + +static void rpm_proc_remove(struct platform_device *pdev) +{ + struct qcom_smd_edge *edge = platform_get_drvdata(pdev); + + if (edge) + qcom_smd_unregister_edge(edge); +} + +static const struct of_device_id rpm_proc_of_match[] = { + { .compatible = "qcom,rpm-proc", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, rpm_proc_of_match); + +static struct platform_driver rpm_proc_driver = { + .probe = rpm_proc_probe, + .remove_new = rpm_proc_remove, + .driver = { + .name = "qcom-rpm-proc", + .of_match_table = rpm_proc_of_match, + }, +}; + +static int __init rpm_proc_init(void) +{ + return platform_driver_register(&rpm_proc_driver); +} +arch_initcall(rpm_proc_init); + +static void __exit rpm_proc_exit(void) +{ + platform_driver_unregister(&rpm_proc_driver); +} +module_exit(rpm_proc_exit); + +MODULE_DESCRIPTION("Qualcomm RPM processor/subsystem driver"); +MODULE_AUTHOR("Stephan Gerhold <stephan@gerhold.net>"); +MODULE_LICENSE("GPL");