SA_TRIGGER_* vs. SA_SAMPLE_RANDOM
Since SA_SAMPLE_RANDOM is defined as "SA_RESTART", it could be just about any value.
On sparc, it's value is "2", so it aliases some of the SA_TRIGGER_* defines the new genirq code adds. And therefore we get a bunch of these on sparc64:
[ 16.650540] setup_irq(2) SA_TRIGGERset. No set_type function available
(btw: missing space in the kernel log message between 'SA_TRIGGER'
and 'set' :-)
I can't see any reason why SA_SAMPLE_RANDOM is set to a signal mask value, or why IRQ flags are defined in linux/signal.h :-)
Anyways, probably the best bet for now is to define SA_SAMPLE_RANDOM explicitly to some value instead of relying on the arbitrary platform definition of SA_RANDOM.
Ingo could you cook up and submit a patch which does this? Thanks.
David,
Quoted 16 lines · David Miller
Since
SA_SAMPLE_RANDOMis defined as "SA_RESTART", it could be just about any value.On sparc, it's value is "2", so it aliases some of the SA_TRIGGER_* defines the new genirq code adds. And therefore we get a bunch of these on sparc64:
[ 16.650540] setup_irq(2) SA_TRIGGERset. No set_type function available(btw: missing space in the kernel log message between '
SA_TRIGGER'and 'set' :-)I can't see any reason why
SA_SAMPLE_RANDOMis set to a signal mask value, or why IRQ flags are defined inlinux/signal.h:-)
Quoted 6 lines
Anyways, probably the best bet for now is to define
SA_SAMPLE_RANDOMexplicitly to some value instead of relying on the arbitrary platform definition ofSA_RANDOM.Ingo could you cook up and submit a patch which does this? Thanks.
We have the same hassle with SA_INTERRUPT. The question arises, if we should move the SA_XX flags for interrupts completely out of the signal SA name space. Rename to IRQ_xxx and put them into interrupt.h.
tglx
Quoted 21 lines · Thomas Gleixner
Quoted 20 lines · David Miller
Since
SA_SAMPLE_RANDOMis defined as "SA_RESTART", it could be just about any value.On sparc, it's value is "2", so it aliases some of the SA_TRIGGER_* defines the new genirq code adds. And therefore we get a bunch of these on sparc64:
[ 16.650540] setup_irq(2) SA_TRIGGERset. No set_type function available(btw: missing space in the kernel log message between '
SA_TRIGGER'and 'set' :-)I can't see any reason why
SA_SAMPLE_RANDOMis set to a signal mask value, or why IRQ flags are defined inlinux/signal.h:-)Anyways, probably the best bet for now is to define
SA_SAMPLE_RANDOMexplicitly to some value instead of relying on the arbitrary platform definition ofSA_RANDOM.
Quoted 6 lines
Quoted 2 lines
Ingo could you cook up and submit a patch which does this? Thanks.
We have the same hassle with
SA_INTERRUPT. The question arises, if we should move theSA_XXflags for interrupts completely out of the signal SA name space. Rename toIRQ_xxxand put them intointerrupt.h.
It would probably be sensible, but isn't there rather a lot of drivers to update? We could do it as a transitional thing - #define the old SA_* names to the new in interrupt.h for a while.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core
From: Russell King <[email protected]>
Date: Fri, 30 Jun 2006 19:47:45 +0100
Quoted 8 lines · Thomas Gleixner
Quoted 3 lines
We have the same hassle with
SA_INTERRUPT. The question arises, if we should move theSA_XXflags for interrupts completely out of the signal SA name space. Rename toIRQ_xxxand put them intointerrupt.h.It would probably be sensible, but isn't there rather a lot of drivers to update? We could do it as a transitional thing - #define the old SA_* names to the new in
interrupt.hfor a while.
This seems like a sane plan.
Someone skilled in sed and awk could probably do the whole current tree up in a short amount of time though :-)
I would then only keep the existing defines around for the sake of being polite to out-of-tree folks :) Put them in the deprecation schedule, then zap them for good a few months from now.
Quoted 14 lines · David Miller
From: Russell King <[email protected]>
Date: Fri, 30 Jun 2006 19:47:45 +0100Quoted 8 lines · Thomas Gleixner
Quoted 3 lines
We have the same hassle with
SA_INTERRUPT. The question arises, if we should move theSA_XXflags for interrupts completely out of the signal SA name space. Rename toIRQ_xxxand put them intointerrupt.h.It would probably be sensible, but isn't there rather a lot of drivers to update? We could do it as a transitional thing - #define the old SA_* names to the new in
interrupt.hfor a while.This seems like a sane plan.
Quoted 7 lines
Someone skilled in sed and awk could probably do the whole current tree up in a short amount of time though :-)
I would then only keep the existing defines around for the sake of being polite to out-of-tree folks :) Put them in the deprecation schedule, then zap them for good a few months from now.
I'll cook it up tomorrow.
tglx
From: Thomas Gleixner <[email protected]>
Date: Fri, 30 Jun 2006 22:27:27 +0200
Quoted 1 line
I'll cook it up tomorrow.
Thanks a lot Thomas. :)
Quoted 6 lines · David Miller
From: Thomas Gleixner <[email protected]>
Date: Fri, 30 Jun 2006 22:27:27 +0200Quoted 1 line
I'll cook it up tomorrow.
Thanks a lot Thomas. :)
That's what I came up with:
SA_INTERRUPT IRQF_IRQS_DISABLEDSA_SAMPLE_RANDOM IRQF_SAMPLE_RANDOMSA_SHIRQ IRQF_SHARE_IRQSA_PROBEIRQ IRQF_PROBE_IRQSA_TRIGGER_LOW IRQF_TRIGGER_LOWSA_TRIGGER_HIGH IRQF_TRIGGER_HIGHSA_TRIGGER_FALLING IRQF_TRIGGER_FALLINGSA_TRIGGER_RISING IRQF_TRIGGER_RISINGSA_TRIGGER_MASK IRQF_TRIGGER_MASKSA_TIMER IRQF_TIMER
It affects only 720 files :)
tglx
Quoted 10 lines · Thomas Gleixner
Quoted 6 lines · David Miller
From: Thomas Gleixner <[email protected]>
Date: Fri, 30 Jun 2006 22:27:27 +0200Quoted 1 line
I'll cook it up tomorrow.
Thanks a lot Thomas. :)
That's what I came up with:
Quoted 10 lines
SA_INTERRUPTIRQF_IRQS_DISABLEDSA_SAMPLE_RANDOMIRQF_SAMPLE_RANDOMSA_SHIRQIRQF_SHARE_IRQSA_PROBEIRQIRQF_PROBE_IRQSA_TRIGGER_LOWIRQF_TRIGGER_LOWSA_TRIGGER_HIGHIRQF_TRIGGER_HIGHSA_TRIGGER_FALLINGIRQF_TRIGGER_FALLINGSA_TRIGGER_RISINGIRQF_TRIGGER_RISINGSA_TRIGGER_MASKIRQF_TRIGGER_MASKSA_TIMERIRQF_TIMER
Looks good to me. Do we want to keep a PERCPU flag too ? I don't really need it anymore on powerpc as I just use the percpu flow handler and I'm not allowing sharing of IPIs but others might.
Also, I'd like to store the IRQ types in the irq_desc regardless of the actions that have been registered or not. Any suggestion where to put that ? The current type values conflict with other desc->status bits at the moment unless we shift the whole thing up...
Ben.
Quoted 4 lines
We have the same hassle with
SA_INTERRUPT. The question arises, if we should move theSA_XXflags for interrupts completely out of the signal SA name space. Rename toIRQ_xxxand put them intointerrupt.h.
Agreed. In addition, if you look specifically at triggers, I've seen so far:
- The new SA_* trigger stuff
- The IRQ_TYPE_* stuff
- The definitions of bits in struct resource of interrupts in ioport.h
- The old IRQ_LEVEL
- Various arch specific things that duplicate it again
In addition, it's different bits with different organisation (for example, the IRQ_TYPE can express dual edge), etc...
In my new powerpc IRQ rework, I'm wiping out our own definitions for triggers and using IRQ_TYPE_* accross the range. I'm howveer not using the SA_* stuff at all at this point (that is, I'm neither converting the trigger type of a given interrupt to SA_* and putting it in the action/desc, nor honoring the SA_* triggers passed in request_irq at this point). It might be nice to do so, but I find that there is just way too much confusion at the moment.
Ben.