<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/rust/pin-init/src, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-04-02T11:25:53+00:00</updated>
<entry>
<title>rust: pin-init: internal: init: document load-bearing fact of field accessors</title>
<updated>2026-04-02T11:25:53+00:00</updated>
<author>
<name>Benno Lossin</name>
<email>lossin@kernel.org</email>
</author>
<published>2026-03-25T12:57:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aed9373c05b47a8c4022706ad09835168970c7ad'/>
<id>urn:sha1:aed9373c05b47a8c4022706ad09835168970c7ad</id>
<content type='text'>
[ Upstream commit 580cc37b1de4fcd9997c48d7080e744533f09f36 ]

The functions `[Pin]Init::__[pinned_]init` and `ptr::write` called from
the `init!` macro require the passed pointer to be aligned. This fact is
ensured by the creation of field accessors to previously initialized
fields.

Since we missed this very important fact from the beginning [1],
document it in the code.

Link: https://rust-for-linux.zulipchat.com/#narrow/channel/561532-pin-init/topic/initialized.20field.20accessor.20detection/with/576210658 [1]
Fixes: 90e53c5e70a6 ("rust: add pin-init API core")
Cc: &lt;stable@vger.kernel.org&gt; # 6.6.y, 6.12.y: 42415d163e5d: rust: pin-init: add references to previously initialized fields
Cc: &lt;stable@vger.kernel.org&gt; # 6.6.y, 6.12.y, 6.18.y, 6.19.y
Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;
Link: https://patch.msgid.link/20260302140424.4097655-2-lossin@kernel.org
[ Updated Cc: stable@ tags as discussed. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
[ Moved changes to the declarative macro, because 6.19.y and earlier do not
  have `syn`. Also duplicated the comment for all field accessor creations.
  - Benno ]
Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: replace clippy `expect` with `allow`</title>
<updated>2026-03-04T12:21:45+00:00</updated>
<author>
<name>Benno Lossin</name>
<email>lossin@kernel.org</email>
</author>
<published>2026-02-15T13:22:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=da4598daee0107f21808850ec0022fcd8bf63c15'/>
<id>urn:sha1:da4598daee0107f21808850ec0022fcd8bf63c15</id>
<content type='text'>
[ Upstream commit a58b8764aed9648357b1c5b6368c9943ba33b7f9 ]

`clippy` has changed behavior in [1] (Rust 1.95) where it no longer
warns about the `let_and_return` lint when a comment is placed between
the let binding and the return expression. Nightly thus fails to build,
because the expectation is no longer fulfilled.

Thus replace the expectation with an `allow`.

[ The errors were:

      error: this lint expectation is unfulfilled
          --&gt; rust/pin-init/src/lib.rs:1279:10
           |
      1279 | #[expect(clippy::let_and_return)]
           |          ^^^^^^^^^^^^^^^^^^^^^^
           |
           = note: `-D unfulfilled-lint-expectations` implied by `-D warnings`
           = help: to override `-D warnings` add `#[allow(unfulfilled_lint_expectations)]`

      error: this lint expectation is unfulfilled
          --&gt; rust/pin-init/src/lib.rs:1295:10
           |
      1295 | #[expect(clippy::let_and_return)]
           |          ^^^^^^^^^^^^^^^^^^^^^^

    - Miguel ]

Link: https://github.com/rust-lang/rust-clippy/pull/16461 [1]
Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
Cc: stable@vger.kernel.org # Needed in 6.18.y and later.
Link: https://patch.msgid.link/20260215132232.1549861-1-lossin@kernel.org
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'driver-core-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core</title>
<updated>2025-12-06T05:29:02+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2025-12-06T05:29:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=416f99c3b16f582a3fc6d64a1f77f39d94b76de5'/>
<id>urn:sha1:416f99c3b16f582a3fc6d64a1f77f39d94b76de5</id>
<content type='text'>
Pull driver core updates from Danilo Krummrich:
 "Arch Topology:
   - Move parse_acpi_topology() from arm64 to common code for reuse in
     RISC-V

  CPU:
   - Expose housekeeping CPUs through /sys/devices/system/cpu/housekeeping
   - Print a newline (or 0x0A) instead of '(null)' reading
     /sys/devices/system/cpu/nohz_full when nohz_full= is not set

  debugfs
   - Remove (broken) 'no-mount' mode
   - Remove redundant access mode checks in debugfs_get_tree() and
     debugfs_create_*() functions

  Devres:
   - Remove unused devm_free_percpu() helper
   - Move devm_alloc_percpu() from device.h to devres.h

  Firmware Loader:
   - Replace simple_strtol() with kstrtoint()
   - Do not call cancel_store() when no upload is in progress

  kernfs:
   - Increase struct super_block::maxbytes to MAX_LFS_FILESIZE
   - Fix a missing unwind path in __kernfs_new_node()

  Misc:
   - Increase the name size in struct auxiliary_device_id to 40
     characters
   - Replace system_unbound_wq with system_dfl_wq and add WQ_PERCPU to
     alloc_workqueue()

  Platform:
   - Replace ERR_PTR() with IOMEM_ERR_PTR() in platform ioremap
     functions

  Rust:
   - Auxiliary:
      - Unregister auxiliary device on parent device unbind
      - Move parent() to impl Device; implement device context aware
        parent() for Device&lt;Bound&gt;
      - Illustrate how to safely obtain a driver's device private data
        when calling from an auxiliary driver into the parant device
        driver

   - DebugFs:
      - Implement support for binary large objects

   - Device:
      - Let probe() return the driver's device private data as pinned
        initializer, i.e. impl PinInit&lt;Self, Error&gt;
      - Implement safe accessor for a driver's device private data for
        Device&lt;Bound&gt; (returned reference can't out-live driver binding
        and guarantees the correct private data type)
      - Implement AsBusDevice trait, to be used by class device
        abstractions to derive the bus device type of the parent device

   - DMA:
      - Store raw pointer of allocation as NonNull
      - Use start_ptr() and start_ptr_mut() to inherit correct
        mutability of self

   - FS:
      - Add file::Offset type alias

   - I2C:
      - Add abstractions for I2C device / driver infrastructure
      - Implement abstractions for manual I2C device registrations

   - I/O:
      - Use "kernel vertical" style for imports
      - Define ResourceSize as resource_size_t
      - Move ResourceSize to top-level I/O module
      - Add type alias for phys_addr_t
      - Implement Rust version of read_poll_timeout_atomic()

   - PCI:
      - Use "kernel vertical" style for imports
      - Move I/O and IRQ infrastructure to separate files
      - Add support for PCI interrupt vectors
      - Implement TryInto&lt;IrqRequest&lt;'a&gt;&gt; for IrqVector&lt;'a&gt; to convert
        an IrqVector bound to specific pci::Device into an IrqRequest
        bound to the same pci::Device's parent Device
      - Leverage pin_init_scope() to get rid of redundant Result in IRQ
        methods

   - PinInit:
      - Add {pin_}init_scope() to execute code before creating an
        initializer

   - Platform:
      - Leverage pin_init_scope() to get rid of redundant Result in IRQ
        methods

   - Timekeeping:
      - Implement abstraction of udelay()

   - Uaccess:
      - Implement read_slice_partial() and read_slice_file() for
        UserSliceReader
      - Implement write_slice_partial() and write_slice_file() for
        UserSliceWriter

  sysfs:
   - Prepare the constification of struct attribute"

* tag 'driver-core-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core: (75 commits)
  rust: pci: fix build failure when CONFIG_PCI_MSI is disabled
  debugfs: Fix default access mode config check
  debugfs: Remove broken no-mount mode
  debugfs: Remove redundant access mode checks
  driver core: Check drivers_autoprobe for all added devices
  driver core: WQ_PERCPU added to alloc_workqueue users
  driver core: replace use of system_unbound_wq with system_dfl_wq
  tick/nohz: Expose housekeeping CPUs in sysfs
  tick/nohz: avoid showing '(null)' if nohz_full= not set
  sysfs/cpu: Use DEVICE_ATTR_RO for nohz_full attribute
  kernfs: fix memory leak of kernfs_iattrs in __kernfs_new_node
  fs/kernfs: raise sb-&gt;maxbytes to MAX_LFS_FILESIZE
  mod_devicetable: Bump auxiliary_device_id name size
  sysfs: simplify attribute definition macros
  samples/kobject: constify 'struct foo_attribute'
  samples/kobject: add is_visible() callback to attribute group
  sysfs: attribute_group: enable const variants of is_visible()
  sysfs: introduce __SYSFS_FUNCTION_ALTERNATIVE()
  sysfs: transparently handle const pointers in ATTRIBUTE_GROUPS()
  sysfs: attribute_group: allow registration of const attribute
  ...
</content>
</entry>
<entry>
<title>rust: pin-init: fix broken rust doc link</title>
<updated>2025-11-19T21:18:33+00:00</updated>
<author>
<name>Benno Lossin</name>
<email>lossin@kernel.org</email>
</author>
<published>2025-10-16T21:17:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=53870c679e4933d11d9488db61caa3e670621528'/>
<id>urn:sha1:53870c679e4933d11d9488db61caa3e670621528</id>
<content type='text'>
Rust 1.92.0 warns when building the documentation that [`PinnedDrop`] is
an invalid reference. This is correct and it's weird that it didn't warn
before, so fix the link.

[ The reason is that it is hidden -- I had asked about that in the
  upstream PR that changed the behavior because I wasn't sure it was
  intentional (and thus whether we needed to fix this and other cases):

      https://github.com/rust-lang/rust/pull/147153#issuecomment-3395484636

  It turns out it was not, and it has been fixed for 1.92.0's upcoming
  release thanks to Guillaume and León. So we do not strictly need
  this patch and the other changes anymore:

      https://github.com/rust-lang/rust/pull/147809

  However, checking hidden/private items or, even better, a runtime
  toggle to be able to see those on the fly, is something that I think
  would be quite nice so I have had it in our usual lists for a while.
  Guillaume is open to the idea and perhaps experimenting with an
  implementation on our side first -- he asked me to open issues
  upstream:

      https://github.com/rust-lang/rust/issues/149105
      https://github.com/rust-lang/rust/issues/149106

    - Miguel ]

Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
Link: https://patch.msgid.link/20251016211740.653599-1-lossin@kernel.org
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>add `[pin_]init_scope` to execute code before creating an initializer</title>
<updated>2025-10-20T22:40:12+00:00</updated>
<author>
<name>Benno Lossin</name>
<email>lossin@kernel.org</email>
</author>
<published>2025-10-16T21:05:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fc2b38de4c01710ecb9ebb9ecdce9a7bf433e9a8'/>
<id>urn:sha1:fc2b38de4c01710ecb9ebb9ecdce9a7bf433e9a8</id>
<content type='text'>
In more complex cases, initializers need to run arbitrary code before
assigning initializers to fields. While this is possible using the
underscore codeblock feature (`_: {}`), values returned by such
functions cannot be used from later field initializers.

The two new functions `[pin_]init_scope` allow users to first run some
fallible code and then return an initializer which the function turns
into a single initializer. This permits using the same value multiple
times by different fields.

Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;
Reviewed-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
[ Fix typo in commit message: s/functinos/functions/. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: add references to previously initialized fields</title>
<updated>2025-09-11T21:30:02+00:00</updated>
<author>
<name>Benno Lossin</name>
<email>lossin@kernel.org</email>
</author>
<published>2025-09-05T14:00:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=42415d163e5df6db799c7de6262d707e402c2c7e'/>
<id>urn:sha1:42415d163e5df6db799c7de6262d707e402c2c7e</id>
<content type='text'>
After initializing a field in an initializer macro, create a variable
holding a reference that points at that field. The type is either
`Pin&lt;&amp;mut T&gt;` or `&amp;mut T` depending on the field's structural pinning
kind.

[ Applied fixes to devres and rust_driver_pci sample - Benno]
Reviewed-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: add code blocks to `[try_][pin_]init!` macros</title>
<updated>2025-09-11T21:26:44+00:00</updated>
<author>
<name>Benno Lossin</name>
<email>lossin@kernel.org</email>
</author>
<published>2025-09-05T14:05:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1fa516794fdd27b96cee77f8b12ac916b8b6a9a7'/>
<id>urn:sha1:1fa516794fdd27b96cee77f8b12ac916b8b6a9a7</id>
<content type='text'>
Allow writing `_: { /* any number of statements */ }` in initializers to
run arbitrary code during initialization.

    try_init!(MyStruct {
        _: {
            if check_something() {
                return Err(MyError);
            }
        },
        foo: Foo::new(val),
        _: {
            println!("successfully initialized `MyStruct`");
        },
    })

Tested-by: Alexandre Courbot &lt;acourbot@nvidia.com&gt;
Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Tested-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Reviewed-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: add pin projections to `#[pin_data]`</title>
<updated>2025-09-11T21:26:20+00:00</updated>
<author>
<name>Benno Lossin</name>
<email>lossin@kernel.org</email>
</author>
<published>2025-09-05T17:12:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=619db96daf942dad974c6c8157ed06d52f7bb969'/>
<id>urn:sha1:619db96daf942dad974c6c8157ed06d52f7bb969</id>
<content type='text'>
Make the `#[pin_data]` macro generate a `*Projection` struct that holds
either `Pin&lt;&amp;mut Field&gt;` or `&amp;mut Field` for every field of the original
struct. Which version is chosen depends on weather there is a `#[pin]`
or not respectively. Access to this projected version is enabled through
generating `fn project(self: Pin&lt;&amp;mut Self&gt;) -&gt; SelfProjection&lt;'_&gt;`.

[ Adapt workqueue to use the new projection instead of its own, custom
  one - Benno ]

Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;
Reviewed-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: rename `project` -&gt; `project_this` in doctest</title>
<updated>2025-09-11T21:26:11+00:00</updated>
<author>
<name>Benno Lossin</name>
<email>lossin@kernel.org</email>
</author>
<published>2025-09-05T17:12:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d49c56368c0cc98cdf02ae21dd275eba92f1c333'/>
<id>urn:sha1:d49c56368c0cc98cdf02ae21dd275eba92f1c333</id>
<content type='text'>
The next commit makes the `#[pin_data]` attribute generate a `project`
function that would collide with any existing ones.

Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'pin-init-v6.17' of https://github.com/Rust-for-Linux/linux into rust-next</title>
<updated>2025-07-13T21:05:14+00:00</updated>
<author>
<name>Miguel Ojeda</name>
<email>ojeda@kernel.org</email>
</author>
<published>2025-07-13T21:05:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e8fa0481ea15ba1d40a836fa5dbfc1f49680fba8'/>
<id>urn:sha1:e8fa0481ea15ba1d40a836fa5dbfc1f49680fba8</id>
<content type='text'>
Pull pin-init updates from Benno Lossin:
 "Added:

   - 'impl&lt;T, E&gt; [Pin]Init&lt;T, E&gt; for Result&lt;T, E&gt;', so results are now
     (pin-)initializers.

   - 'Zeroable::init_zeroed()' delegating to 'init_zeroed()'.

   - New 'zeroed()', a safe version of 'mem::zeroed()' and also provide
     it via 'Zeroable::zeroed()'.

   - Implement 'Zeroable' for 'Option&lt;&amp;T&gt;' and 'Option&lt;&amp;mut T&gt;'.

   - Implement 'Zeroable' for 'Option&lt;[unsafe] [extern "abi"]
     fn(...args...) -&gt; ret&gt;' for '"Rust"' and '"C"' ABIs and up to 20
     arguments.

  Changed:

   - Blanket impls of 'Init' and 'PinInit' from 'impl&lt;T, E&gt;
     [Pin]Init&lt;T, E&gt; for T' to 'impl&lt;T&gt; [Pin]Init&lt;T&gt; for T'.

   - Renamed 'zeroed()' to 'init_zeroed()'.

  Upstream dev news:

   - More CI improvements to deny warnings, use '--all-targets'. Also
     check the synchronization status of the two '-next' branches in
     upstream and the kernel."

Acked-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;

* tag 'pin-init-v6.17' of https://github.com/Rust-for-Linux/linux:
  rust: pin-init: examples, tests: use `ignore` instead of conditionally compiling tests
  rust: init: remove doctest's `Error::from_errno` workaround
  rust: init: re-enable doctests
  rust: pin-init: implement `ZeroableOption` for function pointers with up to 20 arguments
  rust: pin-init: change `impl Zeroable for Option&lt;NonNull&lt;T&gt;&gt;` to `ZeroableOption for NonNull&lt;T&gt;`
  rust: pin-init: implement `ZeroableOption` for `&amp;T` and `&amp;mut T`
  rust: pin-init: add `zeroed()` &amp; `Zeroable::zeroed()` functions
  rust: pin-init: add `Zeroable::init_zeroed`
  rust: pin-init: rename `zeroed` to `init_zeroed`
  rust: pin-init: feature-gate the `stack_init_reuse` test on the `std` feature
  rust: pin-init: examples: pthread_mutex: disable the main test for miri
  rust: pin-init: examples, tests: add conditional compilation in order to compile under any feature combination
  rust: pin-init: change blanket impls for `[Pin]Init` and add one for `Result&lt;T, E&gt;`
  rust: pin-init: improve safety documentation for `impl&lt;T&gt; [Pin]Init&lt;T&gt; for T`
</content>
</entry>
</feed>
