From: Daniel Almeida <daniel.almeida@collabora.com>
To: Konrad Dybcio <konradybcio@kernel.org>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Georgi Djakov" <djakov@kernel.org>,
"Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>,
"Bjorn Andersson" <bjorn.andersson@oss.qualcomm.com>,
"Marijn Suijten" <marijn.suijten@somainline.org>,
linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
linux-pm@vger.kernel.org,
"Konrad Dybcio" <konrad.dybcio@oss.qualcomm.com>
Subject: Re: [PATCH DNM 2/2] interconnect: Add a test Rust consumer driver
Date: Wed, 23 Jul 2025 10:10:13 -0300 [thread overview]
Message-ID: <D4552EF5-21DB-44AF-8E45-F57B0B8CB853@collabora.com> (raw)
In-Reply-To: <20250722-topic-icc_rs-v1-2-9da731c14603@oss.qualcomm.com>
Hi Konrad, commenting in case this driver goes forward.
> On 22 Jul 2025, at 18:14, Konrad Dybcio <konradybcio@kernel.org> wrote:
>
> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>
> Do not merge, this is for illustration / CI purposes only.
>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> ---
> drivers/interconnect/Makefile | 1 +
> drivers/interconnect/test.rs | 47 +++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 48 insertions(+)
>
> diff --git a/drivers/interconnect/Makefile b/drivers/interconnect/Makefile
> index b0a9a6753b9dc30083781163ccc01dafcfcd0485..913b92080cc0b79846b74c239e14959b45b5450c 100644
> --- a/drivers/interconnect/Makefile
> +++ b/drivers/interconnect/Makefile
> @@ -2,6 +2,7 @@
>
> CFLAGS_core.o := -I$(src)
> icc-core-objs := core.o bulk.o debugfs-client.o
> +icc-core-$(CONFIG_RUST) += test.o
>
> obj-$(CONFIG_INTERCONNECT) += icc-core.o
> obj-$(CONFIG_INTERCONNECT_IMX) += imx/
> diff --git a/drivers/interconnect/test.rs b/drivers/interconnect/test.rs
> new file mode 100644
> index 0000000000000000000000000000000000000000..f4ba2000d0f1fd2d91aedf8aace0b0b54bfd48f2
> --- /dev/null
> +++ b/drivers/interconnect/test.rs
> @@ -0,0 +1,47 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
> +
> +//! Test interconnect consumer driver
> +use kernel::{
> + c_str, device::Core, icc::*, module_platform_driver, of, of::DeviceId, platform, prelude::*,
> +};
> +
> +#[pin_data]
> +struct IccTestConsumerDriver {
> + #[pin]
> + path: IccPath,
> +}
I don’t think this does anything useful without PhantomPinned, but Benno is
the right person to chime in here.
More importantly though, why do you have #[pin] on IccPath?
> +
> +kernel::of_device_table!(
> + OF_TABLE,
> + MODULE_OF_TABLE,
> + <IccTestConsumerDriver as platform::Driver>::IdInfo,
> + [(DeviceId::new(c_str!("linux,icc-consumer-test")), ())]
> +);
> +
> +impl platform::Driver for IccTestConsumerDriver {
> + type IdInfo = ();
> + const OF_ID_TABLE: Option<of::IdTable<Self::IdInfo>> = Some(&OF_TABLE);
> +
> + fn probe(
> + pdev: &platform::Device<Core>,
> + _id_info: Option<&Self::IdInfo>,
> + ) -> Result<Pin<KBox<Self>>> {
> + let path = IccPath::of_get(pdev.as_ref(), None)?;
> +
> + path.set_bw(
> + IccBwUnit::from_megabits_per_sec(400),
> + IccBwUnit::from_megabits_per_sec(800),
> + )?;
> +
> + Ok(KBox::pin_init(Self { path }, GFP_KERNEL)?.into())
> + }
> +}
> +
> +module_platform_driver! {
> + type: IccTestConsumerDriver,
> + name: "icc-test-consumer",
> + authors: ["Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>"],
> + description: "Test interconnect consumer driver",
> + license: "GPL",
> +}
>
> --
> 2.50.1
>
>
— Daniel
next prev parent reply other threads:[~2025-07-23 13:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-22 21:14 [PATCH 0/2] Add initial interconnect (icc_path) Rust abstractions Konrad Dybcio
2025-07-22 21:14 ` [PATCH 1/2] rust: Add initial interconnect framework abstractions Konrad Dybcio
2025-07-23 10:42 ` Miguel Ojeda
2025-07-23 11:32 ` Konrad Dybcio
2025-07-23 11:41 ` Miguel Ojeda
2025-07-23 11:42 ` Miguel Ojeda
2025-07-23 11:53 ` Konrad Dybcio
2025-07-23 10:44 ` Daniel Sedlak
2025-07-23 11:36 ` Konrad Dybcio
2025-07-23 11:34 ` kernel test robot
2025-07-23 12:36 ` Daniel Almeida
2025-07-22 21:14 ` [PATCH DNM 2/2] interconnect: Add a test Rust consumer driver Konrad Dybcio
2025-07-23 13:10 ` Daniel Almeida [this message]
2025-07-23 13:22 ` Benno Lossin
2025-12-19 12:57 ` Konrad Dybcio
2025-07-23 10:22 ` [PATCH 0/2] Add initial interconnect (icc_path) Rust abstractions Miguel Ojeda
2025-07-24 12:36 ` Konrad Dybcio
2025-07-24 15:55 ` Miguel Ojeda
2025-12-19 12:58 ` 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=D4552EF5-21DB-44AF-8E45-F57B0B8CB853@collabora.com \
--to=daniel.almeida@collabora.com \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn.andersson@oss.qualcomm.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=djakov@kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=gary@garyguo.net \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
/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
all inboxes | Powered by JetHome®