mirror-linux/drivers
Linus Torvalds 4e82c87058 Rust changes for v6.15
Toolchain and infrastructure:
 
  - Extract the 'pin-init' API from the 'kernel' crate and make it into
    a standalone crate.
 
    In order to do this, the contents are rearranged so that they can
    easily be kept in sync with the version maintained out-of-tree that
    other projects have started to use too (or plan to, like QEMU).
 
    This will reduce the maintenance burden for Benno, who will now have
    his own sub-tree, and will simplify future expected changes like the
    move to use 'syn' to simplify the implementation.
 
  - Add '#[test]'-like support based on KUnit.
 
    We already had doctests support based on KUnit, which takes the
    examples in our Rust documentation and runs them under KUnit.
 
    Now, we are adding the beginning of the support for "normal" tests,
    similar to those the '#[test]' tests in userspace Rust. For instance:
 
        #[kunit_tests(my_suite)]
        mod tests {
            #[test]
            fn my_test() {
                assert_eq!(1 + 1, 2);
            }
        }
 
    Unlike with doctests, the 'assert*!'s do not map to the KUnit
    assertion APIs yet.
 
  - Check Rust signatures at compile time for functions called from C by
    name.
 
    In particular, introduce a new '#[export]' macro that can be placed
    in the Rust function definition. It will ensure that the function
    declaration on the C side matches the signature on the Rust function:
 
        #[export]
        pub unsafe extern "C" fn my_function(a: u8, b: i32) -> usize {
            // ...
        }
 
    The macro essentially forces the compiler to compare the types of
    the actual Rust function and the 'bindgen'-processed C signature.
 
    These cases are rare so far. In the future, we may consider
    introducing another tool, 'cbindgen', to generate C headers
    automatically. Even then, having these functions explicitly marked
    may be a good idea anyway.
 
  - Enable the 'raw_ref_op' Rust feature: it is already stable, and
    allows us to use the new '&raw' syntax, avoiding a couple macros.
    After everyone has migrated, we will disallow the macros.
 
  - Pass the correct target to 'bindgen' on Usermode Linux.
 
  - Fix 'rusttest' build in macOS.
 
 'kernel' crate:
 
  - New 'hrtimer' module: add support for setting up intrusive timers
    without allocating when starting the timer. Add support for
    'Pin<Box<_>>', 'Arc<_>', 'Pin<&_>' and 'Pin<&mut _>' as pointer types
    for use with timer callbacks. Add support for setting clock source
    and timer mode.
 
  - New 'dma' module: add a simple DMA coherent allocator abstraction and
    a test sample driver.
 
  - 'list' module: make the linked list 'Cursor' point between elements,
    rather than at an element, which is more convenient to us and allows
    for cursors to empty lists; and document it with examples of how to
    perform common operations with the provided methods.
 
  - 'str' module: implement a few traits for 'BStr' as well as the
    'strip_prefix()' method.
 
  - 'sync' module: add 'Arc::as_ptr'.
 
  - 'alloc' module: add 'Box::into_pin'.
 
  - 'error' module: extend the 'Result' documentation, including a few
    examples on different ways of handling errors, a warning about using
    methods that may panic, and links to external documentation.
 
 'macros' crate:
 
   - 'module' macro: add the 'authors' key to support multiple authors.
     The original key will be kept until everyone has migrated.
 
 Documentation:
 
  - Add error handling sections.
 
 MAINTAINERS:
 
  - Add Danilo Krummrich as reviewer of the Rust "subsystem".
 
  - Add 'RUST [PIN-INIT]' entry with Benno Lossin as maintainer. It has
    its own sub-tree.
 
  - Add sub-tree for 'RUST [ALLOC]'.
 
  - Add 'DMA MAPPING HELPERS DEVICE DRIVER API [RUST]' entry with Abdiel
    Janulgue as primary maintainer. It will go through the sub-tree of
    the 'RUST [ALLOC]' entry.
 
  - Add 'HIGH-RESOLUTION TIMERS [RUST]' entry with Andreas Hindborg as
    maintainer. It has its own sub-tree.
 
 And a few other cleanups and improvements.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPjU5OPd5QIZ9jqqOGXyLc2htIW0FAmfpQgAACgkQGXyLc2ht
 IW35CQ//VOIFKtG6qgHVMIxrmpT7YFsrAU41h+cHT2lzy5KiTqSYlCgd18SJ+Iyy
 vi1ylfdyqOpH5EoO+opPN2H4E+VUlRJg7BkZrT4p1lgGDEKg1mtR/825TxquLNFM
 A653f3FvK/scMb6X43kWNKGK/jnxlfxBGmUwIY4/p7+adIuZzXnNbPkV9XYGLx3r
 8KIBKJ9gM52eXoCoF8XJpg6Vg/0rYWIet32OzYF0PvzSAOqUlH4keu15jeUo+59V
 tgCzAkc2yV3oSo721KYlpPeCPKI5iVCzIcwT0n8fqraXtgGnaFPe5XF16U9Qvrjv
 vRp5/dePAHwsOcj5ErzOgLMqGa1sqY76lxDI05PNcBJ8fBAhNEV/rpCTXs/wRagQ
 xUZOdsQyEn0V/BOtV+dnwu410dElEeJdOAeojSYFm1gUay43a0e6yIboxn3Ylnfx
 8jONSokZ/UFHX3wOFNqHeXsY+REB8Qq8OZXjNBZVFpKHNsICWA0G3BcCRnB1815k
 0v7seSdrST78EJ/A5nM0a9gghuLzYgAN04SDx0FzKjb2mHs3PiVfXDvrNMCJ0pBW
 zbF9RlvszKZStY5tpxdZ5Zh+f7rfYcnJHYhNpoP7DJr136iWP+NnHbk1lK6+o4WY
 lPVdMMgUSUlEXIHgK2ebcb/I1KBrDYiPktmvKAFLrH3qVzhkLAU=
 =PCxf
 -----END PGP SIGNATURE-----

Merge tag 'rust-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux

Pull Rust updates from Miguel Ojeda:
 "Toolchain and infrastructure:

   - Extract the 'pin-init' API from the 'kernel' crate and make it into
     a standalone crate.

     In order to do this, the contents are rearranged so that they can
     easily be kept in sync with the version maintained out-of-tree that
     other projects have started to use too (or plan to, like QEMU).

     This will reduce the maintenance burden for Benno, who will now
     have his own sub-tree, and will simplify future expected changes
     like the move to use 'syn' to simplify the implementation.

   - Add '#[test]'-like support based on KUnit.

     We already had doctests support based on KUnit, which takes the
     examples in our Rust documentation and runs them under KUnit.

     Now, we are adding the beginning of the support for "normal" tests,
     similar to those the '#[test]' tests in userspace Rust. For
     instance:

         #[kunit_tests(my_suite)]
         mod tests {
             #[test]
             fn my_test() {
                 assert_eq!(1 + 1, 2);
             }
         }

     Unlike with doctests, the 'assert*!'s do not map to the KUnit
     assertion APIs yet.

   - Check Rust signatures at compile time for functions called from C
     by name.

     In particular, introduce a new '#[export]' macro that can be placed
     in the Rust function definition. It will ensure that the function
     declaration on the C side matches the signature on the Rust
     function:

         #[export]
         pub unsafe extern "C" fn my_function(a: u8, b: i32) -> usize {
             // ...
         }

     The macro essentially forces the compiler to compare the types of
     the actual Rust function and the 'bindgen'-processed C signature.

     These cases are rare so far. In the future, we may consider
     introducing another tool, 'cbindgen', to generate C headers
     automatically. Even then, having these functions explicitly marked
     may be a good idea anyway.

   - Enable the 'raw_ref_op' Rust feature: it is already stable, and
     allows us to use the new '&raw' syntax, avoiding a couple macros.
     After everyone has migrated, we will disallow the macros.

   - Pass the correct target to 'bindgen' on Usermode Linux.

   - Fix 'rusttest' build in macOS.

  'kernel' crate:

   - New 'hrtimer' module: add support for setting up intrusive timers
     without allocating when starting the timer. Add support for
     'Pin<Box<_>>', 'Arc<_>', 'Pin<&_>' and 'Pin<&mut _>' as pointer
     types for use with timer callbacks. Add support for setting clock
     source and timer mode.

   - New 'dma' module: add a simple DMA coherent allocator abstraction
     and a test sample driver.

   - 'list' module: make the linked list 'Cursor' point between
     elements, rather than at an element, which is more convenient to us
     and allows for cursors to empty lists; and document it with
     examples of how to perform common operations with the provided
     methods.

   - 'str' module: implement a few traits for 'BStr' as well as the
     'strip_prefix()' method.

   - 'sync' module: add 'Arc::as_ptr'.

   - 'alloc' module: add 'Box::into_pin'.

   - 'error' module: extend the 'Result' documentation, including a few
     examples on different ways of handling errors, a warning about
     using methods that may panic, and links to external documentation.

  'macros' crate:

   - 'module' macro: add the 'authors' key to support multiple authors.
     The original key will be kept until everyone has migrated.

  Documentation:

   - Add error handling sections.

  MAINTAINERS:

   - Add Danilo Krummrich as reviewer of the Rust "subsystem".

   - Add 'RUST [PIN-INIT]' entry with Benno Lossin as maintainer. It has
     its own sub-tree.

   - Add sub-tree for 'RUST [ALLOC]'.

   - Add 'DMA MAPPING HELPERS DEVICE DRIVER API [RUST]' entry with
     Abdiel Janulgue as primary maintainer. It will go through the
     sub-tree of the 'RUST [ALLOC]' entry.

   - Add 'HIGH-RESOLUTION TIMERS [RUST]' entry with Andreas Hindborg as
     maintainer. It has its own sub-tree.

  And a few other cleanups and improvements"

* tag 'rust-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux: (71 commits)
  rust: dma: add `Send` implementation for `CoherentAllocation`
  rust: macros: fix `make rusttest` build on macOS
  rust: block: refactor to use `&raw mut`
  rust: enable `raw_ref_op` feature
  rust: uaccess: name the correct function
  rust: rbtree: fix comments referring to Box instead of KBox
  rust: hrtimer: add maintainer entry
  rust: hrtimer: add clocksource selection through `ClockId`
  rust: hrtimer: add `HrTimerMode`
  rust: hrtimer: implement `HrTimerPointer` for `Pin<Box<T>>`
  rust: alloc: add `Box::into_pin`
  rust: hrtimer: implement `UnsafeHrTimerPointer` for `Pin<&mut T>`
  rust: hrtimer: implement `UnsafeHrTimerPointer` for `Pin<&T>`
  rust: hrtimer: add `hrtimer::ScopedHrTimerPointer`
  rust: hrtimer: add `UnsafeHrTimerPointer`
  rust: hrtimer: allow timer restart from timer handler
  rust: str: implement `strip_prefix` for `BStr`
  rust: str: implement `AsRef<BStr>` for `[u8]` and `BStr`
  rust: str: implement `Index` for `BStr`
  rust: str: implement `PartialEq` for `BStr`
  ...
2025-03-30 17:03:26 -07:00
..
accel drm for 6.15-rc1 2025-03-28 17:44:52 -07:00
accessibility
acpi Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
amba iommu: Get DT/ACPI parsing into the proper probe path 2025-03-11 14:05:43 +01:00
android
ata ata changes for 6.15 2025-03-26 19:49:02 -07:00
atm
auxdisplay auxdisplay: hd44780: Rename hd to hdc in hd44780_common_alloc() 2025-03-10 18:03:02 +02:00
base regmap: Updates for v6.15 2025-03-29 14:31:39 -07:00
bcma
block Rust changes for v6.15 2025-03-30 17:03:26 -07:00
bluetooth Bluetooth: btnxpuart: Fix kernel panic during FW release 2025-03-25 15:22:17 -04:00
bus drm for 6.15-rc1 2025-03-28 17:44:52 -07:00
cache
cdrom
cdx Merge branches 'apple/dart', 'arm/smmu/updates', 'arm/smmu/bindings', 'rockchip', 's390', 'core', 'intel/vt-d' and 'amd/amd-vi' into next 2025-03-20 09:11:09 +01:00
char This update includes the following changes: 2025-03-29 10:01:55 -07:00
clk Here's the pile of clk driver patches. The usual suspects^Wsilicon 2025-03-29 17:23:34 -07:00
clocksource Added support for multi-cluster configuration 2025-03-29 12:47:09 -07:00
comedi
connector
counter
cpufreq powerpc updates for 6.15 2025-03-27 19:39:08 -07:00
cpuidle pmdomain core: 2025-03-25 20:40:51 -07:00
crypto This update includes the following changes: 2025-03-29 10:01:55 -07:00
cxl cxl: Add support to handle user feature commands for set feature 2025-03-17 14:41:37 -03:00
dax
dca
devfreq
dio
dma
dma-buf
dpll Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-03-20 21:38:01 +01:00
edac - Add infrastructure support to EDAC in order to be able to register memory 2025-03-25 14:00:26 -07:00
eisa
extcon
firewire
firmware EFI updates for v6.15 2025-03-29 11:36:19 -07:00
fpga
fsi
fwctl pds_fwctl: add rpc and query support 2025-03-21 20:57:55 -03:00
gnss
gpio Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
gpu Rust changes for v6.15 2025-03-30 17:03:26 -07:00
greybus
hid Merge branch 'for-6.15/wacom' into for-linus 2025-03-26 13:56:38 +01:00
hsi
hte
hv hyperv-next for 6.15 2025-03-25 14:47:04 -07:00
hwmon platform-drivers-x86 for v6.15-1 2025-03-26 09:54:40 -07:00
hwspinlock hwspinlock: Remove unused hwspin_lock_get_id() 2025-03-21 17:12:04 -05:00
hwtracing ARM: 2025-03-25 14:22:07 -07:00
i2c A treewide hrtimer timer cleanup 2025-03-25 10:54:15 -07:00
i3c
idle Power management updates for 6.15-rc1 2025-03-25 15:00:18 -07:00
iio Pin control changes for the v6.15 kernel cycle: 2025-03-29 16:59:16 -07:00
infiniband RDMA v6.15 merge window pull request 2025-03-29 11:12:28 -07:00
input Pin control changes for the v6.15 kernel cycle: 2025-03-29 16:59:16 -07:00
interconnect
iommu IOMMU Updates for Linux v6.15 2025-03-26 20:10:09 -07:00
ipack
irqchip pci-v6.15-changes 2025-03-28 19:36:53 -07:00
isdn
leds * pca955x: Add HW blink support, utilizing PWM0. It supports one frequency 2025-03-29 14:42:59 -07:00
macintosh
mailbox misc: Constify amba_id table 2025-03-29 18:25:34 -07:00
mcb
md for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
media drm for 6.15-rc1 2025-03-28 17:44:52 -07:00
memory soc: driver updates for 6.15, part 1 2025-03-27 09:05:55 -07:00
memstick for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
message SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
mfd * Maxim MAX77705: 2025-03-29 14:33:13 -07:00
misc pci-v6.15-changes 2025-03-28 19:36:53 -07:00
mmc soc: driver updates for 6.15, part 1 2025-03-27 09:05:55 -07:00
most
mtd for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
mux
net Rust changes for v6.15 2025-03-30 17:03:26 -07:00
nfc
ntb Revert "Merge tag 'irq-msi-2025-03-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip" 2025-03-28 11:22:54 -07:00
nubus
nvdimm badblocks: use sector_t instead of int to avoid truncation of badblocks length 2025-03-06 08:04:52 -07:00
nvme soc: driver updates for 6.15, part 1 2025-03-27 09:05:55 -07:00
nvmem net, treewide: define and use MAC_ADDR_STR_LEN 2025-03-19 19:17:58 +01:00
of Devicetree for v6.15: 2025-03-29 11:23:16 -07:00
opp
parisc parisc: led: Use scnprintf() to avoid string truncation warning 2025-03-09 22:27:54 +01:00
parport
pci pci-v6.15-changes 2025-03-28 19:36:53 -07:00
pcmcia
peci
perf pci-v6.15-changes 2025-03-28 19:36:53 -07:00
phy
pinctrl Pin control changes for the v6.15 kernel cycle: 2025-03-29 16:59:16 -07:00
platform platform-drivers-x86 for v6.15-1 2025-03-26 09:54:40 -07:00
pmdomain pmdomain: arm: scmi_pm_domain: Remove redundant state verification 2025-03-17 11:12:01 +01:00
pnp PNP: Remove prehistoric deadcode 2025-03-12 20:37:56 +01:00
power power supply and reset changes for the 6.15 series 2025-03-29 18:11:12 -07:00
powercap Power management updates for 6.15-rc1 2025-03-25 15:00:18 -07:00
pps
ps3
ptp ptp: ocp: reject unsupported periodic output flags 2025-03-20 08:50:03 +01:00
pwm Pin control changes for the v6.15 kernel cycle: 2025-03-29 16:59:16 -07:00
rapidio rapidio: add check for rio_add_net() in rio_scan_alloc_net() 2025-03-05 21:36:19 -08:00
ras
regulator * Maxim MAX77705: 2025-03-29 14:33:13 -07:00
remoteproc remoteproc: qcom_q6v5_pas: Make single-PD handling more robust 2025-03-22 08:42:39 -05:00
reset remoteproc updates for v6.15 2025-03-29 17:18:50 -07:00
rpmsg
rtc
s390 s390 updates for 6.15 merge window 2025-03-29 11:59:43 -07:00
sbus
scsi SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
sh sh: remove duplicate ioread/iowrite helpers 2025-03-11 10:41:18 +01:00
siox
slimbus
soc Revert "Merge tag 'irq-msi-2025-03-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip" 2025-03-28 11:22:54 -07:00
soundwire
spi spi: Updates for v6.15 2025-03-25 19:28:14 -07:00
spmi
ssb
staging drm for 6.15-rc1 2025-03-28 17:44:52 -07:00
target SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
tc
tee
thermal Thermal control updates for 6.15-rc1 2025-03-25 15:13:31 -07:00
thunderbolt CRC updates for 6.15 2025-03-25 18:33:04 -07:00
tty s390 updates for 6.15 merge window 2025-03-29 11:59:43 -07:00
ufs Revert "Merge tag 'irq-msi-2025-03-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip" 2025-03-28 11:22:54 -07:00
uio
usb SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
vdpa
vfio pci-v6.15-changes 2025-03-28 19:36:53 -07:00
vhost
video * Apple DWI Backlight: 2025-03-29 14:48:33 -07:00
virt Linux 6.14-rc7 2025-03-19 11:03:06 +01:00
virtio
w1
watchdog s390 updates for 6.15 merge window 2025-03-29 11:59:43 -07:00
xen xen/pci: Do not register devices with segments >= 0x10000 2025-03-21 08:15:26 +01:00
zorro
Kconfig fwctl: Add basic structure for a class subsystem with a cdev 2025-03-06 15:11:30 -04:00
Makefile fwctl: Add basic structure for a class subsystem with a cdev 2025-03-06 15:11:30 -04:00