lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48315bce-e55b-4462-b7d0-7f4db3223be2@de.bosch.com>
Date: Mon, 28 Oct 2024 08:11:10 +0100
From: Dirk Behme <dirk.behme@...bosch.com>
To: "Rob Herring (Arm)" <robh@...nel.org>, Saravana Kannan
	<saravanak@...gle.com>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"Rafael J. Wysocki" <rafael@...nel.org>, Miguel Ojeda <ojeda@...nel.org>,
	Alex Gaynor <alex.gaynor@...il.com>, Boqun Feng <boqun.feng@...il.com>, "Gary
 Guo" <gary@...yguo.net>, Björn Roy Baron
	<bjorn3_gh@...tonmail.com>, Benno Lossin <benno.lossin@...ton.me>, "Andreas
 Hindborg" <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>, "Trevor
 Gross" <tmgross@...ch.edu>, Danilo Krummrich <dakr@...nel.org>, Dirk Behme
	<dirk.behme@...il.com>
CC: <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<rust-for-linux@...r.kernel.org>
Subject: Re: [PATCH RFC 0/3] Initial rust bindings for device property reads

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@...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@...nel.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,


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ