Skip to contentSkip to conversation

Updates for ipipe-2.6.36-noarch

GIT PULL New Jan Kiszka 3 participants 11 messages Nov 25, 2010 – Jan 25, 2011 IRQ

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

The following changes since commit 4c83ab8e3ac5b194695e38bbc253f78e6072ad24:

ipipe: tell __ipipe_run_irqtail about the latest IRQ number (2010-11-05 13:52:55 +0100)

are available in the git repository at:
git://git.kiszka.org/ipipe-2.6 queues/2.6.35-noarch

[edited log]
Jan Kiszka (4):
ipipe: Provide wrapper for IRQ mask/unmask at chip level
ipipe: Drop spurious irq_enter/exit from __ipipe_sync_stage
ipipe: Provide __ipipe_spin_trylock_irq for !CONFIG_IPIPE Merge commit 'v2.6.35.9' into queues/2.6.35-noarch

Will follow up with the ipipe specific patches for review.

author
#1 lore raw

PATCH 1/3 ipipe: Provide wrapper for IRQ mask/unmask at chip level

We need to overload these services for irqchips that cannot be hardened to work from arbitrary contexts.

---

I'm still lagging behind with making use of this for MSI masking or refactoring the Xenomai HAL to use it, but it's a start.

 include/linux/ipipe.h      |   22 ++++++++++++++++++++++
 include/linux/ipipe_base.h |    1 +
 include/linux/irq.h        |    2 ++
 kernel/ipipe/core.c        |    6 ++++++
 4 files changed, 31 insertions(+), 0 deletions(-)
include/linux/ipipe.h +22 -0
index 854f132..da2bd68 100644
@@ -28,6 +28,7 @@
 #include <linux/mutex.h>
 #include <linux/linkage.h>
 #include <linux/ipipe_base.h>
+#include <linux/irq.h>
 #include <asm/ipipe.h>
 #include <asm/bug.h>
 
@@ -440,6 +441,27 @@ int ipipe_control_irq(struct ipipe_domain *ipd,
 		      unsigned clrmask,
 		      unsigned setmask);
 
+static inline void ipipe_irq_chip_mask(unsigned int irq, struct irq_desc *desc)
+{
+	desc->ipipe_mask(irq);
+}
+
+static inline void
+ipipe_irq_chip_unmask(unsigned int irq, struct irq_desc *desc)
+{
+	desc->ipipe_unmask(irq);
+}
+
+void __ipipe_irq_chip_nop(unsigned int irq);
+
+#ifndef HAVE_IPIPE_IRQ_DESC_SET_HANDLERS
+static inline void ipipe_irq_desc_set_handlers(struct irq_desc *desc)
+{
+	desc->ipipe_mask = desc->chip->mask ? : __ipipe_irq_chip_nop;
+	desc->ipipe_unmask = desc->chip->unmask ? : __ipipe_irq_chip_nop;
+}
+#endif
+
 unsigned ipipe_alloc_virq(void);
 
 int ipipe_free_virq(unsigned virq);
include/linux/ipipe_base.h +1 -0
index 3f43ba5..7152485 100644
@@ -110,6 +110,7 @@ static inline void ipipe_check_context(struct ipipe_domain *border_ipd) { }
 #define __IPIPE_FEATURE_PREPARE_PANIC		1
 #define __IPIPE_FEATURE_ROOT_PREEMPT_NOTIFIER	1
 #define __IPIPE_FEATURE_CONTROL_IRQ		1
+#define __IPIPE_FEATURE_IRQ_CHIP_MASK		1
 
 #else /* !CONFIG_IPIPE */
 
include/linux/irq.h +2 -0
index 630e995..a6969d6 100644
@@ -181,6 +181,8 @@ struct irq_desc {
 					     struct irq_desc *desc);
 	void			(*ipipe_end)(unsigned int irq,
 					     struct irq_desc *desc);
+	void			(*ipipe_mask)(unsigned int irq);
+	void			(*ipipe_unmask)(unsigned int irq);
 #endif /* CONFIG_IPIPE */
 	unsigned int		irq;
 	struct timer_rand_state *timer_rand_state;
kernel/ipipe/core.c +6 -0
index 9d025b2..756ad02 100644
@@ -889,6 +889,10 @@ unsigned ipipe_alloc_virq(void)
 	return irq;
 }
 
+void __ipipe_irq_chip_nop(unsigned int irq)
+{
+}
+
 /*
  * ipipe_virtualize_irq() -- Set a per-domain pipelined interrupt
  * handler.
@@ -981,6 +985,8 @@ int ipipe_virtualize_irq(struct ipipe_domain *ipd,
 	if (desc == NULL)
 		goto unlock_and_exit;
 
+	ipipe_irq_desc_set_handlers(desc);
+
 	if (irq < NR_IRQS && !ipipe_virtual_irq_p(irq)) {
 		__ipipe_enable_irqdesc(ipd, irq);
 		/*
author
#2 lore raw

PATCH 2/3 ipipe: Drop spurious irq_enter/exit from __ipipe_sync_stage

In reply to Jan Kiszka

Invoking irq_enter/exit for root vIRQs is arch business (at least x86 needs to interleave it with exit code).

---
 kernel/ipipe/core.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
kernel/ipipe/core.c +2 -4
index 756ad02..129113b 100644
@@ -1240,11 +1240,9 @@ void __ipipe_sync_stage(void)
 		if (likely(ipd != ipipe_root_domain)) {
 			ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie);
 			__ipipe_run_irqtail(irq);
-		} else if (ipipe_virtual_irq_p(irq)) {
-			irq_enter();
+		} else if (ipipe_virtual_irq_p(irq))
 			__ipipe_do_root_virq(ipd, irq);
-			irq_exit();
-		} else
+		else
 			__ipipe_do_root_xirq(ipd, irq);
 
 		local_irq_disable_hw();
Signature · 1 line
1.7.1
author
#3 lore raw

PATCH 3/3 ipipe: Provide __ipipe_spin_trylock_irq for !CONFIG_IPIPE

In reply to Jan Kiszka
---
 include/linux/ipipe_lock.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
include/linux/ipipe_lock.h +1 -0
index 75bf0e8..5382208 100644
@@ -224,6 +224,7 @@ void __ipipe_spin_unlock_debug(unsigned long flags);
 #define __ipipe_spin_lock_irq(lock)		do { } while (0)
 #define __ipipe_spin_unlock_irq(lock)		do { } while (0)
 #define __ipipe_spin_lock_irqsave(lock)		0
+#define __ipipe_spin_trylock_irq(lock)		1
 #define __ipipe_spin_trylock_irqsave(lock, x)	({ (void)(x); 1; })
 #define __ipipe_spin_unlock_irqrestore(lock, x)	do { (void)(x); } while (0)
 #define __ipipe_spin_unlock_irqbegin(lock)	do { } while (0)
Signature · 1 line
1.7.1
#4 lore raw
In reply to Jan Kiszka
Quoted 10 lines · Jan Kiszka

The following changes since commit 4c83ab8e3ac5b194695e38bbc253f78e6072ad24:

ipipe: tell __ipipe_run_irqtail about the latest IRQ number (2010-11-05 13:52:55 +0100)

are available in the git repository at:
git://git.kiszka.org/ipipe-2.6 queues/2.6.35-noarch

[edited log]
Jan Kiszka (4):
ipipe: Provide wrapper for IRQ mask/unmask at chip level

Could you give me some hints about the intended usage of these?

Quoted 1 line

ipipe: Drop spurious irq_enter/exit from __ipipe_sync_stage

Actually, what is wrong is not with irq_enter/exit, but rather with the fact that we should only attempt a preemption resched when a virq handler returns, and that is a generic operation. There is no point in having uselessly hairy code in the arch-dep section, and that code is pure nop with CONFIG_PREEMPT off.

I just merged something along these lines.

Quoted 4 lines

ipipe: Provide __ipipe_spin_trylock_irq for !CONFIG_IPIPE Merge commit 'v2.6.35.9' into queues/2.6.35-noarch

Will follow up with the ipipe specific patches for review.

I'll be merging the IRQ virtualization removal for x86_32 next, but I want to issue an intermediate patch with the pending fixes first, given the potential for regression there is when messing with entry.S. However, I'll merge the EFLAGS fixes early on, since they are obviously required and right, and merge them along with 2.8-03 asap.

Signature · 1 line
Philippe.
author
#5 lore raw
Quoted 5 lines · Philippe Gerum
Quoted 4 lines · Jan Kiszka

The following changes since commit 4c83ab8e3ac5b194695e38bbc253f78e6072ad24:

ipipe: tell __ipipe_run_irqtail about the latest IRQ number (2010-11-05 13:52:55 +0100)

Quoted 8 lines
Quoted 6 lines

are available in the git repository at:
git://git.kiszka.org/ipipe-2.6 queues/2.6.35-noarch

[edited log]
Jan Kiszka (4):
ipipe: Provide wrapper for IRQ mask/unmask at chip level

Could you give me some hints about the intended usage of these?

The idea was (and still is but effort stalled ATM) to emulate MSI masking on top of that.

Quoted 10 lines
Quoted 2 lines

ipipe: Drop spurious irq_enter/exit from __ipipe_sync_stage

Actually, what is wrong is not with irq_enter/exit, but rather with the fact that we should only attempt a preemption resched when a virq handler returns, and that is a generic operation. There is no point in having uselessly hairy code in the arch-dep section, and that code is pure nop with CONFIG_PREEMPT off.

I just merged something along these lines.

OK, will have a look.

Quoted 4 lines
Quoted 4 lines

ipipe: Provide __ipipe_spin_trylock_irq for !CONFIG_IPIPE Merge commit 'v2.6.35.9' into queues/2.6.35-noarch

Quoted 8 lines
Quoted 1 line

Will follow up with the ipipe specific patches for review.

I'll be merging the IRQ virtualization removal for x86_32 next, but I want to issue an intermediate patch with the pending fixes first, given the potential for regression there is when messing with entry.S. However, I'll merge the EFLAGS fixes early on, since they are obviously required and right, and merge them along with 2.8-03 asap.

Fine with me.

Thanks,
Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#6 lore raw
Quoted 9 lines · Jan Kiszka
Quoted 8 lines · Philippe Gerum
Quoted 7 lines · Jan Kiszka

The following changes since commit 4c83ab8e3ac5b194695e38bbc253f78e6072ad24:

ipipe: tell __ipipe_run_irqtail about the latest IRQ number (2010-11-05 13:52:55 +0100)

are available in the git repository at:
git://git.kiszka.org/ipipe-2.6 queues/2.6.35-noarch

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

[edited log]
Jan Kiszka (4):
ipipe: Provide wrapper for IRQ mask/unmask at chip level

Could you give me some hints about the intended usage of these?

The idea was (and still is but effort stalled ATM) to emulate MSI masking on top of that.

Ok, let's keep this on the shelf until we come with a complete solution. I suspect we will have to resync the Xenomai and I-pipe interfaces to this end.

Quoted 32 lines
Quoted 11 lines
Quoted 3 lines

ipipe: Drop spurious irq_enter/exit from __ipipe_sync_stage

Actually, what is wrong is not with irq_enter/exit, but rather with the fact that we should only attempt a preemption resched when a virq handler returns, and that is a generic operation. There is no point in having uselessly hairy code in the arch-dep section, and that code is pure nop with CONFIG_PREEMPT off.

I just merged something along these lines.

OK, will have a look.

Quoted 4 lines
Quoted 4 lines

ipipe: Provide __ipipe_spin_trylock_irq for !CONFIG_IPIPE Merge commit 'v2.6.35.9' into queues/2.6.35-noarch

Quoted 8 lines
Quoted 1 line

Will follow up with the ipipe specific patches for review.

I'll be merging the IRQ virtualization removal for x86_32 next, but I want to issue an intermediate patch with the pending fixes first, given the potential for regression there is when messing with entry.S. However, I'll merge the EFLAGS fixes early on, since they are obviously required and right, and merge them along with 2.8-03 asap.

Fine with me.

Thanks,
Jan

Signature · 1 line
Philippe.
author
#7 lore raw
Quoted 14 lines · Philippe Gerum
Quoted 13 lines · Jan Kiszka
Quoted 12 lines · Philippe Gerum
Quoted 10 lines · Jan Kiszka

The following changes since commit 4c83ab8e3ac5b194695e38bbc253f78e6072ad24:

ipipe: tell __ipipe_run_irqtail about the latest IRQ number (2010-11-05 13:52:55 +0100)

are available in the git repository at:
git://git.kiszka.org/ipipe-2.6 queues/2.6.35-noarch

[edited log]
Jan Kiszka (4):
ipipe: Provide wrapper for IRQ mask/unmask at chip level

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Could you give me some hints about the intended usage of these?

The idea was (and still is but effort stalled ATM) to emulate MSI masking on top of that.

Ok, let's keep this on the shelf until we come with a complete solution. I suspect we will have to resync the Xenomai and I-pipe interfaces to this end.

Definitely. So the patch was intended as a starting point, enbling refactoring on Xenomai side. Quite a lot of work is actually to be done on the rthal, also to clean up lots of duplicate irq descriptor translations over there.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#8 lore raw
Quoted 17 lines · Jan Kiszka
Quoted 16 lines · Philippe Gerum
Quoted 15 lines · Jan Kiszka
Quoted 5 lines · Philippe Gerum
Quoted 4 lines · Jan Kiszka

The following changes since commit 4c83ab8e3ac5b194695e38bbc253f78e6072ad24:

ipipe: tell __ipipe_run_irqtail about the latest IRQ number (2010-11-05 13:52:55 +0100)

Quoted 7 lines
Quoted 6 lines

are available in the git repository at:
git://git.kiszka.org/ipipe-2.6 queues/2.6.35-noarch

[edited log]
Jan Kiszka (4):
ipipe: Provide wrapper for IRQ mask/unmask at chip level

Could you give me some hints about the intended usage of these?

The idea was (and still is but effort stalled ATM) to emulate MSI masking on top of that.

Quoted 8 lines
Quoted 3 lines

Ok, let's keep this on the shelf until we come with a complete solution. I suspect we will have to resync the Xenomai and I-pipe interfaces to this end.

Definitely. So the patch was intended as a starting point, enbling refactoring on Xenomai side. Quite a lot of work is actually to be done on the rthal, also to clean up lots of duplicate irq descriptor translations over there.

As a maintainer of low end architectures, I am not too fond with introducing one more level of function pointers. A substantial part of the worst case interrupt latency on ARM is spent in these routines, so, it would be nice if we could avoid make this even longer. And still on ARM, acking/masking an interrupt line is just about writing some bit to some MMIO memory, so, the cost of the function pointer is definitely not negligible.

Signature · 1 line
                                                                Gilles.
author
#9 lore raw
Quoted 27 lines · Gilles Chanteperdrix
Quoted 17 lines · Jan Kiszka
Quoted 16 lines · Philippe Gerum
Quoted 15 lines · Jan Kiszka
Quoted 5 lines · Philippe Gerum
Quoted 4 lines · Jan Kiszka

The following changes since commit 4c83ab8e3ac5b194695e38bbc253f78e6072ad24:

ipipe: tell __ipipe_run_irqtail about the latest IRQ number (2010-11-05 13:52:55 +0100)

Quoted 7 lines
Quoted 6 lines

are available in the git repository at:
git://git.kiszka.org/ipipe-2.6 queues/2.6.35-noarch

[edited log]
Jan Kiszka (4):
ipipe: Provide wrapper for IRQ mask/unmask at chip level

Could you give me some hints about the intended usage of these?

The idea was (and still is but effort stalled ATM) to emulate MSI masking on top of that.

Quoted 8 lines
Quoted 3 lines

Ok, let's keep this on the shelf until we come with a complete solution. I suspect we will have to resync the Xenomai and I-pipe interfaces to this end.

Definitely. So the patch was intended as a starting point, enbling refactoring on Xenomai side. Quite a lot of work is actually to be done on the rthal, also to clean up lots of duplicate irq descriptor translations over there.

Quoted 7 lines

As a maintainer of low end architectures, I am not too fond with introducing one more level of function pointers. A substantial part of the worst case interrupt latency on ARM is spent in these routines, so, it would be nice if we could avoid make this even longer. And still on ARM, acking/masking an interrupt line is just about writing some bit to some MMIO memory, so, the cost of the function pointer is definitely not negligible.

Then we need to push the definition of ipipe_irq_chip_[un]mask into arch hands and effectively keep it for those setups as is which do not need more. But we do need this abstraction.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#10 lore raw
In reply to Philippe Gerum
Quoted 27 lines · Philippe Gerum
Quoted 10 lines · Jan Kiszka

The following changes since commit 4c83ab8e3ac5b194695e38bbc253f78e6072ad24:

ipipe: tell __ipipe_run_irqtail about the latest IRQ number (2010-11-05 13:52:55 +0100)

are available in the git repository at:
git://git.kiszka.org/ipipe-2.6 queues/2.6.35-noarch

[edited log]
Jan Kiszka (4):
ipipe: Provide wrapper for IRQ mask/unmask at chip level

Could you give me some hints about the intended usage of these?

Quoted 1 line

ipipe: Drop spurious irq_enter/exit from __ipipe_sync_stage

Actually, what is wrong is not with irq_enter/exit, but rather with the fact that we should only attempt a preemption resched when a virq handler returns, and that is a generic operation. There is no point in having uselessly hairy code in the arch-dep section, and that code is pure nop with CONFIG_PREEMPT off.

I just merged something along these lines.

Quoted 3 lines

ipipe: Provide __ipipe_spin_trylock_irq for !CONFIG_IPIPE Merge commit 'v2.6.35.9' into queues/2.6.35-noarch

Quoted 8 lines
Quoted 1 line

Will follow up with the ipipe specific patches for review.

I'll be merging the IRQ virtualization removal for x86_32 next, but I want to issue an intermediate patch with the pending fixes first, given the potential for regression there is when messing with entry.S. However, I'll merge the EFLAGS fixes early on, since they are obviously required and right, and merge them along with 2.8-03 asap.

Actually, my latest patch is crap. 2.8-03 introduces a regression w/ CONFIG_PREEMPT. I'll revert this and provide a better approach.

Signature · 1 line
Philippe.