Re: [PATCH v7 00/16] Device / Driver PCI / Platform Rust abstractions

Greg KH
2024-12-20T16:44:35Z

On Thu, Dec 19, 2024 at 06:04:02PM +0100, Danilo Krummrich wrote:
> This patch series implements the necessary Rust abstractions to implement
> device drivers in Rust.
>
> This includes some basic generalizations for driver registration, handling of ID
> tables, MMIO operations and device resource handling.
>
> Those generalizations are used to implement device driver support for two
> busses, the PCI and platform bus (with OF IDs) in order to provide some evidence
> that the generalizations work as intended.
>
> The patch series also includes two patches adding two driver samples, one PCI
> driver and one platform driver.
>
> The PCI bits are motivated by the Nova driver project [1], but are used by at
> least one more OOT driver (rnvme [2]).
>
> The platform bits, besides adding some more evidence to the base abstractions,
> are required by a few more OOT drivers aiming at going upstream, i.e. rvkms [3],
> cpufreq-dt [4], asahi [5] and the i2c work from Fabien [6].
>
> The patches of this series can also be [7], [8] and [9].
>
> Changes in v7:
> ==============
> - Revocable:
> - replace `compare_exchange` with `swap`
>
> - Driver:
> - fix warning when CONFIG_OF=n
>
> - I/O:
> - remove unnecessary return statement in rust_helper_iounmap()
> - fix cast in doctest for `bindings::ioremap`
>
> - Devres:
> - fix cast in doctest for `bindings::ioremap`
>
> - PCI:
> - remove `Deref` of `pci::DeviceId`
> - rename `DeviceId` constructors
> - `new` -> `from_id`
> - `with_class -> `from_class`
>
> - MISC:
> - use `kernel::ffi::c_*` instead of `core::ffi::c_*`
> - rebase onto latest rust-next (0c5928deada15a8d075516e6e0d9ee19011bb000)

Thanks for this last round of changes, looks great to me! I've added
them all to my driver-core-testing branch, and if 0-day doesn't
complain, will move it to driver-core-next for merging into 6.14-rc1.

Thanks for persisting with this, looks great. Now the real work starts :)

thanks,

greg k-h