Skip to contentSkip to conversation

genirq: Remove the fits all and nothing __do_IRQ() code

RFC In review Thomas Gleixner 9 participants 25 messages Sep 8, 2010 – Sep 30, 2010

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 genirq: Remove the fits all and nothing __do_IRQ() code

__do_IRQ() has been deprecated after a two years migration phase in commit 0e57aa1. Since then another 18 month have gone by.

So here's the status three and a half years after the flow based infrastructure was merged:

The following architectures are fully converted to the new flow handler code:

arm, avr32, blackfin, frv, microblaze, mips, mn10300, powerpc, score, sh, sparc 64bit, tile, x86, xtensa

(avr32 and xtensa should set CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ though)

The following architectures are not using the generic interrupt infrastructure at all and are therefor unaffected:

s390, m68k, sparc 32bit

The following architectures are still using __do_IRQ():

alpha, cris, ia64, h8300, m32r, m68knommu, parisc, um

So now the question arises what to do with __do_IRQ().

Removing it would be the right thing, but that'll break 8 archs, so it's probably not considered a good idea, though for most of them the conversion should be reasonably trivial.

I'm happy to move that code into kernel/irq/cruft.c forever if there is no way to get the remaining users converted in the forseeable future. It looks like they can cope with the annoying build warning nicely.

Either that or moving everything what breaks into staging/arch/* and hand it over to GregKH :)

Thoughts ?

Not-Signed-off-by-yet: Thomas Gleixner <[email protected]>

---
 Documentation/DocBook/genericirq.tmpl      |   29 -------
 Documentation/feature-removal-schedule.txt |    8 --
 include/linux/irq.h                        |   20 -----
 kernel/irq/handle.c                        |  111 -----------------------------
 4 files changed, 2 insertions(+), 166 deletions(-)
Documentation/DocBook/genericirq.tmpl +0 -29
Index: linux-2.6/Documentation/DocBook/genericirq.tmpl
===================================================================
@@ -147,13 +147,6 @@
 	use a generic irq-flow implementation for 'level type' interrupts
 	and add a (sub)architecture specific 'edge type' implementation.
 	</para>
-	<para>
-	To make the transition to the new model easier and prevent the
-	breakage of existing implementations, the __do_IRQ() super-handler
-	is still available. This leads to a kind of duality for the time
-	being. Over time the new model should be used in more and more
-	architectures, as it enables smaller and cleaner IRQ subsystems.
-	</para>
   </chapter>
   <chapter id="bugs">
     <title>Known Bugs And Assumptions</title>
@@ -402,28 +395,6 @@ desc->chip->end();
     </sect1>
   </chapter>
 
-  <chapter id="doirq">
-     <title>__do_IRQ entry point</title>
-     <para>
- 	The original implementation __do_IRQ() is an alternative entry
-	point for all types of interrupts.
-     </para>
-     <para>
-	This handler turned out to be not suitable for all
-	interrupt hardware and was therefore reimplemented with split
-	functionality for egde/level/simple/percpu interrupts. This is not
-	only a functional optimization. It also shortens code paths for
-	interrupts.
-      </para>
-      <para>
-	To make use of the split implementation, replace the call to
-	__do_IRQ by a call to desc->handle_irq() and associate
-        the appropriate handler function to desc->handle_irq().
-	In most cases the generic handler implementations should
-	be sufficient.
-     </para>
-  </chapter>
-
   <chapter id="locking">
      <title>Locking on SMP</title>
      <para>
Documentation/feature-removal-schedule.txt +0 -8
Index: linux-2.6/Documentation/feature-removal-schedule.txt
===================================================================
@@ -315,14 +315,6 @@ Who:	Dave Jones <[email protected]>, Matt
 
 -----------------------------
 
-What:	__do_IRQ all in one fits nothing interrupt handler
-When:	2.6.32
-Why:	__do_IRQ was kept for easy migration to the type flow handlers.
-	More than two years of migration time is enough.
-Who:	Thomas Gleixner <[email protected]>
-
------------------------------
-
 What:	fakephp and associated sysfs files in /sys/bus/pci/slots/
 When:	2011
 Why:	In 2.6.27, the semantics of /sys/bus/pci/slots was redefined to
include/linux/irq.h +2 -18
Index: linux-2.6/include/linux/irq.h
===================================================================
@@ -150,7 +150,7 @@ struct irq_2_iommu;
  * @timer_rand_state:	pointer to timer rand state struct
  * @kstat_irqs:		irq stats per cpu
  * @irq_2_iommu:	iommu with this irq
- * @handle_irq:		highlevel irq-events handler [if NULL, __do_IRQ()]
+ * @handle_irq:		highlevel irq-events handler
  * @chip:		low level interrupt hardware access
  * @msi_desc:		MSI descriptor
  * @handler_data:	per-IRQ data for the irq_chip methods
@@ -294,28 +294,12 @@ extern void handle_bad_irq(unsigned int 
 extern void handle_nested_irq(unsigned int irq);
 
 /*
- * Monolithic do_IRQ implementation.
- */
-#ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
-extern unsigned int __do_IRQ(unsigned int irq);
-#endif
-
-/*
  * Architectures call this to let the generic IRQ layer
- * handle an interrupt. If the descriptor is attached to an
- * irqchip-style controller then we call the ->handle_irq() handler,
- * and it calls __do_IRQ() if it's attached to an irqtype-style controller.
+ * handle an interrupt.
  */
 static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc)
 {
-#ifdef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
 	desc->handle_irq(irq, desc);
-#else
-	if (likely(desc->handle_irq))
-		desc->handle_irq(irq, desc);
-	else
-		__do_IRQ(irq);
-#endif
 }
 
 static inline void generic_handle_irq(unsigned int irq)
kernel/irq/handle.c +0 -111

117 lines not on this page · raw message

#1 lore raw
Quoted 27 lines · Thomas Gleixner

plain text document attachment (genirq-troll-patch.patch) __do_IRQ() has been deprecated after a two years migration phase in commit 0e57aa1. Since then another 18 month have gone by.

So here's the status three and a half years after the flow based infrastructure was merged:

The following architectures are fully converted to the new flow handler code:

arm, avr32, blackfin, frv, microblaze, mips, mn10300, powerpc, score, sh, sparc 64bit, tile, x86, xtensa

(avr32 and xtensa should set CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ though)

The following architectures are not using the generic interrupt infrastructure at all and are therefor unaffected:

s390, m68k, sparc 32bit

The following architectures are still using __do_IRQ():

alpha, cris, ia64, h8300, m32r, m68knommu, parisc, um

So now the question arises what to do with __do_IRQ().

Quoted 8 lines

Removing it would be the right thing, but that'll break 8 archs, so it's probably not considered a good idea, though for most of them the conversion should be reasonably trivial.

I'm happy to move that code into kernel/irq/cruft.c forever if there is no way to get the remaining users converted in the forseeable future. It looks like they can cope with the annoying build warning nicely.

Well, if you're going to deprecate something that 8 architectures rely on, it would be nice to tell people ... or even just linux-arch ... most of us do read that. I've actually never noticed the warning the commit activated in any of my parisc compiles for some reason.

Quoted 4 lines

Either that or moving everything what breaks into staging/arch/* and hand it over to GregKH :)

Thoughts ?

We could move x86 into staging while it tries out the replacement ...

James

#2 lore raw
Quoted 32 lines · James Bottomley
Quoted 31 lines · Thomas Gleixner

plain text document attachment (genirq-troll-patch.patch) __do_IRQ() has been deprecated after a two years migration phase in commit 0e57aa1. Since then another 18 month have gone by.

So here's the status three and a half years after the flow based infrastructure was merged:

The following architectures are fully converted to the new flow handler code:

arm, avr32, blackfin, frv, microblaze, mips, mn10300, powerpc, score, sh, sparc 64bit, tile, x86, xtensa

(avr32 and xtensa should set CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ though)

The following architectures are not using the generic interrupt infrastructure at all and are therefor unaffected:

s390, m68k, sparc 32bit

The following architectures are still using __do_IRQ():

alpha, cris, ia64, h8300, m32r, m68knommu, parisc, um

So now the question arises what to do with __do_IRQ().

Removing it would be the right thing, but that'll break 8 archs, so it's probably not considered a good idea, though for most of them the conversion should be reasonably trivial.

Quoted 7 lines
Quoted 4 lines

I'm happy to move that code into kernel/irq/cruft.c forever if there is no way to get the remaining users converted in the forseeable future. It looks like they can cope with the annoying build warning nicely.

Well, if you're going to deprecate something that 8 architectures rely on, it would be nice to tell people ... or even just linux-arch ... most

It's been told people. The deprecation patch was on LKMl (I don't remember whether I sent it to linux-arch), but there were a bunch of related patches to clean out the old irq related cruft which were sent to linux-arch and also hit the parisc tree. There is an entry in feature-removal-schedule.txt for 18 month now.

Quoted 2 lines

of us do read that. I've actually never noticed the warning the commit activated in any of my parisc compiles for some reason.

CONFIG_ENABLE_WARN_DEPRECATED=y perhaps ?

I'm really tired of your whining when you did not get a personalized taylored to your needs info.

14 architectures got converted and some maintainers sent out mail to their users 18 month ago right after the deprecation patch was sent (www.linux-mips.org/archives/linux-mips/2009-03/msg00068.html), there were reviews of new architecture code on linux-arch where this was pointed out, so don't tell me that there was not enough information about this.

Quoted 6 lines
Quoted 4 lines

Either that or moving everything what breaks into staging/arch/* and hand it over to GregKH :)

Thoughts ?

We could move x86 into staging while it tries out the replacement ...

The replacement of what?

Thanks,

tglx

#3 lore raw
Quoted 38 lines · Thomas Gleixner
Quoted 37 lines · James Bottomley
Quoted 35 lines · Thomas Gleixner

plain text document attachment (genirq-troll-patch.patch) __do_IRQ() has been deprecated after a two years migration phase in commit 0e57aa1. Since then another 18 month have gone by.

So here's the status three and a half years after the flow based infrastructure was merged:

The following architectures are fully converted to the new flow handler code:

arm, avr32, blackfin, frv, microblaze, mips, mn10300, powerpc, score, sh, sparc 64bit, tile, x86, xtensa

(avr32 and xtensa should set CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ though)

The following architectures are not using the generic interrupt infrastructure at all and are therefor unaffected:

s390, m68k, sparc 32bit

The following architectures are still using __do_IRQ():

alpha, cris, ia64, h8300, m32r, m68knommu, parisc, um

So now the question arises what to do with __do_IRQ().

Removing it would be the right thing, but that'll break 8 archs, so it's probably not considered a good idea, though for most of them the conversion should be reasonably trivial.

I'm happy to move that code into kernel/irq/cruft.c forever if there is no way to get the remaining users converted in the forseeable future. It looks like they can cope with the annoying build warning nicely.

Quoted 5 lines
Quoted 2 lines

Well, if you're going to deprecate something that 8 architectures rely on, it would be nice to tell people ... or even just linux-arch ... most

It's been told people. The deprecation patch was on LKMl (I don't remember whether I sent it to linux-arch),

You didn't ... I checked.

Quoted 5 lines

but there were a bunch of
related patches to clean out the old irq related cruft which were sent to linux-arch and also hit the parisc tree. There is an entry in feature-removal-schedule.txt for 18 month now.

Quoted 7 lines
Quoted 2 lines

of us do read that. I've actually never noticed the warning the commit activated in any of my parisc compiles for some reason.

CONFIG_ENABLE_WARN_DEPRECATED=y perhaps ?

I'm really tired of your whining when you did not get a personalized taylored to your needs info.

So you send out deliberate flame bait and then suffer humour failure at an ironic reply?

Quoted 6 lines

14 architectures got converted and some maintainers sent out mail to their users 18 month ago right after the deprecation patch was sent (www.linux-mips.org/archives/linux-mips/2009-03/msg00068.html), there were reviews of new architecture code on linux-arch where this was pointed out, so don't tell me that there was not enough information about this.

Well, we could go round in circles over the cryptic nature of this indirection for ages, but I've got a wonderful target flame war to get back to, so why don't we just cut to the chase:

The missing information is what actually needs to be done. Fortunately, the documentation is here:

Documentation/DocBook/genericirq.tmpl

It gives a nice overview and describes what's needed. Basically you're replacing generic __do_IRQ() with an internal implementation tuned to specific handler types using the either generic library of handler functions in kernel/irq or something more hand crafted and chip specific.
.
James

#4 lore raw
Quoted 55 lines · James Bottomley
Quoted 38 lines · Thomas Gleixner
Quoted 37 lines · James Bottomley
Quoted 35 lines · Thomas Gleixner

plain text document attachment (genirq-troll-patch.patch) __do_IRQ() has been deprecated after a two years migration phase in commit 0e57aa1. Since then another 18 month have gone by.

So here's the status three and a half years after the flow based infrastructure was merged:

The following architectures are fully converted to the new flow handler code:

arm, avr32, blackfin, frv, microblaze, mips, mn10300, powerpc, score, sh, sparc 64bit, tile, x86, xtensa

(avr32 and xtensa should set CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ though)

The following architectures are not using the generic interrupt infrastructure at all and are therefor unaffected:

s390, m68k, sparc 32bit

The following architectures are still using __do_IRQ():

alpha, cris, ia64, h8300, m32r, m68knommu, parisc, um

So now the question arises what to do with __do_IRQ().

Removing it would be the right thing, but that'll break 8 archs, so it's probably not considered a good idea, though for most of them the conversion should be reasonably trivial.

I'm happy to move that code into kernel/irq/cruft.c forever if there is no way to get the remaining users converted in the forseeable future. It looks like they can cope with the annoying build warning nicely.

Quoted 5 lines
Quoted 2 lines

Well, if you're going to deprecate something that 8 architectures rely on, it would be nice to tell people ... or even just linux-arch ... most

It's been told people. The deprecation patch was on LKMl (I don't remember whether I sent it to linux-arch),

You didn't ... I checked.

Quoted 8 lines

but there were a bunch of
related patches to clean out the old irq related cruft which were sent to linux-arch and also hit the parisc tree. There is an entry in feature-removal-schedule.txt for 18 month now.

Quoted 2 lines

of us do read that. I've actually never noticed the warning the commit activated in any of my parisc compiles for some reason.

Quoted 7 lines
Quoted 4 lines

CONFIG_ENABLE_WARN_DEPRECATED=y perhaps ?

I'm really tired of your whining when you did not get a personalized taylored to your needs info.

So you send out deliberate flame bait and then suffer humour failure at an ironic reply?

Darn, I missed the ironic tag.

I added you to the "beware-of-british-irony" filter of my .procmailrc to avoid that in the future.

Thanks,

tglx

#5 lore raw
In reply to James Bottomley
Quoted 23 lines · James Bottomley
Quoted 13 lines · Thomas Gleixner

plain text document attachment (genirq-troll-patch.patch) __do_IRQ() has been deprecated after a two years migration phase in commit 0e57aa1. Since then another 18 month have gone by.

So here's the status three and a half years after the flow based infrastructure was merged:

 The following architectures are still using __do_IRQ():

  alpha, cris, ia64, h8300, m32r, m68knommu, parisc, um

So now the question arises what to do with __do_IRQ().

Quoted 8 lines

Removing it would be the right thing, but that'll break 8 archs, so it's probably not considered a good idea, though for most of them the conversion should be reasonably trivial.

I'm happy to move that code into kernel/irq/cruft.c forever if there is no way to get the remaining users converted in the forseeable future. It looks like they can cope with the annoying build warning nicely.

Quoted 4 lines

Well, if you're going to deprecate something that 8 architectures rely on, it would be nice to tell people ... or even just linux-arch ... most of us do read that.  I've actually never noticed the warning the commit activated in any of my parisc compiles for some reason.

the only reason Blackfin was converted quickly is because the code issues a warning (that has been there for a long time):

# warning __do_IRQ is deprecated. Please convert to proper flow handlers

so i guess you're saying that you disable the "ENABLE_WARN_DEPRECATED" option ? or you dont pay attention to warnings when compiling kernels ?
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-alpha" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
In reply to Thomas Gleixner
Quoted 6 lines · Thomas Gleixner

The following architectures are still using __do_IRQ():

alpha, cris, ia64, h8300, m32r, m68knommu, parisc, um

So now the question arises what to do with __do_IRQ().

Thanks Thomas for the reminder, I'll poke at fixing parisc this week, and maybe try to fix ia64 and alpha too as penance for forgetting about this for so long.

--Kyle

#7 lore raw
Quoted 3 lines

Thanks Thomas for the reminder, I'll poke at fixing parisc this week, and maybe try to fix ia64 and alpha too as penance for forgetting about this for so long.

I'll be happy to see ia64 converted ... I did look at it once a long time ago, but couldn't work out what I had to do to replace do_IRQ. If Kyle figures out the patch, I'll test. If not, then some pointers would be helpful.

-Tony

#8 lore raw
In reply to Thomas Gleixner

From CRIS perspective it is perfectly ok to remove __do_IRQ. At the latest when we notice that our build breaks we will fix it and preferably before that.

/Mikael

-----Original Message-----
From: Thomas Gleixner [mailto:[email protected]]
Sent: den 8 september 2010 20:14
To: LKML
Cc: Linus Torvalds; Andrew Morton; Ingo Molnar; Peter Zijlstra; Christoph Hellwig; [email protected]; linux-cris-kernel; Haavard Skinnemoen; Tony Luck; [email protected]; Yoshinori Sato; Hirokazu Takata; Greg Ungerer; Jeff Dike; [email protected]; Chris Zankel; [email protected]
Subject: [RFC trollpatch 1/1] genirq: Remove the fits all and nothing __do_IRQ() code

__do_IRQ() has been deprecated after a two years migration phase in commit 0e57aa1. Since then another 18 month have gone by.

So here's the status three and a half years after the flow based infrastructure was merged:

The following architectures are fully converted to the new flow handler code:

arm, avr32, blackfin, frv, microblaze, mips, mn10300, powerpc, score, sh, sparc 64bit, tile, x86, xtensa

(avr32 and xtensa should set CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ though)

The following architectures are not using the generic interrupt infrastructure at all and are therefor unaffected:

s390, m68k, sparc 32bit

The following architectures are still using __do_IRQ():

alpha, cris, ia64, h8300, m32r, m68knommu, parisc, um

So now the question arises what to do with __do_IRQ().

Removing it would be the right thing, but that'll break 8 archs, so it's probably not considered a good idea, though for most of them the conversion should be reasonably trivial.

I'm happy to move that code into kernel/irq/cruft.c forever if there is no way to get the remaining users converted in the forseeable future. It looks like they can cope with the annoying build warning nicely.

Either that or moving everything what breaks into staging/arch/* and hand it over to GregKH :)

Thoughts ?

Not-Signed-off-by-yet: Thomas Gleixner <[email protected]>

---
 Documentation/DocBook/genericirq.tmpl      |   29 -------
 Documentation/feature-removal-schedule.txt |    8 --
 include/linux/irq.h                        |   20 -----
 kernel/irq/handle.c                        |  111 -----------------------------
 4 files changed, 2 insertions(+), 166 deletions(-)
Documentation/DocBook/genericirq.tmpl +0 -29
Index: linux-2.6/Documentation/DocBook/genericirq.tmpl
===================================================================
@@ -147,13 +147,6 @@
 	use a generic irq-flow implementation for 'level type' interrupts
 	and add a (sub)architecture specific 'edge type' implementation.
 	</para>
-	<para>
-	To make the transition to the new model easier and prevent the
-	breakage of existing implementations, the __do_IRQ() super-handler
-	is still available. This leads to a kind of duality for the time
-	being. Over time the new model should be used in more and more
-	architectures, as it enables smaller and cleaner IRQ subsystems.
-	</para>
   </chapter>
   <chapter id="bugs">
     <title>Known Bugs And Assumptions</title>
@@ -402,28 +395,6 @@ desc->chip->end();
     </sect1>
   </chapter>
 
-  <chapter id="doirq">
-     <title>__do_IRQ entry point</title>
-     <para>
- 	The original implementation __do_IRQ() is an alternative entry
-	point for all types of interrupts.
-     </para>
-     <para>
-	This handler turned out to be not suitable for all
-	interrupt hardware and was therefore reimplemented with split
-	functionality for egde/level/simple/percpu interrupts. This is not
-	only a functional optimization. It also shortens code paths for
-	interrupts.
-      </para>
-      <para>
-	To make use of the split implementation, replace the call to
-	__do_IRQ by a call to desc->handle_irq() and associate
-        the appropriate handler function to desc->handle_irq().
-	In most cases the generic handler implementations should
-	be sufficient.
-     </para>
-  </chapter>
-
   <chapter id="locking">
      <title>Locking on SMP</title>
      <para>
Documentation/feature-removal-schedule.txt +0 -8
Index: linux-2.6/Documentation/feature-removal-schedule.txt
===================================================================
@@ -315,14 +315,6 @@ Who:	Dave Jones <[email protected]>, Matt
 
 -----------------------------
 
-What:	__do_IRQ all in one fits nothing interrupt handler
-When:	2.6.32
-Why:	__do_IRQ was kept for easy migration to the type flow handlers.
-	More than two years of migration time is enough.
-Who:	Thomas Gleixner <[email protected]>
-
------------------------------
-
 What:	fakephp and associated sysfs files in /sys/bus/pci/slots/
 When:	2011
 Why:	In 2.6.27, the semantics of /sys/bus/pci/slots was redefined to
include/linux/irq.h +2 -18
Index: linux-2.6/include/linux/irq.h
===================================================================
@@ -150,7 +150,7 @@ struct irq_2_iommu;
  * @timer_rand_state:	pointer to timer rand state struct
  * @kstat_irqs:		irq stats per cpu
  * @irq_2_iommu:	iommu with this irq
- * @handle_irq:		highlevel irq-events handler [if NULL, __do_IRQ()]
+ * @handle_irq:		highlevel irq-events handler
  * @chip:		low level interrupt hardware access
  * @msi_desc:		MSI descriptor
  * @handler_data:	per-IRQ data for the irq_chip methods
@@ -294,28 +294,12 @@ extern void handle_bad_irq(unsigned int 
 extern void handle_nested_irq(unsigned int irq);
 
 /*
- * Monolithic do_IRQ implementation.
- */
-#ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
-extern unsigned int __do_IRQ(unsigned int irq);
-#endif
-
-/*
  * Architectures call this to let the generic IRQ layer
- * handle an interrupt. If the descriptor is attached to an
- * irqchip-style controller then we call the ->handle_irq() handler,
- * and it calls __do_IRQ() if it's attached to an irqtype-style controller.
+ * handle an interrupt.
  */
 static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc)
 {
-#ifdef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
 	desc->handle_irq(irq, desc);
-#else
-	if (likely(desc->handle_irq))
-		desc->handle_irq(irq, desc);
-	else
-		__do_IRQ(irq);
-#endif
 }
 
 static inline void generic_handle_irq(unsigned int irq)
kernel/irq/handle.c +0 -110

113 lines not on this page · raw message

#9 lore raw

---------- Original Message -----------
From: Mikael Starvik <[email protected]>
To: Thomas Gleixner <[email protected]>, LKML <linux-k

Quoted 15 lines

The following architectures are still using __do_IRQ():

alpha, cris, ia64, h8300, m32r, m68knommu, parisc, um

So now the question arises what to do with __do_IRQ().

Removing it would be the right thing, but that'll break 8 archs, so it's probably not considered a good idea, though for most of them the conversion should be reasonably trivial.

I'm happy to move that code into kernel/irq/cruft.c forever if there is no way to get the remaining users converted in the forseeable future. It looks like they can cope with the annoying build warning nicely.

Quoted 4 lines

Either that or moving everything what breaks into staging/arch/* and hand it over to GregKH :)

Thoughts ?

To the lists:

My thought is, put something in the readme - like Jay Estabrook's note in the current Alpha Core build. At least so those of us who get wierd msgs during a kernel build can know what they are all about.

TIA

jn

#10 lore raw
In reply to Thomas Gleixner
Quoted 15 lines · Thomas Gleixner

__do_IRQ() has been deprecated after a two years migration phase in commit 0e57aa1. Since then another 18 month have gone by.

So here's the status three and a half years after the flow based infrastructure was merged:

The following architectures are fully converted to the new flow handler code:

arm, avr32, blackfin, frv, microblaze, mips, mn10300, powerpc, score, sh, sparc 64bit, tile, x86, xtensa

(avr32 and xtensa should set CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ though)

Quoted 8 lines

The following architectures are not using the generic interrupt infrastructure at all and are therefor unaffected:

s390, m68k, sparc 32bit

The following architectures are still using __do_IRQ():

alpha, cris, ia64, h8300, m32r, m68knommu, parisc, um

The m68knommu arch should be easy to fix up. Here is a first pass patch. Tested and working on 1 board so far. I need to check all the processor types, and test a few more to be sure :-)

Regards
Greg

Signature · 5 lines
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com

m68knommu: stop using __do_IRQ

The use of __do_IRQ is deprecated, so lets stop using it. Generally the interrupts on the supported processors here are level triggered, so this is strait forward to switch over to using the standard handle_level_irq flow handler.

---
 arch/m68knommu/Kconfig                       |    4 ++++
 arch/m68knommu/platform/5272/intc.c          |    1 +
 arch/m68knommu/platform/68328/ints.c         |    1 +
 arch/m68knommu/platform/68360/ints.c         |    1 +
 arch/m68knommu/platform/coldfire/intc-2.c    |    1 +
 arch/m68knommu/platform/coldfire/intc-simr.c |    1 +
 arch/m68knommu/platform/coldfire/intc.c      |    1 +
 7 files changed, 10 insertions(+), 0 deletions(-)
arch/m68knommu/Kconfig +4 -0
index 2609c39..fd28178 100644
@@ -59,6 +59,10 @@ config GENERIC_HARDIRQS
 	bool
 	default y
 
+config GENERIC_HARDIRQS_NO__DO_IRQ
+	bool
+	default y
+
 config GENERIC_CALIBRATE_DELAY
 	bool
 	default y
arch/m68knommu/platform/5272/intc.c +1 -0
index 7081e0a..e9da6f1 100644
@@ -133,6 +133,7 @@ void __init init_IRQ(void)
 		irq_desc[irq].depth = 1;
 		irq_desc[irq].chip = &intc_irq_chip;
 		intc_irq_set_type(irq, 0);
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
arch/m68knommu/platform/68328/ints.c +1 -0
index b91ee85..90516ee 100644
@@ -183,6 +183,7 @@ void __init init_IRQ(void)
 		irq_desc[i].action = NULL;
 		irq_desc[i].depth = 1;
 		irq_desc[i].chip = &intc_irq_chip;
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
arch/m68knommu/platform/68360/ints.c +1 -0
index 6f22970..cdf691e 100644
@@ -136,6 +136,7 @@ void init_IRQ(void)
 		irq_desc[i].action = NULL;
 		irq_desc[i].depth = 1;
 		irq_desc[i].chip = &intc_irq_chip;
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
arch/m68knommu/platform/coldfire/intc-2.c +1 -0
index 5598c8b..6410f7e 100644
@@ -88,6 +88,7 @@ void __init init_IRQ(void)
 		irq_desc[irq].action = NULL;
 		irq_desc[irq].depth = 1;
 		irq_desc[irq].chip = &intc_irq_chip;
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
arch/m68knommu/platform/coldfire/intc-simr.c +1 -0
index 1b01e79..7f4abb3 100644
@@ -73,6 +73,7 @@ void __init init_IRQ(void)
 		irq_desc[irq].depth = 1;
 		irq_desc[irq].chip = &intc_irq_chip;
 		intc_irq_set_type(irq, 0);
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
arch/m68knommu/platform/coldfire/intc.c +1 -0
index a4560c8..40b9e8d 100644
@@ -148,6 +148,7 @@ void __init init_IRQ(void)
 		irq_desc[irq].depth = 1;
 		irq_desc[irq].chip = &intc_irq_chip;
 		intc_irq_set_type(irq, 0);
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
#11 lore raw
Quoted 4 lines · Greg Ungerer

The m68knommu arch should be easy to fix up. Here is a first pass patch. Tested and working on 1 board so far. I need to check all the processor types, and test a few more to be sure :-)

Dunno if you noticed, Greg, but you've already had a removal patch submitted some time ago...

Date: Wed, 16 Dec 2009 19:15:39 -0800
From: Steven King <[email protected]>
To: Greg Ungerer <[email protected]>
Subject: [PATCH] m68knommu: get rid of __do_IRQ and add support for
using gpio irqs.

(noticed this while searching for __do_IRQ related stuff in my email last night.)

regards, Kyle

Quoted 116 lines

Regards
Greg

Signature · 23 lines
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com

m68knommu: stop using __do_IRQ

The use of __do_IRQ is deprecated, so lets stop using it.
Generally the interrupts on the supported processors here are
level triggered, so this is strait forward to switch over to
using the standard handle_level_irq flow handler.

Signed-off-by: Greg Ungerer <[email protected]>
---
 arch/m68knommu/Kconfig                       |    4 ++++
 arch/m68knommu/platform/5272/intc.c          |    1 +
 arch/m68knommu/platform/68328/ints.c         |    1 +
 arch/m68knommu/platform/68360/ints.c         |    1 +
 arch/m68knommu/platform/coldfire/intc-2.c    |    1 +
 arch/m68knommu/platform/coldfire/intc-simr.c |    1 +
 arch/m68knommu/platform/coldfire/intc.c      |    1 +
 7 files changed, 10 insertions(+), 0 deletions(-)
arch/m68knommu/Kconfig +4 -0
index 2609c39..fd28178 100644
@@ -59,6 +59,10 @@ config GENERIC_HARDIRQS
 	bool
 	default y
 
+config GENERIC_HARDIRQS_NO__DO_IRQ
+	bool
+	default y
+
 config GENERIC_CALIBRATE_DELAY
 	bool
 	default y
arch/m68knommu/platform/5272/intc.c +1 -0
index 7081e0a..e9da6f1 100644
@@ -133,6 +133,7 @@ void __init init_IRQ(void)
 		irq_desc[irq].depth = 1;
 		irq_desc[irq].chip = &intc_irq_chip;
 		intc_irq_set_type(irq, 0);
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
arch/m68knommu/platform/68328/ints.c +1 -0
index b91ee85..90516ee 100644
@@ -183,6 +183,7 @@ void __init init_IRQ(void)
 		irq_desc[i].action = NULL;
 		irq_desc[i].depth = 1;
 		irq_desc[i].chip = &intc_irq_chip;
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
arch/m68knommu/platform/68360/ints.c +1 -0
index 6f22970..cdf691e 100644
@@ -136,6 +136,7 @@ void init_IRQ(void)
 		irq_desc[i].action = NULL;
 		irq_desc[i].depth = 1;
 		irq_desc[i].chip = &intc_irq_chip;
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
arch/m68knommu/platform/coldfire/intc-2.c +1 -0
index 5598c8b..6410f7e 100644
@@ -88,6 +88,7 @@ void __init init_IRQ(void)
 		irq_desc[irq].action = NULL;
 		irq_desc[irq].depth = 1;
 		irq_desc[irq].chip = &intc_irq_chip;
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
arch/m68knommu/platform/coldfire/intc-simr.c +1 -0
index 1b01e79..7f4abb3 100644
@@ -73,6 +73,7 @@ void __init init_IRQ(void)
 		irq_desc[irq].depth = 1;
 		irq_desc[irq].chip = &intc_irq_chip;
 		intc_irq_set_type(irq, 0);
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
arch/m68knommu/platform/coldfire/intc.c +1 -0
index a4560c8..40b9e8d 100644
@@ -148,6 +148,7 @@ void __init init_IRQ(void)
 		irq_desc[irq].depth = 1;
 		irq_desc[irq].chip = &intc_irq_chip;
 		intc_irq_set_type(irq, 0);
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
#12 lore raw

Hi Kyle,

Quoted 8 lines · Kyle McMartin
Quoted 4 lines · Greg Ungerer

The m68knommu arch should be easy to fix up. Here is a first pass patch. Tested and working on 1 board so far. I need to check all the processor types, and test a few more to be sure :-)

Dunno if you noticed, Greg, but you've already had a removal patch submitted some time ago...

I had forgotten about that patch... But if you follow the email trail I had to drop it soon after, it caused user space to lock up. I let Steven know (in that same thread) but he never came back with any fixes/updates.

(That patch also added support for edge triggered GPIO interrupts, and that may well have been the source of the problems).

Thanks
Greg

Quoted 126 lines

Date: Wed, 16 Dec 2009 19:15:39 -0800 From: Steven King <[email protected]> To: Greg Ungerer <[email protected]> Subject: [PATCH] m68knommu: get rid of __do_IRQ and add support for
using gpio irqs.

(noticed this while searching for __do_IRQ related stuff in my email last night.)

regards, Kyle

Quoted 116 lines

Regards
Greg

Signature · 23 lines
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com

m68knommu: stop using __do_IRQ

The use of __do_IRQ is deprecated, so lets stop using it.
Generally the interrupts on the supported processors here are
level triggered, so this is strait forward to switch over to
using the standard handle_level_irq flow handler.

Signed-off-by: Greg Ungerer <[email protected]>
---
 arch/m68knommu/Kconfig                       |    4 ++++
 arch/m68knommu/platform/5272/intc.c          |    1 +
 arch/m68knommu/platform/68328/ints.c         |    1 +
 arch/m68knommu/platform/68360/ints.c         |    1 +
 arch/m68knommu/platform/coldfire/intc-2.c    |    1 +
 arch/m68knommu/platform/coldfire/intc-simr.c |    1 +
 arch/m68knommu/platform/coldfire/intc.c      |    1 +
 7 files changed, 10 insertions(+), 0 deletions(-)
arch/m68knommu/Kconfig +4 -0
index 2609c39..fd28178 100644
@@ -59,6 +59,10 @@ config GENERIC_HARDIRQS
 	bool
 	default y
 
+config GENERIC_HARDIRQS_NO__DO_IRQ
+	bool
+	default y
+
 config GENERIC_CALIBRATE_DELAY
 	bool
 	default y
arch/m68knommu/platform/5272/intc.c +1 -0
index 7081e0a..e9da6f1 100644
@@ -133,6 +133,7 @@ void __init init_IRQ(void)
 		irq_desc[irq].depth = 1;
 		irq_desc[irq].chip = &intc_irq_chip;
 		intc_irq_set_type(irq, 0);
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
arch/m68knommu/platform/68328/ints.c +1 -0
index b91ee85..90516ee 100644
@@ -183,6 +183,7 @@ void __init init_IRQ(void)
 		irq_desc[i].action = NULL;
 		irq_desc[i].depth = 1;
 		irq_desc[i].chip = &intc_irq_chip;
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
arch/m68knommu/platform/68360/ints.c +1 -0
index 6f22970..cdf691e 100644
@@ -136,6 +136,7 @@ void init_IRQ(void)
 		irq_desc[i].action = NULL;
 		irq_desc[i].depth = 1;
 		irq_desc[i].chip = &intc_irq_chip;
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
arch/m68knommu/platform/coldfire/intc-2.c +1 -0
index 5598c8b..6410f7e 100644
@@ -88,6 +88,7 @@ void __init init_IRQ(void)
 		irq_desc[irq].action = NULL;
 		irq_desc[irq].depth = 1;
 		irq_desc[irq].chip = &intc_irq_chip;
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
arch/m68knommu/platform/coldfire/intc-simr.c +1 -0
index 1b01e79..7f4abb3 100644
@@ -73,6 +73,7 @@ void __init init_IRQ(void)
 		irq_desc[irq].depth = 1;
 		irq_desc[irq].chip = &intc_irq_chip;
 		intc_irq_set_type(irq, 0);
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
arch/m68knommu/platform/coldfire/intc.c +1 -0
index a4560c8..40b9e8d 100644
@@ -148,6 +148,7 @@ void __init init_IRQ(void)
 		irq_desc[irq].depth = 1;
 		irq_desc[irq].chip = &intc_irq_chip;
 		intc_irq_set_type(irq, 0);
+		set_irq_handler(irq, handle_level_irq);
 	}
 }
 
Signature · 5 lines
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com
#13 lore raw
In reply to Thomas Gleixner
Quoted 3 lines · Thomas Gleixner

 The following architectures are still using __do_IRQ():

 alpha, cris, ia64, h8300, m32r, m68knommu, parisc, um

Thomas,

I (belatedly) took a look at fixing ia64 ... but I've run into a small snag. The __do_IRQ() routine makes a call to:

desc->chip->end(irq);

while neither of the "handle_level_irq()" nor "handle_edge_irq()" functions do this.

On ia64 iosapic_end_level_irq() call iosapic_eoi() for me. Without it my system hangs during boot (with some driver timeout complaining about dropped interrupts).

Is the omission of desc->chip->end(irq); deliberate? In which case I need to find another place to call iosapic_eoi(). Or is it accidental?

Thanks

-Tony

#14 lore raw
Quoted 15 lines · Tony Luck
Quoted 3 lines · Thomas Gleixner

 The following architectures are still using __do_IRQ():

 alpha, cris, ia64, h8300, m32r, m68knommu, parisc, um

Thomas,

I (belatedly) took a look at fixing ia64 ... but I've run into a small snag. The __do_IRQ() routine makes a call to:

desc->chip->end(irq);

while neither of the "handle_level_irq()" nor "handle_edge_irq()" functions do this.

Quoted 6 lines

On ia64 iosapic_end_level_irq() call iosapic_eoi() for me. Without it my system hangs during boot (with some driver timeout complaining about dropped interrupts).

Is the omission of desc->chip->end(irq); deliberate? In which case I need to find another place to call iosapic_eoi(). Or is it accidental?

No, it's deliberate. The solution is to use the correct flow handler for your device. We have currently several flow handlers implemented:

    handle_level_irq
	{
		if (chip->mask_ack)
			chip->mask_ack()
		else {
		     chip->mask();
		     if (chip->ack)
		     	chip->ack();
		}

		....

		chip->unmask();
	}

    handle_edge_irq
	{
		chip->ack()

		...
	}

    handle_simple_irq
	{
		...
	}

    handle_fasteoi_irq
	{
		...
		chip->eoi();
	}

    handle_percpu_irq
	{	
		if (chip->ack)
		     	chip->ack();
		
		if (chip->eoi)
		     	chip->eoi();
	}

Note, that handle_percpu_irq does not take the irq_desc->lock.

So the trick is to select the matching handler and have separate irq chip implementations if necessary.

Hope that helps.

Thanks,

tglx

#15 lore raw
Quoted 2 lines

No, it's deliberate. The solution is to use the correct flow handler for your device. We have currently several flow handlers implemented:

Yes, I found the different "handle_*_irq()" functions. The _percpu_ variant works fine for the ia64 per-cpu interrupt paths.

But *NONE* of them call desc->chip->end() (even though the code flow in Documentation/DcoBook/genericirq.tmpl says that three of them do call it]. So it appears that this was thought to be necessary when the docs were written, but was not put into the code.

The ia64 chip->end function for edge triggered interrupts is a nop(), so handle_edge_irq() ought to work just fine for it [can't confirm from my initial tests because the HP box I'm using only has level triggered ones].

handle_level_irq() works for my level triggered interrupts if I add a "desc->chip->end(irq)" call to it.

git grep "chip->end" appears to show that the only use of chip->end is in the "Recovery handler for misrouted interrupts": try_one_irq()

At minimum we seem to have some documentation inconsistencies with the code.

-Tony

#16 lore raw
Quoted 10 lines · Tony
Quoted 2 lines

No, it's deliberate. The solution is to use the correct flow handler for your device. We have currently several flow handlers implemented:

Yes, I found the different "handle_*_irq()" functions. The _percpu_ variant works fine for the ia64 per-cpu interrupt paths.

But *NONE* of them call desc->chip->end() (even though the code flow in Documentation/DcoBook/genericirq.tmpl says that three of them do call it]. So it appears that this was thought to be necessary when the docs were written, but was not put into the code.

Yeah, sorry.

Quoted 7 lines

The ia64 chip->end function for edge triggered interrupts is a nop(), so handle_edge_irq() ought to work just fine for it [can't confirm from my initial tests because the HP box I'm using only has level triggered ones].

handle_level_irq() works for my level triggered interrupts if I add a "desc->chip->end(irq)" call to it.

Hmm, why isn't chip->unmask() sufficient ?

Quoted 2 lines

git grep "chip->end" appears to show that the only use of chip->end is in the "Recovery handler for misrouted interrupts": try_one_irq()

Right, that's just due to the old __do_IRQ() compability.

Quoted 2 lines

At minimum we seem to have some documentation inconsistencies with the code.

Will fix.

Thanks,

tglx

#17 lore raw
Quoted 4 lines
Quoted 2 lines

handle_level_irq() works for my level triggered interrupts if I add a "desc->chip->end(irq)" call to it.

Hmm, why isn't chip->unmask() sufficient ?

That's a good question. I'll take a look at what ia64 is doing in the ->unmask() and ->end() functions to see if I can fix this with some code shuffling.

Thanks

-Tony

#18 lore raw
Quoted 6 lines · Tony
Quoted 1 line

Hmm, why isn't chip->unmask() sufficient ?

That's a good question. I'll take a look at what ia64 is doing in the ->unmask() and ->end() functions to see if I can fix this with some code shuffling.

Did you end up solving this? ia64 iosapic and parisc iosapic still look fairly similar... I hit the same issue of ->end() not being called in the handle_level_irq path and ended up just folding in the missing bit to ->unmask (we were already EOI the IOSAPIC, but missing the EOI for the parisc cpu.)

--Kyle

#19 lore raw
Quoted 5 lines

Did you end up solving this? ia64 iosapic and parisc iosapic still look fairly similar... I hit the same issue of ->end() not being called in the handle_level_irq path and ended up just folding in the missing bit to ->unmask (we were already EOI the IOSAPIC, but missing the EOI for the parisc cpu.)

Kyle,

Yes. Take a look in today's linux-next kernel (tag next-20100929) for commit: 5d4bff94f9e0877a85b4dc573eb7a3f1d97c13ae

Essentially I just added an "unmask_irq()" call into the ->end routine, renamed it, and used it as ->unmask.

It seems to work okay - I tried migrating interrupts around by poking at /proc/irq/NNN/smp_affinity - and that still works.

-Tony

#20 lore raw
Quoted 6 lines · Tony

Yes. Take a look in today's linux-next kernel (tag next-20100929) for commit: 5d4bff94f9e0877a85b4dc573eb7a3f1d97c13ae

Essentially I just added an "unmask_irq()" call into the ->end routine, renamed it, and used it as ->unmask.

Ahh, cool, glad to hear it.

--Kyle

Quoted 5 lines

It seems to work okay - I tried migrating interrupts around by poking at /proc/irq/NNN/smp_affinity - and that still works.

-Tony

#21 lore raw
In reply to Thomas Gleixner
Quoted 5 lines · Thomas Gleixner

__do_IRQ() has been deprecated after a two years migration phase in The following architectures are still using __do_IRQ():

 alpha, cris, ia64, h8300, m32r, m68knommu, parisc, um

Maybe I'm naive but shouldn't this path work?
Does um need some extra work?

The linux executable aborts immediately when I apply my patch.

---cut---
Locating the bottom of the address space ... 0x10000 Locating the top of the address space ... 0xc0000000 Core dump limits :
soft - 0
hard - NONE
Checking that ptrace can change system call numbers...OK Checking syscall emulation patch for ptrace...OK Checking advanced syscall emulation patch for ptrace...OK Checking for tmpfs mount on /dev/shm...nothing mounted on /dev/shm Checking PROT_EXEC mmap in /tmp/...OK
Checking for the skas3 patch in the host:
- /proc/mm...not found: No such file or directory
- PTRACE_FAULTINFO...not found
- PTRACE_LDT...not found
UML running in SKAS0 mode
Aborted
---cut---

arch/um/Kconfig.um +5 -0
index ec2b8da..ae950e0 100644
@@ -147,3 +147,8 @@ config KERNEL_STACK_ORDER
          This option determines the size of UML kernel stacks.  They will
          be 1 << order pages.  The default is OK unless you're running Valgrind
          on UML, in which case, set this to 3.
+
+config GENERIC_HARDIRQS_NO__DO_IRQ
+       def_bool y
+
+
arch/um/kernel/irq.c +1 -1
index a3f0b04..3d44535 100644
@@ -334,7 +334,7 @@ unsigned int do_IRQ(int irq, struct uml_pt_regs *regs)
 {
        struct pt_regs *old_regs = set_irq_regs((struct pt_regs *)regs);
        irq_enter();
-       __do_IRQ(irq);
+       generic_handle_irq(irq);
        irq_exit();
        set_irq_regs(old_regs);
        return 1;

--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#22 lore raw
Quoted 9 lines · richard -rw- weinberger
Quoted 5 lines · Thomas Gleixner

__do_IRQ() has been deprecated after a two years migration phase in The following architectures are still using __do_IRQ():

 alpha, cris, ia64, h8300, m32r, m68knommu, parisc, um

Maybe I'm naive but shouldn't this path work?
Does um need some extra work?

Yes. It needs to set the proper flow handlers. Look for set_irq_chip* functions and how they are used in other archs.

Thanks,

tglx

#23 lore raw
In reply to Thomas Gleixner
Quoted 9 lines · Thomas Gleixner

__do_IRQ() has been deprecated after a two years migration phase in commit 0e57aa1. Since then another 18 month have gone by.

The following architectures are still using __do_IRQ():

alpha, cris, ia64, h8300, m32r, m68knommu, parisc, um

So now the question arises what to do with __do_IRQ().

In penance while I finish testing what I can on parisc this week (conversion is done, I just need to find time to plug in ancient crap
and see if it still handles interrupts...) I've killed __do_IRQ on
cris. Sort of. I have no idea if it builds or anything, but it was pretty low-hanging fruit since it does all its own masking in its entry point, so as near as I can tell, aside from disabling spurious irqs, none of the irq_chip handlers aside from affinity are needed on cris.

(Since it's masking/unmasking itself, it looks like handle_simple_irq
will work for the common irqs, and on v32 we can use handle_percpu_irq for the timer and ipi.)

Visual compilation at least gives me a logical flow that seems generally sensible.

I'd appreciate a second pair of eyes, and if it's ok, I'll clean it up and submit it.

regards, Kyle

---

 arch-v10/kernel/irq.c |   26 +++++---------------------
 arch-v32/kernel/irq.c |   49 ++++++++++++-------------------------------------
 kernel/irq.c          |    2 +-
 3 files changed, 18 insertions(+), 59 deletions(-)
arch/cris/arch-v10/kernel/irq.c +5 -21
index a0c0df8..07f17ce 100644
@@ -104,16 +104,6 @@ static void (*interrupt[NR_IRQS])(void) = {
 	IRQ31_interrupt
 };
 
-static void enable_crisv10_irq(unsigned int irq);
-
-static unsigned int startup_crisv10_irq(unsigned int irq)
-{
-	enable_crisv10_irq(irq);
-	return 0;
-}
-
-#define shutdown_crisv10_irq	disable_crisv10_irq
-
 static void enable_crisv10_irq(unsigned int irq)
 {
 	crisv10_unmask_irq(irq);
@@ -124,22 +114,16 @@ static void disable_crisv10_irq(unsigned int irq)
 	crisv10_mask_irq(irq);
 }
 
-static void ack_crisv10_irq(unsigned int irq)
-{
-}
-
-static void end_crisv10_irq(unsigned int irq)
+static void crisv10_noop(unsigned int irq)
 {
 }
 
 static struct irq_chip crisv10_irq_type = {
 	.name =        "CRISv10",
-	.startup =     startup_crisv10_irq,
-	.shutdown =    shutdown_crisv10_irq,
-	.enable =      enable_crisv10_irq,
+	.unmask =      enable_crisv10_irq,
+	.mask =        disable_crisv10_irq,
 	.disable =     disable_crisv10_irq,
-	.ack =         ack_crisv10_irq,
-	.end =         end_crisv10_irq,
+	.ack =         crisv10_noop,
 	.set_affinity = NULL
 };
 
@@ -221,7 +205,7 @@ init_IRQ(void)
 
 	/* Initialize IRQ handler descriptors. */
 	for(i = 2; i < NR_IRQS; i++) {
-		irq_desc[i].chip = &crisv10_irq_type;
+		set_irq_chip_and_handler(i, &crisv10_irq_type, handle_simple_irq);
 		set_int_vector(i, interrupt[i]);
 	}
 
arch/cris/arch-v32/kernel/irq.c +12 -37

77 lines not on this page · raw message

arch/cris/kernel/irq.c +1 -1
index 469f7f9..14d9ce9 100644
@@ -93,7 +93,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
 		printk("do_IRQ: stack overflow: %lX\n", sp);
 		show_stack(NULL, (unsigned long *)sp);
 	}
-	__do_IRQ(irq);
+	generic_handle_irq(irq);
         irq_exit();
 	set_irq_regs(old_regs);
 }
#24 lore raw
Quoted 3 lines · Kyle McMartin

I'd appreciate a second pair of eyes, and if it's ok, I'll clean it up and submit it.

Let's do h8300 while we're at it, since that also /looks/ trivial... (probably famous last words.)

No idea if it's edge or level or what, but given the handlers that would be called in the __do_IRQ patch, handle_edge_irq seems most sensible.

Executive summary: kill implied .ack = NULL, rename enable to unmask, kill empty .end since dummy_irq_chip.end will suit us fine. Kill some unneeded irq_desc initializers that are also implicit...

Again, if someone could build/boot/whatever test this, that would be fantastic, and I'll add their Tested-by and submit.

--kyle

---
 irq.c |   16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
arch/h8300/kernel/irq.c +4 -12
index c25dc2c..acdbc07 100644
@@ -50,10 +50,6 @@ static void h8300_disable_irq(unsigned int irq)
 		IER_REGS &= ~(1 << (irq - EXT_IRQ0));
 }
 
-static void h8300_end_irq(unsigned int irq)
-{
-}
-
 static unsigned int h8300_startup_irq(unsigned int irq)
 {
 	if (is_ext_irq(irq))
@@ -75,10 +71,9 @@ struct irq_chip h8300irq_chip = {
 	.name		= "H8300-INTC",
 	.startup	= h8300_startup_irq,
 	.shutdown	= h8300_shutdown_irq,
-	.enable		= h8300_enable_irq,
+	.unmask		= h8300_enable_irq,
+	.mask		= h8300_disable_irq,
 	.disable	= h8300_disable_irq,
-	.ack		= NULL,
-	.end		= h8300_end_irq,
 };
 
 #if defined(CONFIG_RAMKERNEL)
@@ -161,17 +156,14 @@ void __init init_IRQ(void)
 	setup_vector();
 
 	for (c = 0; c < NR_IRQS; c++) {
-		irq_desc[c].status = IRQ_DISABLED;
-		irq_desc[c].action = NULL;
-		irq_desc[c].depth = 1;
-		irq_desc[c].chip = &h8300irq_chip;
+		set_irq_chip_and_handler(c, &h8300_irq_chip, handle_edge_irq);
 	}
 }
 
 asmlinkage void do_IRQ(int irq)
 {
 	irq_enter();
-	__do_IRQ(irq);
+	generic_handle_irq(irq);
 	irq_exit();
 }