Cannot end interrupt from user space: add rt_intr_end call ?
Hi,
I think that when I handle interrupts from user space, I cannot correctly use I_NOAUTOENA. The thing is that this flag in fact means "do not call automatically xnarch_end_irq". The xnarch_end_irq call usually maps to unmasking the interrupt, but not always - depending on interrupt type (sometimes in eoi, sometimes is nop).
I was thinking that it would be nice if I could call something like "xnarch_end_irq" (i.e. rt_intr_end) from user space, so that I could correctly use I_NOAUTOENA to control the flow of interrupts.
Cheers,
Tomas
Quoted 8 lines · Tomas Kalibera
Hi,
I think that when I handle interrupts from user space, I cannot correctly use
I_NOAUTOENA. The thing is that this flag in fact means "do not call automaticallyxnarch_end_irq". Thexnarch_end_irqcall usually maps to unmasking the interrupt, but not always - depending on interrupt type (sometimes in eoi, sometimes is nop).
Quoted 4 lines
I was thinking that it would be nice if I could call something like "
xnarch_end_irq" (i.e.rt_intr_end) from user space, so that I could correctly useI_NOAUTOENAto control the flow of interrupts.
What would this buy you? xnarch_irq_end() would still handle the unmasking logic depending on the interrupt type, because it knows how the interrupt was acknowledged in the first place -- in contrast, the application does not and should not.
xnarch_end_irq() basically calls the ->unmask() method of the interrupt chip descriptor, which is the same as calling rt_intr_enable(). Before you do that, you may want to try the attached patch, which makes sure that rt_intr_enable/disable are eagerly routed to unmask/mask on x86 for post-2.6.18 kernels. That patch is expected to solve the "rt_intr_disable() not masking IO-APIC interrupt" issue we discussed earlier.
Quoted 10 lines
Cheers,
Tomas_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Signature · 1 line
Philippe.
asm-x86/wrappers_32.h +2 -2
@@ -163,8 +163,8 @@#define rthal_irq_chip_end (irq) rthal_irq_chip_enable(irq)#else /* >= 2.6.19 */ -#define rthal_irq_chip_enable (irq) ({ rthal_irq_descp(irq)->chip->enable(irq); 0; }) -#define rthal_irq_chip_disable (irq) ({ rthal_irq_descp(irq)->chip->disable(irq); 0; }) +#define rthal_irq_chip_enable (irq) ({ rthal_irq_descp(irq)->chip->unmask(irq); 0; }) +#define rthal_irq_chip_disable (irq) ({ rthal_irq_descp(irq)->chip->mask(irq); 0; })#define rthal_irq_chip_end (irq) ({ rthal_irq_descp(irq)->ipipe_end(irq, rthal_irq_descp(irq)); 0; })typedef irq_handler_t rthal_irq_host_handler_t ;
asm-x86/wrappers_64.h +2 -2
@@ -31,8 +31,8 @@#define rthal_irq_descp (irq) (irq_desc + irq)#define rthal_irq_desc_status (irq) (rthal_irq_descp(irq)->status) -#define rthal_irq_chip_enable (irq) ({ rthal_irq_descp(irq)->chip->enable(irq); 0; }) -#define rthal_irq_chip_disable (irq) ({ rthal_irq_descp(irq)->chip->disable(irq); 0; }) +#define rthal_irq_chip_enable (irq) ({ rthal_irq_descp(irq)->chip->unmask(irq); 0; }) +#define rthal_irq_chip_disable (irq) ({ rthal_irq_descp(irq)->chip->mask(irq); 0; })#define rthal_irq_chip_end (irq) ({ rthal_irq_descp(irq)->ipipe_end(irq, rthal_irq_descp(irq)); 0; })typedef irq_handler_t rthal_irq_host_handler_t ;
Hi Philippe,
thank you for the patch !
Quoted 3 lines
xnarch_end_irq()basically calls the ->unmask() method of the interrupt chip descriptor, which is the same as callingrt_intr_enable(). Before you do that,
If I read the sources correctly, for "edge" and "simple" interrupt, xnarch_end_irq() calls nothing, for "percpu" it calls ->eoi() . For "level", "fasteoi", and "demux", it calls ->unmask().
So calling rt_intr_enable from user space would not always do the same as xnarch_end_irq from the kernel, wouldn't it ?
Tomas
Quoted 37 lines · Philippe Gerum
Quoted 7 lines · Tomas Kalibera
Hi,
I think that when I handle interrupts from user space, I cannot correctly use
I_NOAUTOENA. The thing is that this flag in fact means "do not call automaticallyxnarch_end_irq". Thexnarch_end_irqcall usually maps to unmasking the interrupt, but not always - depending on interrupt type (sometimes in eoi, sometimes is nop).I was thinking that it would be nice if I could call something like "
xnarch_end_irq" (i.e.rt_intr_end) from user space, so that I could correctly useI_NOAUTOENAto control the flow of interrupts.What would this buy you?
xnarch_irq_end()would still handle the unmasking logic depending on the interrupt type, because it knows how the interrupt was acknowledged in the first place -- in contrast, the application does not and should not.
xnarch_end_irq()basically calls the ->unmask() method of the interrupt chip descriptor, which is the same as callingrt_intr_enable(). Before you do that, you may want to try the attached patch, which makes sure that rt_intr_enable/disable are eagerly routed to unmask/mask on x86 for post-2.6.18 kernels. That patch is expected to solve the "rt_intr_disable()not masking IO-APIC interrupt" issue we discussed earlier.Quoted 11 lines
Cheers,
Tomas_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Quoted 10 lines · Tomas Kalibera
Hi Philippe,
thank you for the patch !
Quoted 5 lines
xnarch_end_irq()basically calls the ->unmask() method of the interrupt chip
descriptor, which is the same as callingrt_intr_enable(). Before you do that,
Quoted 7 lines
If I read the sources correctly, for "edge" and "simple" interrupt,
xnarch_end_irq()calls nothing, for "percpu" it calls ->eoi() . For "level", "fasteoi", and "demux", it calls ->unmask().So calling
rt_intr_enablefrom user space would not always do the same asxnarch_end_irqfrom the kernel, wouldn't it ?
No it would not, and this is what we want. The patch makes sure that calling rt_intr_enable/disable() will actually unmask/mask the interrupt at PIC level, regardless of how the normal ack/handle/end process works for that interrupt.
Quoted 56 lines
Tomas
Quoted 49 lines · Philippe Gerum
Quoted 8 lines · Tomas Kalibera
Hi,
I think that when I handle interrupts from user space, I cannot correctly use
I_NOAUTOENA. The thing is that this flag in fact means "do not call automaticallyxnarch_end_irq". Thexnarch_end_irqcall usually maps to unmasking the interrupt, but not always - depending on interrupt type (sometimes in eoi, sometimes is nop).Quoted 5 lines
I was thinking that it would be nice if I could call something like "
xnarch_end_irq" (i.e.rt_intr_end) from user space, so that I could correctly useI_NOAUTOENAto control the flow of interrupts.What would this buy you?
xnarch_irq_end()would still handle the unmasking logic
depending on the interrupt type, because it knows how the interrupt was acknowledged in the first place -- in contrast, the application does not and
should not.
xnarch_end_irq()basically calls the ->unmask() method of the interrupt chip
descriptor, which is the same as callingrt_intr_enable(). Before you do that,
you may want to try the attached patch, which makes sure that rt_intr_enable/disable are eagerly routed to unmask/mask on x86 for post-2.6.18
kernels. That patch is expected to solve the "rt_intr_disable()not masking
IO-APIC interrupt" issue we discussed earlier.Quoted 11 lines
Cheers,
Tomas_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Signature · 1 line
Philippe.
Quoted 10 lines
Quoted 4 lines
So calling
rt_intr_enablefrom user space would not always do the same asxnarch_end_irqfrom the kernel, wouldn't it ?No it would not, and this is what we want. The patch makes sure that calling rt_intr_enable/disable() will actually unmask/mask the interrupt at PIC level, regardless of how the normal ack/handle/end process works for that interrupt.
OK, and this is the problem why I started calling for rt_intr_end. In order to use I_NOAUTOENA from user space correctly, I need to be able to end the interrupt correctly from user space. And there is no function to do this.
Tomas
Quoted 61 lines
Quoted 58 lines
Tomas
Quoted 51 lines · Philippe Gerum
Quoted 8 lines · Tomas Kalibera
Hi,
I think that when I handle interrupts from user space, I cannot correctly use
I_NOAUTOENA. The thing is that this flag in fact means "do not call automaticallyxnarch_end_irq". Thexnarch_end_irqcall usually maps to unmasking the interrupt, but not always - depending on interrupt type (sometimes in eoi, sometimes is nop).Quoted 6 lines
I was thinking that it would be nice if I could call something like "
xnarch_end_irq" (i.e.rt_intr_end) from user space, so that I could correctly useI_NOAUTOENAto control the flow of interrupts.What would this buy you?
xnarch_irq_end()would still handle the unmasking logic
depending on the interrupt type, because it knows how the interrupt was acknowledged in the first place -- in contrast, the application does not and
should not.
xnarch_end_irq()basically calls the ->unmask() method of the interrupt chip
descriptor, which is the same as callingrt_intr_enable(). Before you do that,
you may want to try the attached patch, which makes sure that rt_intr_enable/disable are eagerly routed to unmask/mask on x86 for post-2.6.18
kernels. That patch is expected to solve the "rt_intr_disable()not masking
IO-APIC interrupt" issue we discussed earlier.Quoted 12 lines
Cheers,
Tomas_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Quoted 13 lines · Tomas Kalibera
Quoted 5 lines
Quoted 4 lines
So calling
rt_intr_enablefrom user space would not always do the same asxnarch_end_irqfrom the kernel, wouldn't it ?Quoted 8 lines
No it would not, and this is what we want. The patch makes sure that calling
rt_intr_enable/disable() will actually unmask/mask the interrupt at PIC level,
regardless of how the normal ack/handle/end process works for that interrupt.
Quoted 5 lines
OK, and this is the problem why I started calling for
rt_intr_end. In order to useI_NOAUTOENAfrom user space correctly, I need to be able to end the interrupt correctly from user space. And there is no function to do this.
Call rt_intr_enable(), with the patch applied. This will work.
Quoted 63 lines
Tomas
Quoted 58 lines
Quoted 55 lines
Tomas
Quoted 48 lines · Philippe Gerum
Quoted 8 lines · Tomas Kalibera
Hi,
I think that when I handle interrupts from user space, I cannot correctly use
I_NOAUTOENA. The thing is that this flag in fact means "do not call automaticallyxnarch_end_irq". Thexnarch_end_irqcall usually maps to unmasking the interrupt, but not always - depending on interrupt type (sometimes in eoi, sometimes is nop).Quoted 5 lines
I was thinking that it would be nice if I could call something like "
xnarch_end_irq" (i.e.rt_intr_end) from user space, so that I could correctly useI_NOAUTOENAto control the flow of interrupts.What would this buy you?
xnarch_irq_end()would still handle the unmasking logic
depending on the interrupt type, because it knows how the interrupt was acknowledged in the first place -- in contrast, the application does not and
should not.
xnarch_end_irq()basically calls the ->unmask() method of the interrupt chip
descriptor, which is the same as callingrt_intr_enable(). Before you do that,
you may want to try the attached patch, which makes sure that rt_intr_enable/disable are eagerly routed to unmask/mask on x86 for post-2.6.18
kernels. That patch is expected to solve the "rt_intr_disable()not masking
IO-APIC interrupt" issue we discussed earlier.Quoted 11 lines
Cheers,
Tomas_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Signature · 1 line
Philippe.