public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@gmail.com>
To: Rob Herring <robh@kernel.org>
Cc: Danilo Krummrich <dakr@kernel.org>,
	gregkh@linuxfoundation.org, rafael@kernel.org,
	bhelgaas@google.com, ojeda@kernel.org, alex.gaynor@gmail.com,
	boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com,
	benno.lossin@proton.me, tmgross@umich.edu,
	a.hindborg@samsung.com, aliceryhl@google.com, airlied@gmail.com,
	fujita.tomonori@gmail.com, lina@asahilina.net,
	pstanner@redhat.com, ajanulgu@redhat.com, lyude@redhat.com,
	daniel.almeida@collabora.com, saravanak@google.com,
	dirk.behme@de.bosch.com, j@jannau.net, fabien.parent@linaro.org,
	chrisi.schrefl@gmail.com, rust-for-linux@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v4 13/13] samples: rust: add Rust platform sample driver
Date: Fri, 6 Dec 2024 07:39:02 +0100	[thread overview]
Message-ID: <626b3707-c2cb-4239-b6f8-8b33e45e7874@gmail.com> (raw)
In-Reply-To: <CAL_JsqJn=bAF4OYVJNDmiyCNQTAte4wmLhpo0Ca5Pv_oGTg73g@mail.gmail.com>

Hi Rob,

On 05.12.24 19:03, Rob Herring wrote:
> On Thu, Dec 5, 2024 at 11:09 AM Dirk Behme <dirk.behme@gmail.com> wrote:
>>
>> Hi Danilo,
>>
>> On 05.12.24 15:14, Danilo Krummrich wrote:
>>> Add a sample Rust platform driver illustrating the usage of the platform
>>> bus abstractions.
>>>
>>> This driver probes through either a match of device / driver name or a
>>> match within the OF ID table.
>>>
>>> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
>>
>> Not a review comment, but a question/proposal:
>>
>> What do you think to convert the platform sample into an example/test?
>> And drop it in samples/rust then? Like [1] below?
>>
>> We would have (a) a complete example in the documentation and (b) some
>> (KUnit) test coverage and (c) have one patch less in the series and
>> (d) one file less to maintain long term.
> 
> I think that's going to become unwieldy when/if we add properties,
> iomem, and every other thing a driver can call in probe.


Yes, I agree. In your property RFC you added some (nice!) property
access examples to the sample we are talking about here. That would
become difficult with the documentation/Kunit example proposed here.
So I think there are pros & cons for both options ;)


> OTOH, the need for the sample will quickly diminish once there are
> real drivers using this stuff.
> 
>> I think to remember that it was mentioned somewhere that a
>> documentation example / KUnit test is preferred over samples/rust (?).
> 
> Really? I've only figured out how you build and run the samples. I
> started looking into how to do the documentation kunit stuff and still
> haven't figured it out. 

If you like try CONFIG_KUNIT=y and CONFIG_RUST_KERNEL_DOCTESTS=y.

I guess it will run automatically at boot, then. For me that was the
easiest way. But yes, everything else will need some additional steps.

Dirk

> I'm sure it is "easy", but it's not as easy as
> the samples and yet another thing to go learn with the rust stuff. For
> example, just ensuring it builds is more than just "compile the
> kernel". We already have so many steps for submitting things upstream
> and rust is just adding more on top.



  reply	other threads:[~2024-12-06  6:39 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-05 14:14 [PATCH v4 00/13] Device / Driver PCI / Platform Rust abstractions Danilo Krummrich
2024-12-05 14:14 ` [PATCH v4 01/13] rust: pass module name to `Module::init` Danilo Krummrich
2024-12-05 14:14 ` [PATCH v4 02/13] rust: implement generic driver registration Danilo Krummrich
2024-12-06 13:57   ` Alice Ryhl
2024-12-06 18:13     ` Danilo Krummrich
2024-12-05 14:14 ` [PATCH v4 03/13] rust: implement `IdArray`, `IdTable` and `RawDeviceId` Danilo Krummrich
2024-12-07  1:14   ` Fabien Parent
2024-12-09 10:45     ` Danilo Krummrich
2024-12-05 14:14 ` [PATCH v4 04/13] rust: add rcu abstraction Danilo Krummrich
2024-12-05 14:14 ` [PATCH v4 05/13] rust: add `Revocable` type Danilo Krummrich
2024-12-06 15:11   ` Alice Ryhl
2024-12-09 10:40     ` Danilo Krummrich
2024-12-05 14:14 ` [PATCH v4 06/13] rust: add `io::{Io, IoRaw}` base types Danilo Krummrich
2024-12-06 14:13   ` Alice Ryhl
2024-12-11 14:52   ` Daniel Almeida
2024-12-05 14:14 ` [PATCH v4 07/13] rust: add devres abstraction Danilo Krummrich
2024-12-05 14:14 ` [PATCH v4 08/13] rust: pci: add basic PCI device / driver abstractions Danilo Krummrich
2024-12-06 14:01   ` Alice Ryhl
2024-12-09 10:44     ` Danilo Krummrich
2024-12-10 10:55       ` Alice Ryhl
2024-12-10 22:38         ` Danilo Krummrich
2024-12-11 13:06           ` Alice Ryhl
2024-12-11 14:32             ` Danilo Krummrich
2024-12-11 14:41               ` Greg KH
2024-12-11 14:42                 ` Greg KH
2024-12-11 14:44               ` Alice Ryhl
2024-12-06 15:25   ` Alice Ryhl
2024-12-05 14:14 ` [PATCH v4 09/13] rust: pci: implement I/O mappable `pci::Bar` Danilo Krummrich
2024-12-06 10:44   ` Philipp Stanner
2024-12-05 14:14 ` [PATCH v4 10/13] samples: rust: add Rust PCI sample driver Danilo Krummrich
2024-12-05 14:14 ` [PATCH v4 11/13] rust: of: add `of::DeviceId` abstraction Danilo Krummrich
2024-12-09 21:22   ` Rob Herring
2024-12-05 14:14 ` [PATCH v4 12/13] rust: platform: add basic platform device / driver abstractions Danilo Krummrich
2024-12-09 22:37   ` Rob Herring
2024-12-09 23:13     ` Danilo Krummrich
2024-12-10  7:46     ` Greg KH
2024-12-10  9:34       ` Danilo Krummrich
2024-12-10  9:40         ` Greg KH
2024-12-05 14:14 ` [PATCH v4 13/13] samples: rust: add Rust platform sample driver Danilo Krummrich
2024-12-05 17:09   ` Dirk Behme
2024-12-05 18:03     ` Rob Herring
2024-12-06  6:39       ` Dirk Behme [this message]
2024-12-06  8:33     ` Danilo Krummrich
2024-12-06  9:29       ` Dirk Behme
2024-12-10 22:59   ` Rob Herring (Arm)

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=626b3707-c2cb-4239-b6f8-8b33e45e7874@gmail.com \
    --to=dirk.behme@gmail.com \
    --cc=a.hindborg@samsung.com \
    --cc=airlied@gmail.com \
    --cc=ajanulgu@redhat.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=chrisi.schrefl@gmail.com \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dirk.behme@de.bosch.com \
    --cc=fabien.parent@linaro.org \
    --cc=fujita.tomonori@gmail.com \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=j@jannau.net \
    --cc=lina@asahilina.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=ojeda@kernel.org \
    --cc=pstanner@redhat.com \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=saravanak@google.com \
    --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