When working with a bus device, many operations are only possible while
the device is still bound. The &Device<Bound> type represents a proof in
the type system that you are in a scope where the device is guaranteed
to still be bound. Since we deregister irq callbacks when unbinding a
device, if an irq callback is running, that implies that the device has
not yet been unbound.
To allow drivers to take advantage of that, add an additional argument
to irq callbacks.
Signed-off-by: Alice Ryhl <[email protected]>
Reviewed-by: Boqun Feng <[email protected]>
Signed-off-by: Daniel Almeida <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Danilo Krummrich <[email protected]>
These accessors can be used to retrieve a irq::Registration and
irq::ThreadedRegistration from a platform device by
index or name. Alternatively, drivers can retrieve an IrqRequest from a
bound platform device for later use.
These accessors ensure that only valid IRQ lines can ever be registered.
Reviewed-by: Alice Ryhl <[email protected]>
Tested-by: Joel Fernandes <[email protected]>
Tested-by: Dirk Behme <[email protected]>
Signed-off-by: Daniel Almeida <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Remove expect(dead_code) from IrqRequest::new(), re-format macros and
macro invocations to not exceed 100 characters line length. - Danilo ]
Signed-off-by: Danilo Krummrich <[email protected]>
This patch adds support for threaded IRQs and handlers through
irq::ThreadedRegistration and the irq::ThreadedHandler trait.
Threaded interrupts are more permissive in the sense that further
processing is possible in a kthread. This means that said execution takes
place outside of interrupt context, which is rather restrictive in many
ways.
Registering a threaded irq is dependent upon having an IrqRequest that
was previously allocated by a given device. This will be introduced in
subsequent patches.
Tested-by: Joel Fernandes <[email protected]>
Tested-by: Dirk Behme <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Signed-off-by: Daniel Almeida <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Add now available intra-doc links back in. - Danilo ]
Signed-off-by: Danilo Krummrich <[email protected]>
This patch adds support for non-threaded IRQs and handlers through
irq::Registration and the irq::Handler trait.
Registering an irq is dependent upon having a IrqRequest that was
previously allocated by a given device. This will be introduced in
subsequent patches.
Tested-by: Joel Fernandes <[email protected]>
Tested-by: Dirk Behme <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Signed-off-by: Daniel Almeida <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Remove expect(dead_code) from Flags::into_inner(), add
expect(dead_code) to IrqRequest::new(), fix intra-doc links. - Danilo ]
Signed-off-by: Danilo Krummrich <[email protected]>
Manipulating IRQ flags (i.e.: IRQF_*) will soon be necessary, specially to
register IRQ handlers through bindings::request_irq().
Add a kernel::irq::Flags for that purpose.
Reviewed-by: Alice Ryhl <[email protected]>
Tested-by: Joel Fernandes <[email protected]>
Tested-by: Dirk Behme <[email protected]>
Signed-off-by: Daniel Almeida <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Use expect(dead_code) for into_inner(), fix broken intra-doc link and
typo. - Danilo ]
Signed-off-by: Danilo Krummrich <[email protected]>