Re: [PATCH] rust: kernel: remove support for unused host `#[test]`s

2025-07-29 Thread Danilo Krummrich
st-for-linux/CABVgOS=AKHSfifp0S68K3jgNZAkALBr=7iFb=niryg5wdxj...@mail.gmail.com/ > [1] > Signed-off-by: Miguel Ojeda Nice! This should also allow us to remove the Cmalloc allocator subsequently. Reviewed-by: Danilo Krummrich

Re: [PATCH v14 3/7] rust: introduce module_param module

2025-07-03 Thread Danilo Krummrich
On 7/2/25 3:18 PM, Andreas Hindborg wrote: +/// Get a shared reference to the parameter value. +// Note: When sysfs access to parameters are enabled, we have to pass in a +// held lock guard here. +pub fn get(&self) -> &T { +self.value.as_ref().unwrap_or(&self.default) +

Re: [PATCH v13 5/6] rust: samples: add a module parameter to the rust_minimal sample

2025-06-30 Thread Danilo Krummrich
On 6/30/25 2:18 PM, Danilo Krummrich wrote: On 6/30/25 2:12 PM, Andreas Hindborg wrote: "Danilo Krummrich" writes: (Sorry for being late on this one, just a minor nit below.) On 6/12/25 3:40 PM, Andreas Hindborg wrote:    struct RustMinimal { @@ -20,6 +26,10 @@ impl kernel::

Re: [PATCH v13 5/6] rust: samples: add a module parameter to the rust_minimal sample

2025-06-30 Thread Danilo Krummrich
On 6/30/25 2:12 PM, Andreas Hindborg wrote: "Danilo Krummrich" writes: (Sorry for being late on this one, just a minor nit below.) On 6/12/25 3:40 PM, Andreas Hindborg wrote: struct RustMinimal { @@ -20,6 +26,10 @@ impl kernel::Module for RustMinimal { fn init(_module

Re: [PATCH v13 5/6] rust: samples: add a module parameter to the rust_minimal sample

2025-06-30 Thread Danilo Krummrich
(Sorry for being late on this one, just a minor nit below.) On 6/12/25 3:40 PM, Andreas Hindborg wrote: struct RustMinimal { @@ -20,6 +26,10 @@ impl kernel::Module for RustMinimal { fn init(_module: &'static ThisModule) -> Result { pr_info!("Rust minimal sample (init)\n");

Re: [PATCH 0/7] Rust KUnit `#[test]` support improvements

2025-05-05 Thread Danilo Krummrich
t was lacking from the original submission. > > I hope this helps. It does -- thanks for this series! Acked-by: Danilo Krummrich > rust: str: convert `rusttest` tests into KUnit With that, do we still expose `alloc` primitives to userspace tests?

Re: [PATCH v7 03/16] rust: implement `IdArray`, `IdTable` and `RawDeviceId`

2025-03-15 Thread Danilo Krummrich
On Sat, Mar 15, 2025 at 12:52:27PM -0400, Tamir Duberstein wrote: > On Thu, Dec 19, 2024 at 12:08 PM Danilo Krummrich wrote: > > > > +/// Marker trait to indicate a Rust device ID type represents a > > corresponding C device ID type. > > +/// > > +/// This is

Re: [PATCH v7 07/16] rust: add `io::{Io, IoRaw}` base types

2025-02-28 Thread Danilo Krummrich
On Fri, Feb 28, 2025 at 04:29:04PM +1100, Alistair Popple wrote: > On Thu, Feb 27, 2025 at 11:01:55AM +0100, Danilo Krummrich wrote: > > On Thu, Feb 27, 2025 at 11:25:55AM +1100, Alistair Popple wrote: > > > > To be honest I don't really understand the utility here becau

Re: [PATCH v7 07/16] rust: add `io::{Io, IoRaw}` base types

2025-02-27 Thread Danilo Krummrich
On Thu, Feb 27, 2025 at 11:25:55AM +1100, Alistair Popple wrote: > On Tue, Feb 25, 2025 at 12:04:35PM +0100, Danilo Krummrich wrote: > > On Tue, Feb 25, 2025 at 04:50:05PM +1100, Alistair Popple wrote: > > > I think build_assert() is not widely used yet and, until the situa

Re: [PATCH v7 07/16] rust: add `io::{Io, IoRaw}` base types

2025-02-25 Thread Danilo Krummrich
On Tue, Feb 25, 2025 at 04:50:05PM +1100, Alistair Popple wrote: > Kind of, but given the current state of build_assert's and the impossiblity of > debugging them should we avoid adding them until they can be fixed? If you build the module as built-in the linker gives you some more hints, but I ag

Re: [PATCH v6 07/16] rust: add `io::{Io, IoRaw}` base types

2025-02-02 Thread Danilo Krummrich
Hi Lina, On Mon, Feb 03, 2025 at 06:19:57AM +0900, Asahi Lina wrote: > > > On 12/17/24 1:20 AM, Danilo Krummrich wrote: > > On Thu, Dec 12, 2024 at 05:33:38PM +0100, Danilo Krummrich wrote: > >> +/// IO-mapped memory, starting at the base address @addr and span

Re: [PATCH v7 07/16] rust: add `io::{Io, IoRaw}` base types

2025-01-20 Thread Danilo Krummrich
On 1/16/25 11:31 AM, Fiona Behrens wrote: On 19 Dec 2024, at 18:04, Danilo Krummrich wrote: +impl Io { +/// Converts an `IoRaw` into an `Io` instance, providing the accessors to the MMIO mapping. +/// +/// # Safety +/// +/// Callers must ensure that `addr` is the start of

Re: [PATCH v7 08/16] rust: add devres abstraction

2025-01-14 Thread Danilo Krummrich
On Tue, Jan 14, 2025 at 05:33:45PM +0100, Danilo Krummrich wrote: > > > +impl Drop for Devres { > > > +fn drop(&mut self) { > > > +// Revoke the data, such that it gets dropped already and the > > > actual resource is freed. > > > +

Re: [PATCH v7 08/16] rust: add devres abstraction

2025-01-14 Thread Danilo Krummrich
On Tue, Dec 24, 2024 at 09:53:23PM +, Gary Guo wrote: > On Thu, 19 Dec 2024 18:04:10 +0100 > Danilo Krummrich wrote: > > > Add a Rust abstraction for the kernel's devres (device resource > > management) implementation. > > > > The Devres type acts as

Re: [PATCH v7 08/16] rust: add devres abstraction

2025-01-02 Thread Danilo Krummrich
On Thu, Jan 02, 2025 at 11:30:11AM +0100, Danilo Krummrich wrote: > On Tue, Dec 24, 2024 at 09:53:23PM +, Gary Guo wrote: > > On Thu, 19 Dec 2024 18:04:10 +0100 > > Danilo Krummrich wrote: > > > > > Add a Rust abstraction for the kernel's devre

Re: [PATCH v7 08/16] rust: add devres abstraction

2025-01-02 Thread Danilo Krummrich
On Tue, Dec 24, 2024 at 09:53:23PM +, Gary Guo wrote: > On Thu, 19 Dec 2024 18:04:10 +0100 > Danilo Krummrich wrote: > > > Add a Rust abstraction for the kernel's devres (device resource > > management) implementation. > > > > The Devres type acts as

Re: [PATCH v7 04/16] rust: add rcu abstraction

2025-01-02 Thread Danilo Krummrich
On Tue, Dec 24, 2024 at 08:54:50PM +, Gary Guo wrote: > On Thu, 19 Dec 2024 18:04:06 +0100 > Danilo Krummrich wrote: > > > From: Wedson Almeida Filho > > > > Add a simple abstraction to guard critical code sections with an rcu > > read lock. > > >

Re: [PATCH v7 03/16] rust: implement `IdArray`, `IdTable` and `RawDeviceId`

2025-01-02 Thread Danilo Krummrich
On Tue, Dec 24, 2024 at 08:10:02PM +, Gary Guo wrote: > On Thu, 19 Dec 2024 18:04:05 +0100 > Danilo Krummrich wrote: > > > Most subsystems use some kind of ID to match devices and drivers. Hence, > > we have to provide Rust drivers an abstraction to register an ID table

Re: [PATCH v7 02/16] rust: implement generic driver registration

2025-01-02 Thread Danilo Krummrich
Hi Gary, On Tue, Dec 24, 2024 at 07:58:21PM +, Gary Guo wrote: > On Thu, 19 Dec 2024 18:04:04 +0100 > Danilo Krummrich wrote: > > > Implement the generic `Registration` type and the `RegistrationOps` > > trait. > > > > The `Registration` structure is

[PATCH v7 16/16] MAINTAINERS: add Danilo to DRIVER CORE

2024-12-19 Thread Danilo Krummrich
Let's keep an eye on the Rust abstractions; add myself as reviewer to DRIVER CORE. Signed-off-by: Danilo Krummrich --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index ed4b293b1baa..15c8df5b3590 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7

[PATCH v7 14/16] rust: platform: add basic platform device / driver abstractions

2024-12-19 Thread Danilo Krummrich
` abstraction represents a `struct platform_device`. In order to provide the platform bus specific parts to a generic `driver::Registration` the `driver::RegistrationOps` trait is implemented by `platform::Adapter`. Reviewed-by: Rob Herring (Arm) Signed-off-by: Danilo Krummrich --- MAINTAINERS

[PATCH v7 15/16] samples: rust: add Rust platform sample driver

2024-12-19 Thread Danilo Krummrich
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) Signed-off-by: Danilo Krummrich --- MAINTAINERS

[PATCH v7 12/16] rust: of: add `of::DeviceId` abstraction

2024-12-19 Thread Danilo Krummrich
`of::DeviceId` is an abstraction around `struct of_device_id`. This is used by subsequent patches, in particular the platform bus abstractions, to create OF device ID tables. Reviewed-by: Rob Herring (Arm) Signed-off-by: Danilo Krummrich --- MAINTAINERS| 1 + rust/kernel/lib.rs | 1

[PATCH v7 13/16] rust: driver: implement `Adapter`

2024-12-19 Thread Danilo Krummrich
matching OF or ACPI device IDs and ID table entries. Suggested-by: Rob Herring (Arm) Signed-off-by: Danilo Krummrich --- rust/bindings/bindings_helper.h | 1 + rust/kernel/driver.rs | 58 - 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/rust

[PATCH v7 09/16] rust: pci: add basic PCI device / driver abstractions

2024-12-19 Thread Danilo Krummrich
generic `device_id::RawDevceId` abstraction. Co-developed-by: FUJITA Tomonori Signed-off-by: FUJITA Tomonori Signed-off-by: Danilo Krummrich --- MAINTAINERS | 1 + rust/bindings/bindings_helper.h | 1 + rust/helpers/helpers.c | 1 + rust/helpers/pci.c

[PATCH v7 11/16] samples: rust: add Rust PCI sample driver

2024-12-19 Thread Danilo Krummrich
equence of MMIO operations. Signed-off-by: Danilo Krummrich --- MAINTAINERS | 1 + samples/rust/Kconfig| 11 samples/rust/Makefile | 1 + samples/rust/rust_driver_pci.rs | 110 4 files changed, 123 insertions(

[PATCH v7 10/16] rust: pci: implement I/O mappable `pci::Bar`

2024-12-19 Thread Danilo Krummrich
egion. In case of the latter only runtime checked I/O reads / writes are possible. Co-developed-by: Philipp Stanner Signed-off-by: Philipp Stanner Signed-off-by: Danilo Krummrich --- rust/kernel/pci.rs | 142 - 1 file changed, 141 insertions(+), 1 del

[PATCH v7 07/16] rust: add `io::{Io, IoRaw}` base types

2024-12-19 Thread Danilo Krummrich
e Ryhl Tested-by: Daniel Almeida Reviewed-by: Daniel Almeida Signed-off-by: Danilo Krummrich --- rust/helpers/helpers.c | 1 + rust/helpers/io.c | 101 rust/kernel/io.rs | 260 + rust/kernel/lib.rs | 1 + 4 files changed,

[PATCH v7 08/16] rust: add devres abstraction

2024-12-19 Thread Danilo Krummrich
rs of the Devres abstraction can simply free the corresponding resources in their Drop implementation, which is invoked when either the Devres instance goes out of scope or the devres callback leads to the resource being revoked, which implies a call to drop_in_place(). Signed-off-by: Danilo Krum

[PATCH v7 06/16] rust: add `Revocable` type

2024-12-19 Thread Danilo Krummrich
to existing references (i.e., device context data is ref-counted and has a non-zero refcount after removal of the device). Signed-off-by: Wedson Almeida Filho Co-developed-by: Danilo Krummrich Signed-off-by: Danilo Krummrich --- rust/kernel/lib.rs | 1 + rust/kernel/revocable.rs | 219

[PATCH v7 05/16] rust: types: add `Opaque::pin_init`

2024-12-19 Thread Danilo Krummrich
Analogous to `Opaque::new` add `Opaque::pin_init`, which instead of a value `T` takes a `PinInit` and returns a `PinInit>`. Reviewed-by: Alice Ryhl Suggested-by: Alice Ryhl Signed-off-by: Danilo Krummrich --- rust/kernel/types.rs | 11 +++ 1 file changed, 11 insertions(+) diff --

[PATCH v7 03/16] rust: implement `IdArray`, `IdTable` and `RawDeviceId`

2024-12-19 Thread Danilo Krummrich
-by: Fabien Parent Signed-off-by: Danilo Krummrich --- MAINTAINERS | 1 + rust/kernel/device_id.rs | 165 +++ rust/kernel/lib.rs | 6 ++ 3 files changed, 172 insertions(+) create mode 100644 rust/kernel/device_id.rs diff --git a

[PATCH v7 01/16] rust: module: add trait `ModuleMetadata`

2024-12-19 Thread Danilo Krummrich
In order to access static metadata of a Rust kernel module, add the `ModuleMetadata` trait. In particular, this trait provides the name of a Rust kernel module as specified by the `module!` macro. Signed-off-by: Danilo Krummrich --- rust/kernel/lib.rs| 6 ++ rust/macros/module.rs | 4

[PATCH v7 02/16] rust: implement generic driver registration

2024-12-19 Thread Danilo Krummrich
unregister a driver have to implemented. For instance, the PCI subsystem would call __pci_register_driver() from `RegistrationOps::register` and pci_unregister_driver() from `DrvierOps::unregister`. Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Signed-off-by: Danilo

[PATCH v7 04/16] rust: add rcu abstraction

2024-12-19 Thread Danilo Krummrich
From: Wedson Almeida Filho Add a simple abstraction to guard critical code sections with an rcu read lock. Reviewed-by: Boqun Feng Signed-off-by: Wedson Almeida Filho Co-developed-by: Danilo Krummrich Signed-off-by: Danilo Krummrich --- MAINTAINERS | 1 + rust/helpers

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

2024-12-19 Thread Danilo Krummrich
a const SIZE - increase the total amount of Documentation, rephrase some safety comments and commit messages for less ambiguity - fix compilation issues with some documentation examples Danilo Krummrich (14): rust: module: add trait `ModuleMetadata` rust: implement generic driver registra

Re: [PATCH v6 13/16] rust: driver: implement `Adapter`

2024-12-19 Thread Danilo Krummrich
On Thu, Dec 19, 2024 at 11:53:06AM +0100, Andreas Hindborg wrote: > > Hi Danilo, > > Danilo Krummrich writes: > > > In order to not duplicate code in bus specific implementations (e.g. > > platform), implement a generic `driver::Adapter` to represent the > >

Re: [PATCH v6 15/16] samples: rust: add Rust platform sample driver

2024-12-18 Thread Danilo Krummrich
On Mon, Dec 16, 2024 at 05:43:31PM +0100, Miguel Ojeda wrote: > On Mon, Dec 16, 2024 at 5:31 PM Danilo Krummrich wrote: > > > > Thanks! If nothing else comes up, I'll send you a v7 end of this week > > addressing > > the two minor things I just replied to (

Re: [PATCH v6 06/16] rust: add `Revocable` type

2024-12-18 Thread Danilo Krummrich
On Wed, Dec 18, 2024 at 01:20:20PM +0100, Benoît du Garreau wrote: > On Thu, 12 Dec 2024 17:33:37 +0100 Danilo Krummrich wrote: > > > From: Wedson Almeida Filho > > > > Revocable allows access to objects to be safely revoked at run time. > > > > This i

Re: [PATCH v6 15/16] samples: rust: add Rust platform sample driver

2024-12-16 Thread Danilo Krummrich
On Sun, Dec 15, 2024 at 01:25:45PM +0100, Greg KH wrote: > On Thu, Dec 12, 2024 at 05:33:46PM +0100, Danilo Krummrich wrote: > > Add a sample Rust platform driver illustrating the usage of the platform > > bus abstractions. > > > > This driver probes through either a ma

Re: [PATCH v6 09/16] rust: pci: add basic PCI device / driver abstractions

2024-12-16 Thread Danilo Krummrich
On Sun, Dec 15, 2024 at 01:23:22PM +0100, Greg KH wrote: > On Thu, Dec 12, 2024 at 05:33:40PM +0100, Danilo Krummrich wrote: > > +impl DeviceId { > > +const PCI_ANY_ID: u32 = !0; > > + > > +/// PCI_DEVICE macro. > > +pub const fn new(

Re: [PATCH v6 07/16] rust: add `io::{Io, IoRaw}` base types

2024-12-16 Thread Danilo Krummrich
On Thu, Dec 12, 2024 at 05:33:38PM +0100, Danilo Krummrich wrote: > I/O memory is typically either mapped through direct calls to ioremap() > or subsystem / bus specific ones such as pci_iomap(). > > Even though subsystem / bus specific functions to map I/O memory are > b

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

2024-12-16 Thread Danilo Krummrich
On Fri, Dec 13, 2024 at 08:06:13AM +0100, Dirk Behme wrote: > On 12.12.24 17:33, Danilo Krummrich wrote: > > This patch series implements the necessary Rust abstractions to implement > > device drivers in Rust. > > > > This includes some basic generalizations for dr

[PATCH v6 14/16] rust: platform: add basic platform device / driver abstractions

2024-12-12 Thread Danilo Krummrich
` abstraction represents a `struct platform_device`. In order to provide the platform bus specific parts to a generic `driver::Registration` the `driver::RegistrationOps` trait is implemented by `platform::Adapter`. Reviewed-by: Rob Herring (Arm) Signed-off-by: Danilo Krummrich --- MAINTAINERS

[PATCH v6 15/16] samples: rust: add Rust platform sample driver

2024-12-12 Thread Danilo Krummrich
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) Signed-off-by: Danilo Krummrich --- MAINTAINERS

[PATCH v6 10/16] rust: pci: implement I/O mappable `pci::Bar`

2024-12-12 Thread Danilo Krummrich
egion. In case of the latter only runtime checked I/O reads / writes are possible. Co-developed-by: Philipp Stanner Signed-off-by: Philipp Stanner Signed-off-by: Danilo Krummrich --- rust/kernel/pci.rs | 140 + 1 file changed, 140 insertions(+) diff --

[PATCH v6 11/16] samples: rust: add Rust PCI sample driver

2024-12-12 Thread Danilo Krummrich
equence of MMIO operations. Signed-off-by: Danilo Krummrich --- MAINTAINERS | 1 + samples/rust/Kconfig| 11 samples/rust/Makefile | 1 + samples/rust/rust_driver_pci.rs | 110 4 files changed, 123 insertions(

[PATCH v6 09/16] rust: pci: add basic PCI device / driver abstractions

2024-12-12 Thread Danilo Krummrich
generic `device_id::RawDevceId` abstraction. Co-developed-by: FUJITA Tomonori Signed-off-by: FUJITA Tomonori Signed-off-by: Danilo Krummrich --- MAINTAINERS | 1 + rust/bindings/bindings_helper.h | 1 + rust/helpers/helpers.c | 1 + rust/helpers/pci.c

[PATCH v6 02/16] rust: implement generic driver registration

2024-12-12 Thread Danilo Krummrich
unregister a driver have to implemented. For instance, the PCI subsystem would call __pci_register_driver() from `RegistrationOps::register` and pci_unregister_driver() from `DrvierOps::unregister`. Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Signed-off-by: Danilo

[PATCH v6 16/16] MAINTAINERS: add Danilo to DRIVER CORE

2024-12-12 Thread Danilo Krummrich
Let's keep an eye on the Rust abstractions; add myself as reviewer to DRIVER CORE. Signed-off-by: Danilo Krummrich --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 95bd7dc88ad8..6b9e10551392 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7

[PATCH v6 04/16] rust: add rcu abstraction

2024-12-12 Thread Danilo Krummrich
From: Wedson Almeida Filho Add a simple abstraction to guard critical code sections with an rcu read lock. Reviewed-by: Boqun Feng Signed-off-by: Wedson Almeida Filho Co-developed-by: Danilo Krummrich Signed-off-by: Danilo Krummrich --- MAINTAINERS | 1 + rust/helpers

[PATCH v6 03/16] rust: implement `IdArray`, `IdTable` and `RawDeviceId`

2024-12-12 Thread Danilo Krummrich
-by: Fabien Parent Signed-off-by: Danilo Krummrich --- MAINTAINERS | 1 + rust/kernel/device_id.rs | 165 +++ rust/kernel/lib.rs | 6 ++ 3 files changed, 172 insertions(+) create mode 100644 rust/kernel/device_id.rs diff --git a

[PATCH v6 07/16] rust: add `io::{Io, IoRaw}` base types

2024-12-12 Thread Danilo Krummrich
e Ryhl Tested-by: Daniel Almeida Reviewed-by: Daniel Almeida Signed-off-by: Danilo Krummrich --- rust/helpers/helpers.c | 1 + rust/helpers/io.c | 101 rust/kernel/io.rs | 260 + rust/kernel/lib.rs | 1 + 4 files changed,

[PATCH v6 06/16] rust: add `Revocable` type

2024-12-12 Thread Danilo Krummrich
to existing references (i.e., device context data is ref-counted and has a non-zero refcount after removal of the device). Signed-off-by: Wedson Almeida Filho Co-developed-by: Danilo Krummrich Signed-off-by: Danilo Krummrich --- rust/kernel/lib.rs | 1 + rust/kernel/revocable.rs | 223

[PATCH v6 13/16] rust: driver: implement `Adapter`

2024-12-12 Thread Danilo Krummrich
matching OF or ACPI device IDs and ID table entries. Suggested-by: Rob Herring (Arm) Signed-off-by: Danilo Krummrich --- rust/bindings/bindings_helper.h | 1 + rust/kernel/driver.rs | 59 - 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/rust

[PATCH v6 12/16] rust: of: add `of::DeviceId` abstraction

2024-12-12 Thread Danilo Krummrich
`of::DeviceId` is an abstraction around `struct of_device_id`. This is used by subsequent patches, in particular the platform bus abstractions, to create OF device ID tables. Reviewed-by: Rob Herring (Arm) Signed-off-by: Danilo Krummrich --- MAINTAINERS| 1 + rust/kernel/lib.rs | 1

[PATCH v6 08/16] rust: add devres abstraction

2024-12-12 Thread Danilo Krummrich
rs of the Devres abstraction can simply free the corresponding resources in their Drop implementation, which is invoked when either the Devres instance goes out of scope or the devres callback leads to the resource being revoked, which implies a call to drop_in_place(). Signed-off-by: Danilo Krum

[PATCH v6 05/16] rust: types: add `Opaque::pin_init`

2024-12-12 Thread Danilo Krummrich
Analogous to `Opaque::new` add `Opaque::pin_init`, which instead of a value `T` takes a `PinInit` and returns a `PinInit>`. Suggested-by: Alice Ryhl Signed-off-by: Danilo Krummrich --- rust/kernel/types.rs | 11 +++ 1 file changed, 11 insertions(+) diff --git a/rust/kernel/types.r

[PATCH v6 01/16] rust: module: add trait `ModuleMetadata`

2024-12-12 Thread Danilo Krummrich
In order to access static metadata of a Rust kernel module, add the `ModuleMetadata` trait. In particular, this trait provides the name of a Rust kernel module as specified by the `module!` macro. Signed-off-by: Danilo Krummrich --- rust/kernel/lib.rs| 6 ++ rust/macros/module.rs | 4

[PATCH v6 00/16] Device / Driver PCI / Platform Rust abstractions

2024-12-12 Thread Danilo Krummrich
linux/tree/staging/rust-device [8] https://github.com/Rust-for-Linux/linux/tree/staging/rust-pci [9] https://github.com/Rust-for-Linux/linux/tree/staging/dev Danilo Krummrich (14): rust: module: add trait `ModuleMetadata` rust: implement generic driver registration rust: implement `IdArray`

Re: [PATCH 2/2] net: mdio: support c45 peripherals on c22 busses

2021-04-07 Thread Danilo Krummrich
I somehow missed this mail.. On Mon, Apr 05, 2021 at 10:12:36PM +0100, Russell King - ARM Linux admin wrote: > On Mon, Apr 05, 2021 at 08:58:07PM +0200, Danilo Krummrich wrote: > > On Mon, Apr 05, 2021 at 03:33:55PM +0200, Andrew Lunn wrote: > > However, this was about something

Re: [PATCH 2/2] net: mdio: support c45 peripherals on c22 busses

2021-04-06 Thread Danilo Krummrich
On Tue, Apr 06, 2021 at 12:30:11AM +0200, Danilo Krummrich wrote: > On Mon, Apr 05, 2021 at 09:27:44PM +0200, Andrew Lunn wrote: > > > Now, instead of encoding this information of the bus' capabilities at both > > > places, I'd propose just checking the mii

Re: [PATCH 2/2] net: mdio: support c45 peripherals on c22 busses

2021-04-05 Thread Danilo Krummrich
On Mon, Apr 05, 2021 at 09:27:44PM +0200, Andrew Lunn wrote: > > Now, instead of encoding this information of the bus' capabilities at both > > places, I'd propose just checking the mii_bus->capabilities field in the > > mdiobus_c45_*() functions. IMHO this would be a little cleaner, than having >

Re: [PATCH 2/2] net: mdio: support c45 peripherals on c22 busses

2021-04-05 Thread Danilo Krummrich
On Mon, Apr 05, 2021 at 03:33:55PM +0200, Andrew Lunn wrote: > On Sun, Apr 04, 2021 at 09:23:55PM +0200, Danilo Krummrich wrote: > > So currently every driver should check for the flag MII_ADDR_C45 and report > > an > > error in case it's unsupported. > > > >

Re: [PATCH 2/2] net: mdio: support c45 peripherals on c22 busses

2021-04-04 Thread Danilo Krummrich
On Fri, Apr 02, 2021 at 01:58:58PM +0100, Russell King - ARM Linux admin wrote: > On Fri, Apr 02, 2021 at 03:10:49AM +0200, Danilo Krummrich wrote: > > On Thu, Apr 01, 2021 at 09:48:58AM +0100, Russell King - ARM Linux admin > > wrote: > > > One could also argue this is

Re: [PATCH 2/2] net: mdio: support c45 peripherals on c22 busses

2021-04-04 Thread Danilo Krummrich
On Fri, Apr 02, 2021 at 02:28:54PM +0200, Andrew Lunn wrote: > > > Do you actually have a requirement for this? > > > > > Yes, the Marvell 88Q2112 1000Base-T1 PHY. But actually, I just recognize > > that it > > should be possible to just register it with the compatible string > > "ethernet-phy-iee

Re: [PATCH 2/2] net: mdio: support c45 peripherals on c22 busses

2021-04-01 Thread Danilo Krummrich
On Thu, Apr 01, 2021 at 09:48:58AM +0100, Russell King - ARM Linux admin wrote: > On Thu, Apr 01, 2021 at 03:23:05AM +0200, danilokrummr...@dk-develop.de wrote: > > On 2021-03-31 20:35, Russell King - ARM Linux admin wrote: > > > On Wed, Mar 31, 2021 at 07:58:33PM +0200, danilokrummr...@dk-develop.

net: mdio: support c45 peripherals on c22 only capable mdio controllers

2021-03-31 Thread Danilo Krummrich
This patch series adds support for clause 45 peripherals on busses driven by an mdio controller that is only capable of clause 22 frame format messages by indirect bus accesses. In order to do so we - change the name of the field probe_capabilities to capabilities in struct mii_bus to represent

net: mdio: support c45 peripherals on c22 only capable mdio controllers

2021-03-31 Thread Danilo Krummrich
This patch series adds support for clause 45 peripherals on busses driven by an mdio controller that is only capable of clause 22 frame format messages by indirect bus accesses. In order to do so we - change the name of the field probe_capabilities to capabilities in struct mii_bus to represent

[PATCH 1/2] net: mdio: rename mii bus probe_capabilities

2021-03-31 Thread Danilo Krummrich
Rename the probe_capabilities field of struct mii_bus to capabilities. This field represents the supported frame formats of the mdio controller backing this bus as by IEEE 802.3 in general. This is not specific to the probing procedure of the bus. Signed-off-by: Danilo Krummrich --- drivers

[PATCH 2/2] net: mdio: support c45 peripherals on c22 busses

2021-03-31 Thread Danilo Krummrich
previously and just assumed to be successful. Signed-off-by: Danilo Krummrich --- drivers/net/phy/mdio_bus.c | 265 - drivers/net/phy/phy-core.c | 46 ++- drivers/net/phy/phy.c | 19 ++- include/linux/mdio.h | 36 ++--- 4 files changed, 298 in

Re: [PATCH] Input: ps2-gpio - flush TX work when closing port

2019-02-08 Thread Danilo Krummrich
ix. Acked-by: Danilo Krummrich

Re: [PATCH] Add USB_QUIRK_DELAY_CTRL_MSG quirk for Corsair K70 RGB

2019-01-02 Thread Danilo Krummrich
You're referring to this patch cb88a0588717 ("usb: quirks: add control message delay for 1b1c:1b20") I guess. Maybe you want to name it explicitly for better reference. Acked-by: Danilo Krummrich On 2019-01-02 19:37, Jack Stocker wrote: To match the Corsair Strafe RGB, the

[PATCH resend] vfs: namei: use path_equal() in follow_dotdot()

2018-04-23 Thread Danilo Krummrich
Use path_equal() to detect whether we're already in root. Signed-off-by: Danilo Krummrich --- fs/namei.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 186bd2464fd5..6f0dc40f88c5 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1438,10 +1

[PATCH resend] usb: quirks: add control message delay for 1b1c:1b20

2018-03-06 Thread Danilo Krummrich
istributions. Fixes: de3af5bf259d ("usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard") Cc: sta...@vger.kernel.org Signed-off-by: Danilo Krummrich --- drivers/usb/core/message.c | 4 drivers/usb/core/quirks.c | 3 ++- include/linux/usb/quirks.h | 3 +++ 3 files change

[PATCH v3 2/2] fs/sysctl: remove redundant link check in proc_sys_link_fill_cache()

2018-02-27 Thread Danilo Krummrich
proc_sys_link_fill_cache() does not need to check whether we're called for a link - it's already done by scan(). Acked-by: Kees Cook Signed-off-by: Danilo Krummrich --- v2: removed 'err' as it's only used for sysctl_follow_link() v3: add ack --- fs/proc/proc_sysct

[PATCH v3 1/2] fs/sysctl: fix potential page fault while unregistering sysctl table

2018-02-27 Thread Danilo Krummrich
tween sysctl_table_sets") Cc: sta...@vger.kernel.org Acked-by: Kees Cook Signed-off-by: Danilo Krummrich --- v2: removed empty line between between sysctl_head_grab and IS_ERR v3: extend commit message, add tags and cc stable --- fs/proc/proc_sysctl.c | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH v2 1/2] fs/sysctl: fix potential page fault while unregistering sysctl table

2018-02-27 Thread Danilo Krummrich
proc_sys_link_fill_cache() does not take currently unregistering sysctl tables into account, which might result into a page fault in sysctl_follow_link() - add a check to fix it. Signed-off-by: Danilo Krummrich --- v2: removed empty line between between sysctl_head_grab and IS_ERR --- fs/proc

[PATCH v2 2/2] fs/sysctl: remove redundant link check in proc_sys_link_fill_cache()

2018-02-27 Thread Danilo Krummrich
proc_sys_link_fill_cache() does not need to check whether we're called for a link - it's already done by scan(). Signed-off-by: Danilo Krummrich --- v2: removed 'err' as it's only used for sysctl_follow_link() --- fs/proc/proc_sysctl.c | 9 +++-- 1 file changed, 3 i

Re: [PATCH 1/2] fs/sysctl: fix potential page fault while unregistering sysctl table

2018-02-27 Thread Danilo Krummrich
On 2018-02-28 00:02, Kees Cook wrote: On Tue, Feb 27, 2018 at 2:43 PM, Danilo Krummrich wrote: proc_sys_link_fill_cache() does not take currently unregistering sysctl tables into account, which might result into a page fault in sysctl_follow_link() - add a check to fix it. Signed-off-by

Re: [PATCH 2/2] fs/sysctl: remove redundant link check in proc_sys_link_fill_cache()

2018-02-27 Thread Danilo Krummrich
On 2018-02-27 23:59, Kees Cook wrote: On Tue, Feb 27, 2018 at 2:43 PM, Danilo Krummrich wrote: proc_sys_link_fill_cache() does not need to check whether we're called for a link - it's already done by scan(). Signed-off-by: Danilo Krummrich --- fs/proc/proc_sysctl.c | 11 +

[PATCH 1/2] fs/sysctl: fix potential page fault while unregistering sysctl table

2018-02-27 Thread Danilo Krummrich
proc_sys_link_fill_cache() does not take currently unregistering sysctl tables into account, which might result into a page fault in sysctl_follow_link() - add a check to fix it. Signed-off-by: Danilo Krummrich --- fs/proc/proc_sysctl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs

[PATCH 2/2] fs/sysctl: remove redundant link check in proc_sys_link_fill_cache()

2018-02-27 Thread Danilo Krummrich
proc_sys_link_fill_cache() does not need to check whether we're called for a link - it's already done by scan(). Signed-off-by: Danilo Krummrich --- fs/proc/proc_sysctl.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/proc/proc_sysctl.c

[PATCH] usb: quirks: add control message delay for 1b1c:1b20

2018-02-21 Thread Danilo Krummrich
. 200 boot cycles no more timeouts were seen. Addionaly, keep USB_QUIRK_DELAY_INIT as it turned out to be necessary to have the delay in hub_port_connect() after hub_port_init(). The overall boot time seems not to be influenced by these additional delays, even on fast machines. Signed-off-

[PATCH v2] usb: quirks: add control message delay for 1b1c:1b20

2018-02-21 Thread Danilo Krummrich
. 200 boot cycles no more timeouts were seen. Addionaly, keep USB_QUIRK_DELAY_INIT as it turned out to be necessary to have the delay in hub_port_connect() after hub_port_init(). The overall boot time seems not to be influenced by these additional delays, even on fast machines. Signed-off-by: Dani

Re: [PATCH] Input: ps2-gpio - actually abort probe when connected to sleeping GPIOs

2017-10-24 Thread Danilo Krummrich
On 2017-10-24 01:44, Dmitry Torokhov wrote: We've been missing a goto to the unwind path... Signed-off-by: Dmitry Torokhov --- drivers/input/serio/ps2-gpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/input/serio/ps2-gpio.c b/drivers/input/serio/ps2-gpio.c index b50e3817f3c4

[PATCH v9 2/2] dt-bindings: new binding for ps/2 gpio devices

2017-08-21 Thread Danilo Krummrich
. Signed-off-by: Danilo Krummrich --- .../devicetree/bindings/serio/ps2-gpio.txt | 23 ++ 1 file changed, 23 insertions(+) create mode 100644 Documentation/devicetree/bindings/serio/ps2-gpio.txt diff --git a/Documentation/devicetree/bindings/serio/ps2-gpio.txt b

[PATCH v9 1/2] serio: PS/2 gpio bit banging driver for serio bus

2017-08-21 Thread Danilo Krummrich
. when no USB port is available or using old peripherals is desired as PS/2 controller chips getting rare. This driver was tested on bcm2825 and on Kirin 960 and it worked well together with the atkbd and psmouse driver. Signed-off-by: Danilo Krummrich --- Documentation/gpio/drivers-on-gpio.txt

[PATCH v9 0/2] serio: PS/2 gpio bit banging driver for serio bus

2017-08-21 Thread Danilo Krummrich
pio devices" required property list was not matching the example node. Danilo Krummrich (2): serio: PS/2 gpio bit banging driver for serio bus dt-bindings: new binding for ps/2 gpio devices .../devicetree/bindings/serio/ps2-gpio.txt | 23 ++ Documentation/gpio/dri

[PATCH v8 2/2] dt-bindings: new binding for ps/2 gpio devices

2017-08-21 Thread Danilo Krummrich
. Signed-off-by: Danilo Krummrich --- .../devicetree/bindings/serio/ps2-gpio.txt | 22 ++ 1 file changed, 22 insertions(+) create mode 100644 Documentation/devicetree/bindings/serio/ps2-gpio.txt diff --git a/Documentation/devicetree/bindings/serio/ps2-gpio.txt b

[PATCH v8 1/2] serio: PS/2 gpio bit banging driver for serio bus

2017-08-21 Thread Danilo Krummrich
. when no USB port is available or using old peripherals is desired as PS/2 controller chips getting rare. This driver was tested on bcm2825 and on Kirin 960 and it worked well together with the atkbd and psmouse driver. Signed-off-by: Danilo Krummrich --- Documentation/gpio/drivers-on-gpio.txt

[PATCH v8 0/2] serio: PS/2 gpio bit banging driver for serio bus

2017-08-21 Thread Danilo Krummrich
still happens sometimes that the timing can· not be reached of course. v6: - fixed typos - use of_match_ptr v7: remove unnecessary barriers v8: - split patch to have a separate one for the dt binding - remove ps2-gpio prefix in binding Danilo Krummrich (2): serio: PS/2 gpio bit banging

Re: [PATCH v7] serio: PS/2 gpio bit banging driver for serio bus

2017-08-17 Thread Danilo Krummrich
Hi Bob, thanks for reviewing. On 2017-08-17 17:43, Rob Herring wrote: On Fri, Aug 11, 2017 at 03:17:36PM +0200, Danilo Krummrich wrote: This driver provides PS/2 serio bus support by implementing bit banging with the GPIO API. The GPIO pins, data and clock, can be configured with a node in

Re: [PATCH] serio: PS2 gpio bit banging driver for the serio bus

2017-08-17 Thread Danilo Krummrich
On 2017-08-17 15:01, Russell King - ARM Linux wrote: On Thu, Aug 17, 2017 at 12:51:33PM +0200, Danilo Krummrich wrote: That having the correct execution order is not enough on some buses because of buffering is really something to be aware of, thanks again for pointing this out. PCI

Re: [PATCH] serio: PS2 gpio bit banging driver for the serio bus

2017-08-17 Thread Danilo Krummrich
On 2017-08-17 11:09, Russell King - ARM Linux wrote: On Fri, Aug 11, 2017 at 11:16:20AM +0200, Linus Walleij wrote: writel() should be guaranteeing that the values hit the hardware, wmb() is spelled out "write memory barrier" I don't see what you're after here. Incorrect. writel() has a barr

Re: [PATCH] usb: gadget: udc: udc_stop before gadget unbind

2017-08-15 Thread Danilo Krummrich
On 2017-08-15 14:02, Felipe Balbi wrote: Hi, Danilo Krummrich writes: thanks for reviewing. np :-) On 2017-08-15 12:03, Felipe Balbi wrote: Hi, Danilo Krummrich writes: udc_stop needs to be called before gadget driver unbind. Otherwise it might happen that udc drivers still call into

Re: [PATCH] usb: gadget: udc: udc_stop before gadget unbind

2017-08-15 Thread Danilo Krummrich
Hi, thanks for reviewing. On 2017-08-15 12:03, Felipe Balbi wrote: Hi, Danilo Krummrich writes: udc_stop needs to be called before gadget driver unbind. Otherwise it might happen that udc drivers still call into the gadget driver (e.g. to reset gadget after OTG event). If this happens it is

[PATCH] usb: gadget: udc: udc_stop before gadget unbind

2017-08-14 Thread Danilo Krummrich
LL on unbind. Signed-off-by: Danilo Krummrich --- Actually there could still be a race: (CPU1 code taken from dwc3 drivers dwc3_disconnect_gadget() as exsample) CPU0CPU1 usb_gadget_disconnect(udc->gadget); udc

[PATCH v7] serio: PS/2 gpio bit banging driver for serio bus

2017-08-11 Thread Danilo Krummrich
. when no USB port is available or using old peripherals is desired as PS/2 controller chips getting rare. This driver was tested on RPI1 and on Hikey960 and it worked well together with the atkbd and psmouse driver. Signed-off-by: Danilo Krummrich --- v2: Removed one verbose print statement

[PATCH] serio: PS/2 gpio bit banging driver for serio bus

2017-08-11 Thread Danilo Krummrich
. when no USB port is available or using old peripherals is desired as PS/2 controller chips getting rare. This driver was tested on RPI1 and on Hikey960 and it worked well together with the atkbd and psmouse driver. Signed-off-by: Danilo Krummrich --- v2: Removed one verbose print statement

  1   2   >