* Using "Asynchronous Notifications" within an interrupt handler
[not found] <513a5e60610051727t7f7c7b78u62410c4b8f8502a7@mail.gmail.com>
@ 2006-10-06 0:53 ` Madhu Saravana Sibi Govindan
2006-10-06 5:42 ` Jan Engelhardt
0 siblings, 1 reply; 3+ messages in thread
From: Madhu Saravana Sibi Govindan @ 2006-10-06 0:53 UTC (permalink / raw)
To: linux-kernel
Hello all,
I'm developing a linux device driver for kernel version 2.16.15. I'm
thinking of using the "Asynchronous Notification" mechanism, explained
in the Linux Device Drivers book by Corbet and Rubini in Chapter 6,
within an interrupt handler.
The idea is: whenever the device driver receives an interrupt from the
hardware device, the interrupt handler uses this 'asynchronous
notification' mechanism to notify a user-level process of this
interrupt. The user-level process, on the other hand, is waiting for
this SIGIO signal from the device driver.
My question is: is it safe to use the asynchronous notification
mechanism within an interrupt handler? I see that this call acquires a
bunch of locks before sending the signal to the process. Would this
cause any deadlocking situations? Or should I resort to the top and
bottom half approach for interrupt handling and handle the
notification in the bottom half?
I'd be very thankful for suggestions/ideas on this topic.
Regards and thanks in advance,
G.Sibi
PS: I've posted this to os_drivers@lists.osdl.org too. My apologies
for the duplication.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Using "Asynchronous Notifications" within an interrupt handler
2006-10-06 0:53 ` Using "Asynchronous Notifications" within an interrupt handler Madhu Saravana Sibi Govindan
@ 2006-10-06 5:42 ` Jan Engelhardt
2006-10-06 17:10 ` Madhu Saravana Sibi Govindan
0 siblings, 1 reply; 3+ messages in thread
From: Jan Engelhardt @ 2006-10-06 5:42 UTC (permalink / raw)
To: Madhu Saravana Sibi Govindan; +Cc: linux-kernel
>
> My question is: is it safe to use the asynchronous notification
> mechanism within an interrupt handler? I see that this call acquires a
> bunch of locks before sending the signal to the process. Would this
> cause any deadlocking situations? Or should I resort to the top and
> bottom half approach for interrupt handling and handle the
> notification in the bottom half?
It may be possible - I have an old driver for custom hardware lying
around here, and it does this in the irq handler:
kill_fasync(&global.fasync_ptr, SIGIO, POLL_IN);
-`J'
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Using "Asynchronous Notifications" within an interrupt handler
2006-10-06 5:42 ` Jan Engelhardt
@ 2006-10-06 17:10 ` Madhu Saravana Sibi Govindan
0 siblings, 0 replies; 3+ messages in thread
From: Madhu Saravana Sibi Govindan @ 2006-10-06 17:10 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: linux-kernel
Thanks for the information.
I have another quick question: my device driver can expect up to 4
different interrupts (from 4 hardware devices). Can I send a posix
real-time signal (SIGRTMIN) using the kill_async interface and expect
the kernel to queue these signals for delievery to the sleeping
process? (Because if I use SIGIO it is possible that an incoming
interrupt is lost because the kernel doesn't queue up normal signals,
right?).
Thanks,
G.Sibi
On 10/6/06, Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:
> >
> > My question is: is it safe to use the asynchronous notification
> > mechanism within an interrupt handler? I see that this call acquires a
> > bunch of locks before sending the signal to the process. Would this
> > cause any deadlocking situations? Or should I resort to the top and
> > bottom half approach for interrupt handling and handle the
> > notification in the bottom half?
>
> It may be possible - I have an old driver for custom hardware lying
> around here, and it does this in the irq handler:
>
> kill_fasync(&global.fasync_ptr, SIGIO, POLL_IN);
>
>
>
> -`J'
> --
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-10-06 17:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <513a5e60610051727t7f7c7b78u62410c4b8f8502a7@mail.gmail.com>
2006-10-06 0:53 ` Using "Asynchronous Notifications" within an interrupt handler Madhu Saravana Sibi Govindan
2006-10-06 5:42 ` Jan Engelhardt
2006-10-06 17:10 ` Madhu Saravana Sibi Govindan
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®