Skip to contentSkip to conversation

Registering shared & unshared interrupt handlers

DISCUSSION Jay Aurabind 2 participants 3 messages Feb 17, 2014

lore
Share & tools
lore
#0 lore raw

Dear all,

I've been going through Robert Love's LKD. Here is an excerpt from it regarding registration of interrupt handlers:

"When request_irq() is called with IRQF_SHARED specified, the call succeeds only if the interrupt line is currently not registered, or if all registered handlers on the line also specified IRQF_SHARED. Shared handlers, however, can mix usage of IRQF_DISABLED."

As far as I understand, the first sentence tells that a line currently having shared handlers *will only have* handlers registered with IRQF_SHARED flag in the past. Correct ?

If a interrupt line has been registered by a handler specified as non shared, then whats the point in allowing a new handler with a "shared" flag registering to the same line ? So how does the mixing of shared and unshared interrupt handlers for the same line go together as mentioned by the 2nd sentence ?

Or does it mean that a shared handler which already succeeded the registration can further register a non shared and shared interrupt handlers? ( That doesnt make sense, but still... ) ? Simply put, can someone please elaborate on the second sentence I quoted from the book ?

Thanks and Regards,
Aurabindo J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140217/08f58b8d/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 291 bytes
Desc: OpenPGP digital signature
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140217/08f58b8d/attachment.bin

#1 lore raw

Oops, I though IRQ_DISABLED was the opposite of IRQF_SHARED. Sorry. Consider the question not asked :P

Quoted 29 lines · Jay Aurabind

Dear all,

I've been going through Robert Love's LKD. Here is an excerpt from it regarding registration of interrupt handlers:

"When request_irq() is called with IRQF_SHARED specified, the call succeeds only if the interrupt line is currently not registered, or if all registered handlers on the line also specified IRQF_SHARED. Shared handlers, however, can mix usage of IRQF_DISABLED."

As far as I understand, the first sentence tells that a line currently having shared handlers *will only have* handlers registered with IRQF_SHARED flag in the past. Correct ?

If a interrupt line has been registered by a handler specified as non shared, then whats the point in allowing a new handler with a "shared" flag registering to the same line ? So how does the mixing of shared and unshared interrupt handlers for the same line go together as mentioned by the 2nd sentence ?

Or does it mean that a shared handler which already succeeded the registration can further register a non shared and shared interrupt handlers? ( That doesnt make sense, but still... ) ? Simply put, can someone please elaborate on the second sentence I quoted from the book ?

Thanks and Regards,
Aurabindo J

Signature · 5 lines
Thanks and Regards,
*Aurabindo J*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140217/ba9ea347/attachment.html 
#2 lore raw
In reply to Jay Aurabind
Quoted 5 lines · Jay Aurabind

Dear all,

I've been going through Robert Love's LKD. Here is an excerpt from it regarding registration of interrupt handlers:

Quoted 8 lines

"When request_irq() is called with IRQF_SHARED specified, the call succeeds only if the interrupt line is currently not registered, or if all registered handlers on the line also specified IRQF_SHARED. Shared handlers, however, can mix usage of IRQF_DISABLED."

As far as I understand, the first sentence tells that a line currently having shared handlers *will only have* handlers registered with IRQF_SHARED flag in the past. Correct ?

Yes.

Quoted 3 lines

If a interrupt line has been registered by a handler specified as non shared, then whats the point in allowing a new handler with a "shared" flag

It doesn't allow as your statement in above indicates.

Quoted 8 lines

registering to the same line ? So how does the mixing of shared and unshared interrupt handlers for the same line go together as mentioned by the 2nd sentence ?

Or does it mean that a shared handler which already succeeded the registration can further register a non shared and shared interrupt handlers? ( That doesnt make sense, but still... ) ? Simply put, can someone please elaborate on the second sentence I quoted from the book ?

Where is the confusion ? Just to be clear, kernel doesn't allow shared and unshared
interrupt handler on the same interrupt line. Read the code in irq core subsystem.
kernel/kernel/irq

Quoted 10 lines

Thanks and Regards,
Aurabindo J

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies