[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <BE595E8E-CB77-4E8B-B6EF-215CCAF5580A@collabora.com>
Date: Tue, 4 Mar 2025 13:48:30 -0300
From: Daniel Almeida <daniel.almeida@...labora.com>
To: Andreas Hindborg <a.hindborg@...nel.org>
Cc: ojeda@...nel.org,
alex.gaynor@...il.com,
boqun.feng@...il.com,
gary@...yguo.net,
bjorn3_gh@...tonmail.com,
benno.lossin@...ton.me,
tmgross@...ch.edu,
rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org,
Alice Ryhl <aliceryhl@...gle.com>
Subject: Re: [PATCH v2] rust: irq: add support for request_irq()
Hi Andreas,
I will address your other comments later this week, as I’m off for a few days.
> On 4 Mar 2025, at 10:43, Andreas Hindborg <a.hindborg@...nel.org> wrote:
>
> "Daniel Almeida" <daniel.almeida@...labora.com> writes:
>
>> Add support for registering IRQ handlers in Rust.
>>
>> IRQ handlers are extensively used in drivers when some peripheral wants to
>> obtain the CPU attention. Registering a handler will make the system invoke the
>> passed-in function whenever the chosen IRQ line is triggered.
>>
>> Both regular and threaded IRQ handlers are supported through a Handler (or
>> ThreadedHandler) trait that is meant to be implemented by a type that:
>>
>> a) provides a function to be run by the system when the IRQ fires and,
>>
>> b) holds the shared data (i.e.: `T`) between process and IRQ contexts.
>>
>> The requirement that T is Sync derives from the fact that handlers might run
>> concurrently with other processes executing the same driver, creating the
>> potential for data races.
>>
>> Ideally, some interior mutability must be in place if T is to be mutated. This
>> should usually be done through the in-flight SpinLockIrq type.
>>
>> Co-developed-by: Alice Ryhl <aliceryhl@...gle.com>
>> Signed-off-by: Alice Ryhl <aliceryhl@...gle.com>
>> Signed-off-by: Daniel Almeida <daniel.almeida@...labora.com>
>
> What is the base commit to apply this patch to? I am getting some
> compiler errors when trying it out:
>
> error[E0308]: mismatched types
> --> /home/aeh/src/linux-rust/linux/rust/kernel/irq/request.rs:240:21
> |
> 237 | bindings::request_irq(
> | --------------------- arguments to this function are incorrect
> ...
> 240 | flags.0,
> | ^^^^^^^ expected `usize`, found `u64`
> |
>
> [...]
This patch needs a rebase. I’ve been waiting for Lyude & Boqun
new SpinLockIrq series, which just came out last week.
I’ll work on a v3 soon.
Powered by blists - more mailing lists