* Re: [PATCH 1/3] max3100: added raise_threaded_irq
[not found] ` <1268987934-22690-1-git-send-email-chripell@fsfe.org>
@ 2010-03-19 17:48 ` Grant Likely
2010-03-21 7:31 ` christian pellegrin
0 siblings, 1 reply; 2+ messages in thread
From: Grant Likely @ 2010-03-19 17:48 UTC (permalink / raw)
To: Christian Pellegrin
Cc: feng.tang, akpm, greg, david-b, alan, spi-devel-general,
linux-serial, Thomas Gleixner, Ingo Molnar,
Linux Kernel Mailing List
On Fri, Mar 19, 2010 at 2:38 AM, Christian Pellegrin <chripell@fsfe.org> wrote:
> raise_threaded_irq schedules the execution of an interrupt thread
>
> Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
You should cc: Thomas and Ingo and lkml (which I just did) on patches
to the threaded interrupt code.
g.
> ---
> include/linux/interrupt.h | 3 +++
> kernel/irq/manage.c | 27 +++++++++++++++++++++++++++
> 2 files changed, 30 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
> index 75f3f00..14c0c13 100644
> --- a/include/linux/interrupt.h
> +++ b/include/linux/interrupt.h
> @@ -144,6 +144,9 @@ request_threaded_irq(unsigned int irq, irq_handler_t handler,
> static inline void exit_irq_thread(void) { }
> #endif
>
> +extern int raise_threaded_irq(unsigned int irq);
> +
> +
> extern void free_irq(unsigned int, void *);
>
> struct device;
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index eb6078c..a7d21e0 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -1088,3 +1088,30 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,
> return retval;
> }
> EXPORT_SYMBOL(request_threaded_irq);
> +
> +/**
> + * raise_threaded_irq - triggers a threded interrupt
> + * @irq: Interrupt line to trigger
> + */
> +int raise_threaded_irq(unsigned int irq)
> +{
> + struct irq_desc *desc = irq_to_desc(irq);
> + struct irqaction *action;
> +
> + if (!desc)
> + return -ENOENT;
> + action = desc->action;
> + if (!action)
> + return -ENOENT;
> + if (unlikely(!action->thread_fn))
> + return -EINVAL;
> + if (likely(!test_bit(IRQTF_DIED,
> + &action->thread_flags))) {
> + set_bit(IRQTF_RUNTHREAD, &action->thread_flags);
> + wake_up_process(action->thread);
> + } else {
> + return -ECHILD;
> + }
> + return 0;
> +}
> +EXPORT_SYMBOL(raise_threaded_irq);
> --
> 1.5.6.5
>
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/3] max3100: added raise_threaded_irq
2010-03-19 17:48 ` [PATCH 1/3] max3100: added raise_threaded_irq Grant Likely
@ 2010-03-21 7:31 ` christian pellegrin
0 siblings, 0 replies; 2+ messages in thread
From: christian pellegrin @ 2010-03-21 7:31 UTC (permalink / raw)
To: Grant Likely
Cc: feng.tang, akpm, greg, david-b, alan, spi-devel-general,
linux-serial, Thomas Gleixner, Ingo Molnar,
Linux Kernel Mailing List
Hi,
On Fri, Mar 19, 2010 at 6:48 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> You should cc: Thomas and Ingo and lkml (which I just did) on patches
> to the threaded interrupt code.
>
ok, let me explain the reason for this function. The move from
worqueues to the threaded interrupts was motivated by a reduction of
latency in answering to RX buffer full interrupts. Threaded interrupts
are SCHED_FIFO instead worqueues being SCHED_OTHER. In the case of
MAX31x0 when we transmit a character we could have to receive one
(this is efficient because SPI transfers are quite always
bidirectional). The same routine is used both for tx and rx (an other
things like changing parameters): this makes locking really simple.
With this routine the thread interrupt handler could be the only kind
of deferred work a driver for a simple hardware may ever need.
--
Christian Pellegrin, see http://www.evolware.org/chri/
"Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room."
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-21 7:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <cabda6421003190139h344bc172h3556fca78e4b25cb@mail.gmail.com>
[not found] ` <1268987934-22690-1-git-send-email-chripell@fsfe.org>
2010-03-19 17:48 ` [PATCH 1/3] max3100: added raise_threaded_irq Grant Likely
2010-03-21 7:31 ` christian pellegrin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®