request_irq() and setup_irq()
Hi,
looking through the sources of 2.4.21 there come up one question. If a device wants to register its interrupt it may call request_irq() that then calls setup_irq(). Now since SA_PERCPU_IRQ is not set by the device setup_irq() does not initialize desc->handler. Can that be fixed by adding SA_PERCPU_IRQ to irqflags in request_irq() or does that introduce problems at another place?
Christian
Quoted 3 lines · Christian Hildner
Hi,
looking through the sources of 2.4.21 there come up one question. If a
... why on earth are you looking at 2.4.21?
Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception." -- Mark Twain
Quoted 6 lines · Christian Hildner
Hi,
looking through the sources of 2.4.21 there come up one question. If a device wants to register its interrupt it may call
request_irq()that then callssetup_irq(). Now sinceSA_PERCPU_IRQis not set by the devicesetup_irq()does not initializedesc->handler.
Sorry - can you explain why this is a problem?
Are you trying to avoid the spinlock in do_IRQ() or something else?
It's been a while since I've last played with 2.4.21, but it mostly worked for the things I was testing at the time.
Quoted 3 lines
Can that be fixed by
addingSA_PERCPU_IRQto irqflags inrequest_irq()or does that introduce problems at another place?
For IO SAPIC generated interrupts, that should work fine on platforms that don't implement XPR (IIRC, e.g. HP ZX1). Systems which implement XPR could redirect the interrupt to a different CPU (e.g Intel). IIRC, one can "pin" the IO SAPIC generated interrupt to a CPU despite XPR but I don't recall details or if that's already being done. You'll need to investigate this a bit more.
hth,
grant
Quoted 2 lines
-----Original Message-----
From: [email protected]
[mailto:[email protected]]
Quoted 7 lines
On Behalf Of Christian Hildner
Sent: Thursday, October 21, 2004 11:12 PM
Hi,looking through the sources of 2.4.21 there come up one question. If a device wants to register its interrupt it may call
request_irq()that then callssetup_irq(). Now sinceSA_PERCPU_IRQis not set by the
device
Quoted 2 lines
setup_irq()does not initializedesc->handler. Can that be fixed by addingSA_PERCPU_IRQto irqflags inrequest_irq()or does that
introduce
Quoted 3 lines
problems at another place?
Christian
ACPI can provide MADT table for lsapic and iosapic info in local system. From that table, linux will configure interrupt controller info for each interrupt line when bootup. You can look at iosapic_init(), which constructs per-line info related to iosapic. Say, by trigger mode of specific line, register_intr() will decide whether irq_type_iosapic_edge or irq_type_iosapic_level should be used.
Thanks,
Kevin
Quoted 2 lines · Kevin
ACPI can provide MADT table for lsapic and iosapic info in local system.
From that table, linux will configure interrupt controller info for each
Quoted 5 lines
interrupt line when bootup. You can look at
iosapic_init(), which constructs per-line info related to iosapic. Say, by trigger mode of specific line,register_intr()will decide whetherirq_type_iosapic_edgeorirq_type_iosapic_levelshould be used.
Kevin,
thanks for your good pointers. Indeed iosapic_init() and register_intr() are the choice since they install a handler as needed. But before I had to walk through the hell of acpi.
Thanks a lot
Christian