<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/samples/rust/rust_driver_platform.rs, branch v6.17-rc6</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>samples: rust: add ACPI match table example to platform driver</title>
<updated>2025-06-26T21:26:15+00:00</updated>
<author>
<name>Igor Korotin</name>
<email>igor.korotin.linux@gmail.com</email>
</author>
<published>2025-06-20T15:45:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=140a9d0437b2a0d82e05b33973d9fc42c1d1c2ea'/>
<id>140a9d0437b2a0d82e05b33973d9fc42c1d1c2ea</id>
<content type='text'>
Extend the Rust sample platform driver to probe using device/driver name
matching, OF ID table matching, or ACPI ID table matching.

Signed-off-by: Igor Korotin &lt;igor.korotin.linux@gmail.com&gt;
Link: https://lore.kernel.org/r/20250620154552.299932-1-igor.korotin.linux@gmail.com
[ Use 'LNUXBEEF' as ACPI ID. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extend the Rust sample platform driver to probe using device/driver name
matching, OF ID table matching, or ACPI ID table matching.

Signed-off-by: Igor Korotin &lt;igor.korotin.linux@gmail.com&gt;
Link: https://lore.kernel.org/r/20250620154552.299932-1-igor.korotin.linux@gmail.com
[ Use 'LNUXBEEF' as ACPI ID. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>samples: rust: platform: conditionally call Self::properties_parse()</title>
<updated>2025-06-25T16:10:12+00:00</updated>
<author>
<name>Danilo Krummrich</name>
<email>dakr@kernel.org</email>
</author>
<published>2025-06-20T15:21:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9da36b9faed26f634c9f04a0f2cf7625c08f5d65'/>
<id>9da36b9faed26f634c9f04a0f2cf7625c08f5d65</id>
<content type='text'>
Only call Self::properties_parse() when the FwNode is an OF node.

Once we add ACPI support, we don't want the ACPI device to fail probing
in Self::properties_parse().

Signed-off-by: Igor Korotin &lt;igor.korotin.linux@gmail.com&gt;
Link: https://lore.kernel.org/r/20250620152103.282763-1-igor.korotin.linux@gmail.com
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Only call Self::properties_parse() when the FwNode is an OF node.

Once we add ACPI support, we don't want the ACPI device to fail probing
in Self::properties_parse().

Signed-off-by: Igor Korotin &lt;igor.korotin.linux@gmail.com&gt;
Link: https://lore.kernel.org/r/20250620152103.282763-1-igor.korotin.linux@gmail.com
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>samples: rust: platform: don't call as_ref() repeatedly</title>
<updated>2025-06-25T16:10:12+00:00</updated>
<author>
<name>Danilo Krummrich</name>
<email>dakr@kernel.org</email>
</author>
<published>2025-06-20T15:18:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c69072d3a10976e48da97758a78c35305c24eeba'/>
<id>c69072d3a10976e48da97758a78c35305c24eeba</id>
<content type='text'>
In SampleDriver::probe() don't call pdev.as_ref() repeatedly, instead
introduce a dedicated &amp;Device.

Signed-off-by: Igor Korotin &lt;igor.korotin.linux@gmail.com&gt;
Reviewed-by: Dirk Behme &lt;dirk.behme@de.bosch.com&gt;
Link: https://lore.kernel.org/r/20250620151849.281238-1-igor.korotin.linux@gmail.com
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In SampleDriver::probe() don't call pdev.as_ref() repeatedly, instead
introduce a dedicated &amp;Device.

Signed-off-by: Igor Korotin &lt;igor.korotin.linux@gmail.com&gt;
Reviewed-by: Dirk Behme &lt;dirk.behme@de.bosch.com&gt;
Link: https://lore.kernel.org/r/20250620151849.281238-1-igor.korotin.linux@gmail.com
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>samples: rust: platform: Add property child and reference args examples</title>
<updated>2025-06-25T15:48:41+00:00</updated>
<author>
<name>Remo Senekowitsch</name>
<email>remo@buenzli.dev</email>
</author>
<published>2025-06-16T15:45:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c79cbde9b7bc7a650af96269588518950e3c2441'/>
<id>c79cbde9b7bc7a650af96269588518950e3c2441</id>
<content type='text'>
Add some example usage of the device property methods for reading
DT/ACPI/swnode child nodes and reference args.

Signed-off-by: Remo Senekowitsch &lt;remo@buenzli.dev&gt;
Link: https://lore.kernel.org/r/20250616154511.1862909-4-remo@buenzli.dev
[ Convert 'child@{0,1}' to 'child-{0,1}'; skip child nodes without
  'compatible' property in of_unittest_platform_populate() as proposed
  by Rob Herring. - Danilo]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add some example usage of the device property methods for reading
DT/ACPI/swnode child nodes and reference args.

Signed-off-by: Remo Senekowitsch &lt;remo@buenzli.dev&gt;
Link: https://lore.kernel.org/r/20250616154511.1862909-4-remo@buenzli.dev
[ Convert 'child@{0,1}' to 'child-{0,1}'; skip child nodes without
  'compatible' property in of_unittest_platform_populate() as proposed
  by Rob Herring. - Danilo]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>samples: rust: platform: Add property read examples</title>
<updated>2025-06-12T23:14:13+00:00</updated>
<author>
<name>Remo Senekowitsch</name>
<email>remo@buenzli.dev</email>
</author>
<published>2025-06-11T10:29:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2a1ea59de83bf367215e2a4dd9bf8bbd061349b3'/>
<id>2a1ea59de83bf367215e2a4dd9bf8bbd061349b3</id>
<content type='text'>
Add some example usage of the device property read methods for
DT/ACPI/swnode properties.

Tested-by: Dirk Behme &lt;dirk.behme@de.bosch.com&gt;
Co-developed-by: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Signed-off-by: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Signed-off-by: Remo Senekowitsch &lt;remo@buenzli.dev&gt;
Link: https://lore.kernel.org/r/20250611102908.212514-10-remo@buenzli.dev
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add some example usage of the device property read methods for
DT/ACPI/swnode properties.

Tested-by: Dirk Behme &lt;dirk.behme@de.bosch.com&gt;
Co-developed-by: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Signed-off-by: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Signed-off-by: Remo Senekowitsch &lt;remo@buenzli.dev&gt;
Link: https://lore.kernel.org/r/20250611102908.212514-10-remo@buenzli.dev
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'driver-core-6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core</title>
<updated>2025-04-01T18:02:03+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2025-04-01T18:02:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2cd5769fb0b78b8ef583ab4c0015c2c48d525dac'/>
<id>2cd5769fb0b78b8ef583ab4c0015c2c48d525dac</id>
<content type='text'>
Pull driver core updatesk from Greg KH:
 "Here is the big set of driver core updates for 6.15-rc1. Lots of stuff
  happened this development cycle, including:

   - kernfs scaling changes to make it even faster thanks to rcu

   - bin_attribute constify work in many subsystems

   - faux bus minor tweaks for the rust bindings

   - rust binding updates for driver core, pci, and platform busses,
     making more functionaliy available to rust drivers. These are all
     due to people actually trying to use the bindings that were in
     6.14.

   - make Rafael and Danilo full co-maintainers of the driver core
     codebase

   - other minor fixes and updates"

* tag 'driver-core-6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (52 commits)
  rust: platform: require Send for Driver trait implementers
  rust: pci: require Send for Driver trait implementers
  rust: platform: impl Send + Sync for platform::Device
  rust: pci: impl Send + Sync for pci::Device
  rust: platform: fix unrestricted &amp;mut platform::Device
  rust: pci: fix unrestricted &amp;mut pci::Device
  rust: device: implement device context marker
  rust: pci: use to_result() in enable_device_mem()
  MAINTAINERS: driver core: mark Rafael and Danilo as co-maintainers
  rust/kernel/faux: mark Registration methods inline
  driver core: faux: only create the device if probe() succeeds
  rust/faux: Add missing parent argument to Registration::new()
  rust/faux: Drop #[repr(transparent)] from faux::Registration
  rust: io: fix devres test with new io accessor functions
  rust: io: rename `io::Io` accessors
  kernfs: Move dput() outside of the RCU section.
  efi: rci2: mark bin_attribute as __ro_after_init
  rapidio: constify 'struct bin_attribute'
  firmware: qemu_fw_cfg: constify 'struct bin_attribute'
  powerpc/perf/hv-24x7: Constify 'struct bin_attribute'
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull driver core updatesk from Greg KH:
 "Here is the big set of driver core updates for 6.15-rc1. Lots of stuff
  happened this development cycle, including:

   - kernfs scaling changes to make it even faster thanks to rcu

   - bin_attribute constify work in many subsystems

   - faux bus minor tweaks for the rust bindings

   - rust binding updates for driver core, pci, and platform busses,
     making more functionaliy available to rust drivers. These are all
     due to people actually trying to use the bindings that were in
     6.14.

   - make Rafael and Danilo full co-maintainers of the driver core
     codebase

   - other minor fixes and updates"

* tag 'driver-core-6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (52 commits)
  rust: platform: require Send for Driver trait implementers
  rust: pci: require Send for Driver trait implementers
  rust: platform: impl Send + Sync for platform::Device
  rust: pci: impl Send + Sync for pci::Device
  rust: platform: fix unrestricted &amp;mut platform::Device
  rust: pci: fix unrestricted &amp;mut pci::Device
  rust: device: implement device context marker
  rust: pci: use to_result() in enable_device_mem()
  MAINTAINERS: driver core: mark Rafael and Danilo as co-maintainers
  rust/kernel/faux: mark Registration methods inline
  driver core: faux: only create the device if probe() succeeds
  rust/faux: Add missing parent argument to Registration::new()
  rust/faux: Drop #[repr(transparent)] from faux::Registration
  rust: io: fix devres test with new io accessor functions
  rust: io: rename `io::Io` accessors
  kernfs: Move dput() outside of the RCU section.
  efi: rci2: mark bin_attribute as __ro_after_init
  rapidio: constify 'struct bin_attribute'
  firmware: qemu_fw_cfg: constify 'struct bin_attribute'
  powerpc/perf/hv-24x7: Constify 'struct bin_attribute'
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>rust: platform: fix unrestricted &amp;mut platform::Device</title>
<updated>2025-03-17T07:04:25+00:00</updated>
<author>
<name>Danilo Krummrich</name>
<email>dakr@kernel.org</email>
</author>
<published>2025-03-14T16:09:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4d320e30ee04c25c660eca2bb33e846ebb71a79a'/>
<id>4d320e30ee04c25c660eca2bb33e846ebb71a79a</id>
<content type='text'>
As by now, platform::Device is implemented as:

	#[derive(Clone)]
	pub struct Device(ARef&lt;device::Device&gt;);

This may be convenient, but has the implication that drivers can call
device methods that require a mutable reference concurrently at any
point of time.

Instead define platform::Device as

	pub struct Device&lt;Ctx: DeviceContext = Normal&gt;(
		Opaque&lt;bindings::platform_dev&gt;,
		PhantomData&lt;Ctx&gt;,
	);

and manually implement the AlwaysRefCounted trait.

With this we can implement methods that should only be called from
bus callbacks (such as probe()) for platform::Device&lt;Core&gt;. Consequently,
we make this type accessible in bus callbacks only.

Arbitrary references taken by the driver are still of type
ARef&lt;platform::Device&gt; and hence don't provide access to methods that are
reserved for bus callbacks.

Fixes: 683a63befc73 ("rust: platform: add basic platform device / driver abstractions")
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Acked-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Link: https://lore.kernel.org/r/20250314160932.100165-5-dakr@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As by now, platform::Device is implemented as:

	#[derive(Clone)]
	pub struct Device(ARef&lt;device::Device&gt;);

This may be convenient, but has the implication that drivers can call
device methods that require a mutable reference concurrently at any
point of time.

Instead define platform::Device as

	pub struct Device&lt;Ctx: DeviceContext = Normal&gt;(
		Opaque&lt;bindings::platform_dev&gt;,
		PhantomData&lt;Ctx&gt;,
	);

and manually implement the AlwaysRefCounted trait.

With this we can implement methods that should only be called from
bus callbacks (such as probe()) for platform::Device&lt;Core&gt;. Consequently,
we make this type accessible in bus callbacks only.

Arbitrary references taken by the driver are still of type
ARef&lt;platform::Device&gt; and hence don't provide access to methods that are
reserved for bus callbacks.

Fixes: 683a63befc73 ("rust: platform: add basic platform device / driver abstractions")
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Acked-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Link: https://lore.kernel.org/r/20250314160932.100165-5-dakr@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rust: module: introduce `authors` key</title>
<updated>2025-03-10T14:12:17+00:00</updated>
<author>
<name>Guilherme Giacomo Simoes</name>
<email>trintaeoitogc@gmail.com</email>
</author>
<published>2025-03-09T17:57:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=38559da6afb239e271e709588babe7f98195096b'/>
<id>38559da6afb239e271e709588babe7f98195096b</id>
<content type='text'>
In the `module!` macro, the `author` field is currently of type `String`.

Since modules can have multiple authors, this limitation prevents
specifying more than one.

Add an `authors` field as `Option&lt;Vec&lt;String&gt;&gt;` to allow creating
modules with multiple authors, and change the documentation and all
current users to use it. Eventually, the single `author` field may
be removed.

[ The `modinfo` key needs to still be `author`; otherwise, tooling
  may not work properly, e.g.:

      $ modinfo --author samples/rust/rust_print.ko
      Rust for Linux Contributors

  I have also kept the original `author` field (undocumented), so
  that we can drop it more easily in a kernel cycle or two.

    - Miguel ]

Suggested-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Link: https://github.com/Rust-for-Linux/linux/issues/244
Reviewed-by: Charalampos Mitrodimas &lt;charmitro@posteo.net&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Signed-off-by: Guilherme Giacomo Simoes &lt;trintaeoitogc@gmail.com&gt;
Link: https://lore.kernel.org/r/20250309175712.845622-2-trintaeoitogc@gmail.com
[ Fixed `modinfo` key. Kept `author` field. Reworded message
  accordingly. Updated my email. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the `module!` macro, the `author` field is currently of type `String`.

Since modules can have multiple authors, this limitation prevents
specifying more than one.

Add an `authors` field as `Option&lt;Vec&lt;String&gt;&gt;` to allow creating
modules with multiple authors, and change the documentation and all
current users to use it. Eventually, the single `author` field may
be removed.

[ The `modinfo` key needs to still be `author`; otherwise, tooling
  may not work properly, e.g.:

      $ modinfo --author samples/rust/rust_print.ko
      Rust for Linux Contributors

  I have also kept the original `author` field (undocumented), so
  that we can drop it more easily in a kernel cycle or two.

    - Miguel ]

Suggested-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Link: https://github.com/Rust-for-Linux/linux/issues/244
Reviewed-by: Charalampos Mitrodimas &lt;charmitro@posteo.net&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Signed-off-by: Guilherme Giacomo Simoes &lt;trintaeoitogc@gmail.com&gt;
Link: https://lore.kernel.org/r/20250309175712.845622-2-trintaeoitogc@gmail.com
[ Fixed `modinfo` key. Kept `author` field. Reworded message
  accordingly. Updated my email. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>samples: rust: add Rust platform sample driver</title>
<updated>2024-12-20T16:43:02+00:00</updated>
<author>
<name>Danilo Krummrich</name>
<email>dakr@kernel.org</email>
</author>
<published>2024-12-19T17:04:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b2e8a83242c0b8d5d382a1aeceed18aa9bcb9a00'/>
<id>b2e8a83242c0b8d5d382a1aeceed18aa9bcb9a00</id>
<content type='text'>
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.

Reviewed-by: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Tested-by: Dirk Behme &lt;dirk.behme@de.bosch.com&gt;
Tested-by: Fabien Parent &lt;fabien.parent@linaro.org&gt;
Link: https://lore.kernel.org/r/20241219170425.12036-16-dakr@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.

Reviewed-by: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Tested-by: Dirk Behme &lt;dirk.behme@de.bosch.com&gt;
Tested-by: Fabien Parent &lt;fabien.parent@linaro.org&gt;
Link: https://lore.kernel.org/r/20241219170425.12036-16-dakr@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
