Devicetree
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@de.bosch.com>
To: "Rob Herring (Arm)" <robh@kernel.org>,
	"Saravana Kannan" <saravanak@google.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"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" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Dirk Behme" <dirk.behme@gmail.com>
Cc: <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<rust-for-linux@vger.kernel.org>
Subject: Re: [PATCH RFC 0/3] Initial rust bindings for device property reads
Date: Mon, 28 Oct 2024 08:11:10 +0100	[thread overview]
Message-ID: <48315bce-e55b-4462-b7d0-7f4db3223be2@de.bosch.com> (raw)
In-Reply-To: <20241025-rust-platform-dev-v1-0-0df8dcf7c20b@kernel.org>

On 25.10.2024 23:05, Rob Herring (Arm) wrote:
> I got asked about upstreaming DT rust bindings, so I decided to take a
> stab at it.

Many thanks for this!

> This series adds rust bindings for the device property API
> which is a firmware agnostic interface for reading firmware properties.
> There are "DT rust bindings" patches floating around, but for many
> drivers they don't need to know any DT specifics nor deal with struct
> device_node (and its refcounts). And reading firmware properties are
> simple enough for my feeble rust abilities.
> 
> This series is based on top of Danilo's PCI and platform device
> series[1], though that's really only for the sample driver.


On x86 having CONFIG_OF_UNITTESTS enabled I get

rust_driver_platform testcase-data:platform-tests:test-device@2: Probed 
by OF compatible match: 'test,rust-device' with info: '42'.
rust_driver_platform testcase-data:platform-tests:test-device@2: matched 
compatible string idx = 0
rust_driver_platform testcase-data:platform-tests:test-device@2: bool 
prop is false
rust_driver_platform testcase-data:platform-tests:test-device@2: 
'test,u32-prop' is 0xdeadbeef
rust_driver_platform testcase-data:platform-tests:test-device@2: 
'test,i16-array' is [1, 2, -3, -4]
rust_driver_platform testcase-data:platform-tests:test-device@2: 
'test,i16-array' length is 4

with this. Looks good :)

I'm not sure if it makes sense for an RFC patch series but in case it helps:

Tested-by: Dirk Behme <dirk.behme@de.bosch.com>

Some comments will follow in the individual patches.

Best regards

Dirk


> Please tell me how my rust code sucks before I spend more time beating
> my head against the wall^W^W^W^W^W^W learning rust.
> 
> Rob
> 
> [1] https://lore.kernel.org/all/20241022213221.2383-1-dakr@kernel.org/
> 
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
> Rob Herring (Arm) (3):
>        of: unittest: Add a platform device node for rust platform driver sample
>        rust: Add bindings for device properties
>        samples: rust: platform: Add property read examples
> 
>   drivers/of/unittest-data/tests-platform.dtsi |   8 ++
>   rust/bindings/bindings_helper.h              |   1 +
>   rust/kernel/device.rs                        | 145 ++++++++++++++++++++++++++-
>   samples/rust/rust_driver_platform.rs         |  24 ++++-
>   4 files changed, 176 insertions(+), 2 deletions(-)
> ---
> base-commit: eeb31b3e7e9e1b485763ecc66ece8afba1416b2a
> change-id: 20241025-rust-platform-dev-0e89debcbba5
> 
> Best regards,


      parent reply	other threads:[~2024-10-28  7:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-25 21:05 [PATCH RFC 0/3] Initial rust bindings for device property reads Rob Herring (Arm)
2024-10-25 21:05 ` [PATCH RFC 1/3] of: unittest: Add a platform device node for rust platform driver sample Rob Herring (Arm)
2024-10-28  7:11   ` Dirk Behme
2024-10-25 21:05 ` [PATCH RFC 2/3] rust: Add bindings for device properties Rob Herring (Arm)
2024-10-25 21:12   ` Alex Gaynor
2024-10-27 22:07     ` Rob Herring
2024-10-28 22:24     ` Rob Herring
2024-10-29  2:08       ` Alex Gaynor
2024-10-28  7:12   ` Dirk Behme
2024-10-29 14:16   ` Alice Ryhl
2024-10-29 17:57     ` Rob Herring
2024-10-29 18:29       ` Miguel Ojeda
2024-10-29 18:30         ` Miguel Ojeda
2024-10-29 18:48       ` Alice Ryhl
2024-10-29 18:57         ` Miguel Ojeda
2024-10-29 19:35           ` Rob Herring
2024-10-29 22:05             ` Rob Herring
2024-10-30  8:09               ` Alice Ryhl
2024-10-30  8:15             ` Alice Ryhl
2024-10-30 14:05               ` Rob Herring
2024-10-30 15:43                 ` Alice Ryhl
2024-10-30 16:03                 ` Dirk Behme
2024-10-30 16:47                   ` Rob Herring
2024-10-31  7:19                     ` Dirk Behme
2024-11-15  6:39                     ` Dirk Behme
2024-10-25 21:05 ` [PATCH RFC 3/3] samples: rust: platform: Add property read examples Rob Herring (Arm)
2024-10-28  7:13   ` Dirk Behme
2024-10-28  7:11 ` Dirk Behme [this message]

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=48315bce-e55b-4462-b7d0-7f4db3223be2@de.bosch.com \
    --to=dirk.behme@de.bosch.com \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dirk.behme@gmail.com \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --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