linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] irq_domain: Centralize definition of irq_dispose_mapping()
@ 2012-02-24 16:54 Grant Likely
  2012-02-24 16:54 ` [PATCH 2/2] mfd: twl-core: Add IRQ_DOMAIN dependency Grant Likely
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Grant Likely @ 2012-02-24 16:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: Grant Likely, Rob Herring, David S. Miller, Jonas Bonn,
	sparclinux, linux

Several architectures define their own empty irq_dispose_mapping().  Since
the irq_domain code is centralized now, there is little need to do so.  This
patch removes them and creates a new empty copy when !CONFIG_IRQ_DOMAIN is
selected.

The patch also means that IRQ_DOMAIN becomes selectable on all architectures.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: sparclinux@vger.kernel.org
Cc: linux@lists.openrisc.net
---
 arch/openrisc/include/asm/prom.h |   10 +---------
 arch/sparc/include/asm/prom.h    |   10 +---------
 include/linux/irqdomain.h        |    5 ++++-
 include/linux/of_irq.h           |    4 +---
 4 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/arch/openrisc/include/asm/prom.h b/arch/openrisc/include/asm/prom.h
index e1f3fe2..bbb34e5 100644
--- a/arch/openrisc/include/asm/prom.h
+++ b/arch/openrisc/include/asm/prom.h
@@ -24,6 +24,7 @@
 
 #include <linux/types.h>
 #include <asm/irq.h>
+#include <linux/irqdomain.h>
 #include <linux/atomic.h>
 #include <linux/of_irq.h>
 #include <linux/of_fdt.h>
@@ -63,15 +64,6 @@ extern const void *of_get_mac_address(struct device_node *np);
 struct pci_dev;
 extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
 
-/* This routine is here to provide compatibility with how powerpc
- * handles IRQ mapping for OF device nodes.  We precompute and permanently
- * register them in the platform_device objects, whereas powerpc computes them
- * on request.
- */
-static inline void irq_dispose_mapping(unsigned int virq)
-{
-}
-
 #endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* _ASM_OPENRISC_PROM_H */
diff --git a/arch/sparc/include/asm/prom.h b/arch/sparc/include/asm/prom.h
index edd3d3cde..c287651 100644
--- a/arch/sparc/include/asm/prom.h
+++ b/arch/sparc/include/asm/prom.h
@@ -22,6 +22,7 @@
 #include <linux/proc_fs.h>
 #include <linux/mutex.h>
 #include <linux/atomic.h>
+#include <linux/irqdomain.h>
 
 #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT	2
 #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT	1
@@ -55,15 +56,6 @@ struct resource;
 extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
 extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
 
-/* These routines are here to provide compatibility with how powerpc
- * handles IRQ mapping for OF device nodes.  We precompute and permanently
- * register them in the platform_device objects, whereas powerpc computes them
- * on request.
- */
-static inline void irq_dispose_mapping(unsigned int virq)
-{
-}
-
 extern struct device_node *of_console_device;
 extern char *of_console_path;
 extern char *of_console_options;
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 5245488..ead4a42 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -182,6 +182,9 @@ extern void irq_domain_generate_simple(const struct of_device_id *match,
 static inline void irq_domain_generate_simple(const struct of_device_id *match,
 					u64 phys_base, unsigned int irq_start) { }
 #endif /* !CONFIG_OF_IRQ */
-#endif /* CONFIG_IRQ_DOMAIN */
+
+#else /* CONFIG_IRQ_DOMAIN */
+static inline void irq_dispose_mapping(unsigned int virq) { }
+#endif /* !CONFIG_IRQ_DOMAIN */
 
 #endif /* _LINUX_IRQDOMAIN_H */
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index d0307ee..d229ad3 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -6,6 +6,7 @@ struct of_irq;
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/irq.h>
+#include <linux/irqdomain.h>
 #include <linux/ioport.h>
 #include <linux/of.h>
 
@@ -65,9 +66,6 @@ extern int of_irq_map_one(struct device_node *device, int index,
 extern unsigned int irq_create_of_mapping(struct device_node *controller,
 					  const u32 *intspec,
 					  unsigned int intsize);
-#ifdef CONFIG_IRQ_DOMAIN
-extern void irq_dispose_mapping(unsigned int irq);
-#endif
 extern int of_irq_to_resource(struct device_node *dev, int index,
 			      struct resource *r);
 extern int of_irq_count(struct device_node *dev);
-- 
1.7.9


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] mfd: twl-core: Add IRQ_DOMAIN dependency
  2012-02-24 16:54 [PATCH 1/2] irq_domain: Centralize definition of irq_dispose_mapping() Grant Likely
@ 2012-02-24 16:54 ` Grant Likely
  2012-02-27 10:17   ` Samuel Ortiz
  2012-02-24 17:32 ` [PATCH 1/2] irq_domain: Centralize definition of irq_dispose_mapping() David Daney
  2012-02-27  9:43 ` Jonas Bonn
  2 siblings, 1 reply; 8+ messages in thread
From: Grant Likely @ 2012-02-24 16:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: Benoit Cousson, Grant Likely, Samuel Ortiz

From: Benoit Cousson <b-cousson@ti.com>

TWL4030 depends on IRQ_DOMAIN support, so this patch selects it in Kconfig.
It used to be that CONFIG_IRQ_DOMAIN must only be selected by the architecture,
but recent cleanups have fixed it so that it is safe to select from anywhere.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
[grant.likely: Changed from a depends to a select]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/mfd/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index f147395..1489c35 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -201,6 +201,7 @@ config MENELAUS
 config TWL4030_CORE
 	bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support"
 	depends on I2C=y && GENERIC_HARDIRQS
+	select IRQ_DOMAIN
 	help
 	  Say yes here if you have TWL4030 / TWL6030 family chip on your board.
 	  This core driver provides register access and IRQ handling
-- 
1.7.9


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] irq_domain: Centralize definition of irq_dispose_mapping()
  2012-02-24 16:54 [PATCH 1/2] irq_domain: Centralize definition of irq_dispose_mapping() Grant Likely
  2012-02-24 16:54 ` [PATCH 2/2] mfd: twl-core: Add IRQ_DOMAIN dependency Grant Likely
@ 2012-02-24 17:32 ` David Daney
  2012-02-24 18:03   ` Grant Likely
  2012-02-27  9:43 ` Jonas Bonn
  2 siblings, 1 reply; 8+ messages in thread
From: David Daney @ 2012-02-24 17:32 UTC (permalink / raw)
  To: Grant Likely
  Cc: linux-kernel, Rob Herring, David S. Miller, Jonas Bonn,
	sparclinux, linux

On 02/24/2012 08:54 AM, Grant Likely wrote:
> Several architectures define their own empty irq_dispose_mapping().  Since
> the irq_domain code is centralized now, there is little need to do so.  This
> patch removes them and creates a new empty copy when !CONFIG_IRQ_DOMAIN is
> selected.
>
> The patch also means that IRQ_DOMAIN becomes selectable on all architectures.
>
> Signed-off-by: Grant Likely<grant.likely@secretlab.ca>
> Cc: Rob Herring<rob.herring@calxeda.com>
> Cc: "David S. Miller"<davem@davemloft.net>
> Cc: Jonas Bonn<jonas@southpole.se>
> Cc: sparclinux@vger.kernel.org
> Cc: linux@lists.openrisc.net
> ---
>   arch/openrisc/include/asm/prom.h |   10 +---------
>   arch/sparc/include/asm/prom.h    |   10 +---------
>   include/linux/irqdomain.h        |    5 ++++-
>   include/linux/of_irq.h           |    4 +---
>   4 files changed, 7 insertions(+), 22 deletions(-)
>

There is also a definition in arch/mips/include/asm/irq.h.

Probably best to get rid of that one too.

David Daney

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] irq_domain: Centralize definition of irq_dispose_mapping()
  2012-02-24 17:32 ` [PATCH 1/2] irq_domain: Centralize definition of irq_dispose_mapping() David Daney
@ 2012-02-24 18:03   ` Grant Likely
  0 siblings, 0 replies; 8+ messages in thread
From: Grant Likely @ 2012-02-24 18:03 UTC (permalink / raw)
  To: David Daney
  Cc: linux-kernel, Rob Herring, David S. Miller, Jonas Bonn,
	sparclinux, linux

On Fri, Feb 24, 2012 at 10:32 AM, David Daney <ddaney.cavm@gmail.com> wrote:
> On 02/24/2012 08:54 AM, Grant Likely wrote:
>>
>> Several architectures define their own empty irq_dispose_mapping().  Since
>> the irq_domain code is centralized now, there is little need to do so.
>>  This
>> patch removes them and creates a new empty copy when !CONFIG_IRQ_DOMAIN is
>> selected.
>>
>> The patch also means that IRQ_DOMAIN becomes selectable on all
>> architectures.
>>
>> Signed-off-by: Grant Likely<grant.likely@secretlab.ca>
>> Cc: Rob Herring<rob.herring@calxeda.com>
>> Cc: "David S. Miller"<davem@davemloft.net>
>> Cc: Jonas Bonn<jonas@southpole.se>
>> Cc: sparclinux@vger.kernel.org
>> Cc: linux@lists.openrisc.net
>> ---
>>  arch/openrisc/include/asm/prom.h |   10 +---------
>>  arch/sparc/include/asm/prom.h    |   10 +---------
>>  include/linux/irqdomain.h        |    5 ++++-
>>  include/linux/of_irq.h           |    4 +---
>>  4 files changed, 7 insertions(+), 22 deletions(-)
>>
>
> There is also a definition in arch/mips/include/asm/irq.h.
>
> Probably best to get rid of that one too.

I've got a separate patch which I posted today that enables IRQ_DOMAIN
on MIPS which does indeed remove that definition.

g.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] irq_domain: Centralize definition of irq_dispose_mapping()
  2012-02-24 16:54 [PATCH 1/2] irq_domain: Centralize definition of irq_dispose_mapping() Grant Likely
  2012-02-24 16:54 ` [PATCH 2/2] mfd: twl-core: Add IRQ_DOMAIN dependency Grant Likely
  2012-02-24 17:32 ` [PATCH 1/2] irq_domain: Centralize definition of irq_dispose_mapping() David Daney
@ 2012-02-27  9:43 ` Jonas Bonn
  2 siblings, 0 replies; 8+ messages in thread
From: Jonas Bonn @ 2012-02-27  9:43 UTC (permalink / raw)
  To: Grant Likely
  Cc: linux-kernel, Rob Herring, David S. Miller, sparclinux, linux


On Fri, 2012-02-24 at 09:54 -0700, Grant Likely wrote:
> Several architectures define their own empty irq_dispose_mapping().  Since
> the irq_domain code is centralized now, there is little need to do so.  This
> patch removes them and creates a new empty copy when !CONFIG_IRQ_DOMAIN is
> selected.
> 
> The patch also means that IRQ_DOMAIN becomes selectable on all architectures.

Acked-by: Jonas Bonn <jonas@southpole.se> (for OpenRISC)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] mfd: twl-core: Add IRQ_DOMAIN dependency
  2012-02-27 10:17   ` Samuel Ortiz
@ 2012-02-27 10:14     ` Cousson, Benoit
       [not found]     ` <CACxGe6t5+mSp2SwX1jr-H_NMrsqJrMSwXPRpen93ev=ryHC=2Q@mail.gmail.com>
  1 sibling, 0 replies; 8+ messages in thread
From: Cousson, Benoit @ 2012-02-27 10:14 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Grant Likely, linux-kernel

On 2/27/2012 11:17 AM, Samuel Ortiz wrote:
> Hi Grant, Benoit,
>
> On Fri, Feb 24, 2012 at 09:54:08AM -0700, Grant Likely wrote:
>> From: Benoit Cousson<b-cousson@ti.com>
>>
>> TWL4030 depends on IRQ_DOMAIN support, so this patch selects it in Kconfig.
>> It used to be that CONFIG_IRQ_DOMAIN must only be selected by the architecture,
>> but recent cleanups have fixed it so that it is safe to select from anywhere.
> Applied to my for-next branch, thanks.

Thanks Samuel,

Regards,
Benoit

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] mfd: twl-core: Add IRQ_DOMAIN dependency
  2012-02-24 16:54 ` [PATCH 2/2] mfd: twl-core: Add IRQ_DOMAIN dependency Grant Likely
@ 2012-02-27 10:17   ` Samuel Ortiz
  2012-02-27 10:14     ` Cousson, Benoit
       [not found]     ` <CACxGe6t5+mSp2SwX1jr-H_NMrsqJrMSwXPRpen93ev=ryHC=2Q@mail.gmail.com>
  0 siblings, 2 replies; 8+ messages in thread
From: Samuel Ortiz @ 2012-02-27 10:17 UTC (permalink / raw)
  To: Grant Likely; +Cc: linux-kernel, Benoit Cousson

Hi Grant, Benoit,

On Fri, Feb 24, 2012 at 09:54:08AM -0700, Grant Likely wrote:
> From: Benoit Cousson <b-cousson@ti.com>
> 
> TWL4030 depends on IRQ_DOMAIN support, so this patch selects it in Kconfig.
> It used to be that CONFIG_IRQ_DOMAIN must only be selected by the architecture,
> but recent cleanups have fixed it so that it is safe to select from anywhere.
Applied to my for-next branch, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] mfd: twl-core: Add IRQ_DOMAIN dependency
       [not found]     ` <CACxGe6t5+mSp2SwX1jr-H_NMrsqJrMSwXPRpen93ev=ryHC=2Q@mail.gmail.com>
@ 2012-02-27 15:07       ` Samuel Ortiz
  0 siblings, 0 replies; 8+ messages in thread
From: Samuel Ortiz @ 2012-02-27 15:07 UTC (permalink / raw)
  To: Grant Likely; +Cc: Benoit Cousson, linux-kernel

On Mon, Feb 27, 2012 at 06:54:52AM -0700, Grant Likely wrote:
> On Feb 27, 2012 3:10 AM, "Samuel Ortiz" <sameo@linux.intel.com> wrote:
> >
> > Hi Grant, Benoit,
> >
> > On Fri, Feb 24, 2012 at 09:54:08AM -0700, Grant Likely wrote:
> > > From: Benoit Cousson <b-cousson@ti.com>
> > >
> > > TWL4030 depends on IRQ_DOMAIN support, so this patch selects it in
> Kconfig.
> > > It used to be that CONFIG_IRQ_DOMAIN must only be selected by the
> architecture,
> > > but recent cleanups have fixed it so that it is safe to select from
> anywhere.
> > Applied to my for-next branch, thanks.
> 
> It has to go via my tree to get rid of the build failure properly.
Yes. I wasn't sure you pushed it already until I saw your reply to Andrew.
I removed it from my tree, thanks for taking care of that.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-02-27 15:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-24 16:54 [PATCH 1/2] irq_domain: Centralize definition of irq_dispose_mapping() Grant Likely
2012-02-24 16:54 ` [PATCH 2/2] mfd: twl-core: Add IRQ_DOMAIN dependency Grant Likely
2012-02-27 10:17   ` Samuel Ortiz
2012-02-27 10:14     ` Cousson, Benoit
     [not found]     ` <CACxGe6t5+mSp2SwX1jr-H_NMrsqJrMSwXPRpen93ev=ryHC=2Q@mail.gmail.com>
2012-02-27 15:07       ` Samuel Ortiz
2012-02-24 17:32 ` [PATCH 1/2] irq_domain: Centralize definition of irq_dispose_mapping() David Daney
2012-02-24 18:03   ` Grant Likely
2012-02-27  9:43 ` Jonas Bonn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).