linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] PCI: Annotate pci_fixup_irqs with __devinit
@ 2012-09-14 20:44 Thierry Reding
  2012-09-14 20:44 ` [PATCH 2/2] PCI: Provide a default pcibios_update_irq() Thierry Reding
  2012-09-14 20:53 ` [PATCH 1/2] PCI: Annotate pci_fixup_irqs with __devinit Bjorn Helgaas
  0 siblings, 2 replies; 10+ messages in thread
From: Thierry Reding @ 2012-09-14 20:44 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King,
	Tony Luck, Fenghua Yu, Geert Uytterhoeven, Ralf Baechle,
	Paul Mundt, David S. Miller, Chris Metcalf, Guan Xuetao,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Chris Zankel,
	Greg Ungerer, linux-alpha, linux-kernel, linux-arm-kernel,
	linux-ia64, linux-m68k, linux-mips, linux-sh, sparclinux,
	linux-pci

In order to keep pci_fixup_irqs() around after init (e.g. for hotplug),
mark it __devinit instead of __init. This requires the same change for
the implementation of the pcibios_update_irq() function on all
architectures.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
---
Note: Ideally these annotations should go away completely in order to
be independent of the HOTPLUG symbol. However, there is work underway
to get rid of HOTPLUG altogether, so I've kept the __devinit for now.

 arch/alpha/kernel/pci.c   | 2 +-
 arch/mips/pci/pci.c       | 2 +-
 arch/sh/drivers/pci/pci.c | 2 +-
 arch/x86/pci/visws.c      | 2 +-
 arch/xtensa/kernel/pci.c  | 2 +-
 drivers/pci/setup-irq.c   | 4 ++--
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index 9816d5a..6192b35 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -256,7 +256,7 @@ pcibios_fixup_bus(struct pci_bus *bus)
 	}
 }
 
-void __init
+void __devinit
 pcibios_update_irq(struct pci_dev *dev, int irq)
 {
 	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 6903568..af3dc05 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -313,7 +313,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
 	}
 }
 
-void __init
+void __devinit
 pcibios_update_irq(struct pci_dev *dev, int irq)
 {
 	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
index 40db2d0..d16fabe 100644
--- a/arch/sh/drivers/pci/pci.c
+++ b/arch/sh/drivers/pci/pci.c
@@ -192,7 +192,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
 	return pci_enable_resources(dev, mask);
 }
 
-void __init pcibios_update_irq(struct pci_dev *dev, int irq)
+void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
 {
 	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
 }
diff --git a/arch/x86/pci/visws.c b/arch/x86/pci/visws.c
index 6f2f8ee..15bdfbf 100644
--- a/arch/x86/pci/visws.c
+++ b/arch/x86/pci/visws.c
@@ -62,7 +62,7 @@ out:
 	return irq;
 }
 
-void __init pcibios_update_irq(struct pci_dev *dev, int irq)
+void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
 {
 	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
 }
diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c
index 69759e9..efc3369 100644
--- a/arch/xtensa/kernel/pci.c
+++ b/arch/xtensa/kernel/pci.c
@@ -212,7 +212,7 @@ void pcibios_set_master(struct pci_dev *dev)
 
 /* the next one is stolen from the alpha port... */
 
-void __init
+void __devinit
 pcibios_update_irq(struct pci_dev *dev, int irq)
 {
 	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
diff --git a/drivers/pci/setup-irq.c b/drivers/pci/setup-irq.c
index eb219a1..f0bcd56 100644
--- a/drivers/pci/setup-irq.c
+++ b/drivers/pci/setup-irq.c
@@ -18,7 +18,7 @@
 #include <linux/cache.h>
 
 
-static void __init
+static void __devinit
 pdev_fixup_irq(struct pci_dev *dev,
 	       u8 (*swizzle)(struct pci_dev *, u8 *),
 	       int (*map_irq)(const struct pci_dev *, u8, u8))
@@ -54,7 +54,7 @@ pdev_fixup_irq(struct pci_dev *dev,
 	pcibios_update_irq(dev, irq);
 }
 
-void __init
+void __devinit
 pci_fixup_irqs(u8 (*swizzle)(struct pci_dev *, u8 *),
 	       int (*map_irq)(const struct pci_dev *, u8, u8))
 {
-- 
1.7.12


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

* [PATCH 2/2] PCI: Provide a default pcibios_update_irq()
  2012-09-14 20:44 [PATCH 1/2] PCI: Annotate pci_fixup_irqs with __devinit Thierry Reding
@ 2012-09-14 20:44 ` Thierry Reding
  2012-09-15  7:32   ` Geert Uytterhoeven
  2012-09-14 20:53 ` [PATCH 1/2] PCI: Annotate pci_fixup_irqs with __devinit Bjorn Helgaas
  1 sibling, 1 reply; 10+ messages in thread
From: Thierry Reding @ 2012-09-14 20:44 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King,
	Tony Luck, Fenghua Yu, Geert Uytterhoeven, Ralf Baechle,
	Paul Mundt, David S. Miller, Chris Metcalf, Guan Xuetao,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Chris Zankel,
	Greg Ungerer, linux-alpha, linux-kernel, linux-arm-kernel,
	linux-ia64, linux-m68k, linux-mips, linux-sh, sparclinux,
	linux-pci

Most architectures implement this in exactly the same way. Instead of
having each architecture duplicate this function, provide a single
implementation in the core and make it a weak symbol so that it can be
overridden on architectures where it is required.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
---
Note: ARM and Unicore32 did use a debug_pci variable to check whether or
not to output a debug message in pcibios_update_irq(). SPARC/LEON checks
for CONFIG_PCI_DEBUG instead. I've adopted the SPARC variant in this
patch. I assumed that in the interest of unification this would be a
good compromise. If not, please let me know.

Also, SPARC64 had an empty pcibios_update_irq(). I've opted to drop it
in favour of the default implementation, which just writes a single byte
in the device's configuration space. I assumed that this should still
work but perhaps was just not used on SPARC64. If this is known to break
SPARC64 I can keep the noop implementation.

 arch/alpha/kernel/pci.c      | 6 ------
 arch/arm/kernel/bios32.c     | 9 ---------
 arch/ia64/pci/pci.c          | 8 --------
 arch/m68k/kernel/pcibios.c   | 5 -----
 arch/mips/pci/pci.c          | 6 ------
 arch/sh/drivers/pci/pci.c    | 5 -----
 arch/sparc/kernel/leon_pci.c | 9 ---------
 arch/sparc/kernel/pci.c      | 4 ----
 arch/tile/kernel/pci.c       | 8 --------
 arch/tile/kernel/pci_gx.c    | 8 --------
 arch/unicore32/kernel/pci.c  | 8 --------
 arch/x86/pci/visws.c         | 5 -----
 arch/xtensa/kernel/pci.c     | 8 --------
 drivers/pci/setup-irq.c      | 8 ++++++++
 14 files changed, 8 insertions(+), 89 deletions(-)

diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index 6192b35..ef75714 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -256,12 +256,6 @@ pcibios_fixup_bus(struct pci_bus *bus)
 	}
 }
 
-void __devinit
-pcibios_update_irq(struct pci_dev *dev, int irq)
-{
-	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
-}
-
 int
 pcibios_enable_device(struct pci_dev *dev, int mask)
 {
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 2b2f25e..9cf16b8 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -270,15 +270,6 @@ static void __devinit pci_fixup_it8152(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8152, pci_fixup_it8152);
 
-
-
-void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
-{
-	if (debug_pci)
-		printk("PCI: Assigning IRQ %02d to %s\n", irq, pci_name(dev));
-	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
-}
-
 /*
  * If the bus contains any of these devices, then we must not turn on
  * parity checking of any kind.  Currently this is CyberPro 20x0 only.
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 81acc7a..a7ebe94 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -461,14 +461,6 @@ void pcibios_set_master (struct pci_dev *dev)
 	/* No special bus mastering setup handling */
 }
 
-void __devinit
-pcibios_update_irq (struct pci_dev *dev, int irq)
-{
-	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
-
-	/* ??? FIXME -- record old value for shutdown.  */
-}
-
 int
 pcibios_enable_device (struct pci_dev *dev, int mask)
 {
diff --git a/arch/m68k/kernel/pcibios.c b/arch/m68k/kernel/pcibios.c
index b2988aa..73fa0b5 100644
--- a/arch/m68k/kernel/pcibios.c
+++ b/arch/m68k/kernel/pcibios.c
@@ -87,11 +87,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
 	return 0;
 }
 
-void pcibios_update_irq(struct pci_dev *dev, int irq)
-{
-	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
-}
-
 void __devinit pcibios_fixup_bus(struct pci_bus *bus)
 {
 	struct pci_dev *dev;
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index af3dc05..04e35bc 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -313,12 +313,6 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
 	}
 }
 
-void __devinit
-pcibios_update_irq(struct pci_dev *dev, int irq)
-{
-	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
-}
-
 #ifdef CONFIG_HOTPLUG
 EXPORT_SYMBOL(PCIBIOS_MIN_IO);
 EXPORT_SYMBOL(PCIBIOS_MIN_MEM);
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
index d16fabe..a7e078f 100644
--- a/arch/sh/drivers/pci/pci.c
+++ b/arch/sh/drivers/pci/pci.c
@@ -192,11 +192,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
 	return pci_enable_resources(dev, mask);
 }
 
-void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
-{
-	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
-}
-
 static void __init
 pcibios_bus_report_status_early(struct pci_channel *hose,
 				int top_bus, int current_bus,
diff --git a/arch/sparc/kernel/leon_pci.c b/arch/sparc/kernel/leon_pci.c
index 21dcda7..fc05211 100644
--- a/arch/sparc/kernel/leon_pci.c
+++ b/arch/sparc/kernel/leon_pci.c
@@ -102,15 +102,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
 	return pci_enable_resources(dev, mask);
 }
 
-void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
-{
-#ifdef CONFIG_PCI_DEBUG
-	printk(KERN_DEBUG "LEONPCI: Assigning IRQ %02d to %s\n", irq,
-		pci_name(dev));
-#endif
-	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
-}
-
 /* in/out routines taken from pcic.c
  *
  * This probably belongs here rather than ioport.c because
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index 065b88c..acc8c83 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -622,10 +622,6 @@ void __devinit pcibios_fixup_bus(struct pci_bus *pbus)
 {
 }
 
-void pcibios_update_irq(struct pci_dev *pdev, int irq)
-{
-}
-
 resource_size_t pcibios_align_resource(void *data, const struct resource *res,
 				resource_size_t size, resource_size_t align)
 {
diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c
index 33c1086..dbdab34 100644
--- a/arch/tile/kernel/pci.c
+++ b/arch/tile/kernel/pci.c
@@ -404,14 +404,6 @@ void pcibios_set_master(struct pci_dev *dev)
 }
 
 /*
- * This is called from the generic Linux layer.
- */
-void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
-{
-	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
-}
-
-/*
  * Enable memory and/or address decoding, as appropriate, for the
  * device described by the 'dev' struct.
  *
diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c
index 0e213e3..2ba6d05 100644
--- a/arch/tile/kernel/pci_gx.c
+++ b/arch/tile/kernel/pci_gx.c
@@ -1034,14 +1034,6 @@ char __devinit *pcibios_setup(char *str)
 }
 
 /*
- * This is called from the generic Linux layer.
- */
-void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
-{
-	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
-}
-
-/*
  * Enable memory address decoding, as appropriate, for the
  * device described by the 'dev' struct. The I/O decoding
  * is disabled, though the TILE-Gx supports I/O addressing.
diff --git a/arch/unicore32/kernel/pci.c b/arch/unicore32/kernel/pci.c
index 46cb6c9..b0056f6 100644
--- a/arch/unicore32/kernel/pci.c
+++ b/arch/unicore32/kernel/pci.c
@@ -154,14 +154,6 @@ void __init puv3_pci_adjust_zones(unsigned long *zone_size,
 	zhole_size[0] = 0;
 }
 
-void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
-{
-	if (debug_pci)
-		printk(KERN_DEBUG "PCI: Assigning IRQ %02d to %s\n",
-				irq, pci_name(dev));
-	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
-}
-
 /*
  * If the bus contains any of these devices, then we must not turn on
  * parity checking of any kind.
diff --git a/arch/x86/pci/visws.c b/arch/x86/pci/visws.c
index 15bdfbf..3e6d2a6 100644
--- a/arch/x86/pci/visws.c
+++ b/arch/x86/pci/visws.c
@@ -62,11 +62,6 @@ out:
 	return irq;
 }
 
-void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
-{
-	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
-}
-
 int __init pci_visws_init(void)
 {
 	pcibios_enable_irq = &pci_visws_enable_irq;
diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c
index efc3369..54354de 100644
--- a/arch/xtensa/kernel/pci.c
+++ b/arch/xtensa/kernel/pci.c
@@ -210,14 +210,6 @@ void pcibios_set_master(struct pci_dev *dev)
 	/* No special bus mastering setup handling */
 }
 
-/* the next one is stolen from the alpha port... */
-
-void __devinit
-pcibios_update_irq(struct pci_dev *dev, int irq)
-{
-	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
-}
-
 int pcibios_enable_device(struct pci_dev *dev, int mask)
 {
 	u16 cmd, old_cmd;
diff --git a/drivers/pci/setup-irq.c b/drivers/pci/setup-irq.c
index f0bcd56..2d39268 100644
--- a/drivers/pci/setup-irq.c
+++ b/drivers/pci/setup-irq.c
@@ -17,6 +17,14 @@
 #include <linux/ioport.h>
 #include <linux/cache.h>
 
+void __devinit __weak pcibios_update_irq(struct pci_dev *dev, int irq)
+{
+#ifdef CONFIG_PCI_DEBUG
+	printk(KERN_DEBUG "PCI: Assigning IRQ %02d to %s\n", irq,
+	       pci_name(dev));
+#endif
+	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
+}
 
 static void __devinit
 pdev_fixup_irq(struct pci_dev *dev,
-- 
1.7.12


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

* Re: [PATCH 1/2] PCI: Annotate pci_fixup_irqs with __devinit
  2012-09-14 20:44 [PATCH 1/2] PCI: Annotate pci_fixup_irqs with __devinit Thierry Reding
  2012-09-14 20:44 ` [PATCH 2/2] PCI: Provide a default pcibios_update_irq() Thierry Reding
@ 2012-09-14 20:53 ` Bjorn Helgaas
  2012-09-14 22:35   ` Greg Kroah-Hartman
  1 sibling, 1 reply; 10+ messages in thread
From: Bjorn Helgaas @ 2012-09-14 20:53 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King,
	Tony Luck, Fenghua Yu, Geert Uytterhoeven, Ralf Baechle,
	Paul Mundt, David S. Miller, Chris Metcalf, Guan Xuetao,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Chris Zankel,
	Greg Ungerer, linux-alpha, linux-kernel, linux-arm-kernel,
	linux-ia64, linux-m68k, linux-mips, linux-sh, sparclinux,
	linux-pci, Greg Kroah-Hartman

+cc Greg KH

On Fri, Sep 14, 2012 at 2:44 PM, Thierry Reding
<thierry.reding@avionic-design.de> wrote:
> In order to keep pci_fixup_irqs() around after init (e.g. for hotplug),
> mark it __devinit instead of __init. This requires the same change for
> the implementation of the pcibios_update_irq() function on all
> architectures.
>
> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
> ---
> Note: Ideally these annotations should go away completely in order to
> be independent of the HOTPLUG symbol. However, there is work underway
> to get rid of HOTPLUG altogether, so I've kept the __devinit for now.
>
>  arch/alpha/kernel/pci.c   | 2 +-
>  arch/mips/pci/pci.c       | 2 +-
>  arch/sh/drivers/pci/pci.c | 2 +-
>  arch/x86/pci/visws.c      | 2 +-
>  arch/xtensa/kernel/pci.c  | 2 +-
>  drivers/pci/setup-irq.c   | 4 ++--
>  6 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
> index 9816d5a..6192b35 100644
> --- a/arch/alpha/kernel/pci.c
> +++ b/arch/alpha/kernel/pci.c
> @@ -256,7 +256,7 @@ pcibios_fixup_bus(struct pci_bus *bus)
>         }
>  }
>
> -void __init
> +void __devinit
>  pcibios_update_irq(struct pci_dev *dev, int irq)
>  {
>         pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
> diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
> index 6903568..af3dc05 100644
> --- a/arch/mips/pci/pci.c
> +++ b/arch/mips/pci/pci.c
> @@ -313,7 +313,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
>         }
>  }
>
> -void __init
> +void __devinit
>  pcibios_update_irq(struct pci_dev *dev, int irq)
>  {
>         pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
> diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
> index 40db2d0..d16fabe 100644
> --- a/arch/sh/drivers/pci/pci.c
> +++ b/arch/sh/drivers/pci/pci.c
> @@ -192,7 +192,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
>         return pci_enable_resources(dev, mask);
>  }
>
> -void __init pcibios_update_irq(struct pci_dev *dev, int irq)
> +void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
>  {
>         pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
>  }
> diff --git a/arch/x86/pci/visws.c b/arch/x86/pci/visws.c
> index 6f2f8ee..15bdfbf 100644
> --- a/arch/x86/pci/visws.c
> +++ b/arch/x86/pci/visws.c
> @@ -62,7 +62,7 @@ out:
>         return irq;
>  }
>
> -void __init pcibios_update_irq(struct pci_dev *dev, int irq)
> +void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
>  {
>         pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
>  }
> diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c
> index 69759e9..efc3369 100644
> --- a/arch/xtensa/kernel/pci.c
> +++ b/arch/xtensa/kernel/pci.c
> @@ -212,7 +212,7 @@ void pcibios_set_master(struct pci_dev *dev)
>
>  /* the next one is stolen from the alpha port... */
>
> -void __init
> +void __devinit
>  pcibios_update_irq(struct pci_dev *dev, int irq)
>  {
>         pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
> diff --git a/drivers/pci/setup-irq.c b/drivers/pci/setup-irq.c
> index eb219a1..f0bcd56 100644
> --- a/drivers/pci/setup-irq.c
> +++ b/drivers/pci/setup-irq.c
> @@ -18,7 +18,7 @@
>  #include <linux/cache.h>
>
>
> -static void __init
> +static void __devinit
>  pdev_fixup_irq(struct pci_dev *dev,
>                u8 (*swizzle)(struct pci_dev *, u8 *),
>                int (*map_irq)(const struct pci_dev *, u8, u8))
> @@ -54,7 +54,7 @@ pdev_fixup_irq(struct pci_dev *dev,
>         pcibios_update_irq(dev, irq);
>  }
>
> -void __init
> +void __devinit
>  pci_fixup_irqs(u8 (*swizzle)(struct pci_dev *, u8 *),
>                int (*map_irq)(const struct pci_dev *, u8, u8))
>  {
> --
> 1.7.12
>

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

* Re: [PATCH 1/2] PCI: Annotate pci_fixup_irqs with __devinit
  2012-09-14 20:53 ` [PATCH 1/2] PCI: Annotate pci_fixup_irqs with __devinit Bjorn Helgaas
@ 2012-09-14 22:35   ` Greg Kroah-Hartman
  2012-09-15  7:57     ` Thierry Reding
  0 siblings, 1 reply; 10+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-14 22:35 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Thierry Reding, Richard Henderson, Ivan Kokshaysky, Matt Turner,
	Russell King, Tony Luck, Fenghua Yu, Geert Uytterhoeven,
	Ralf Baechle, Paul Mundt, David S. Miller, Chris Metcalf,
	Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Chris Zankel, Greg Ungerer, linux-alpha, linux-kernel,
	linux-arm-kernel, linux-ia64, linux-m68k, linux-mips, linux-sh,
	sparclinux, linux-pci

On Fri, Sep 14, 2012 at 02:53:11PM -0600, Bjorn Helgaas wrote:
> +cc Greg KH
> 
> On Fri, Sep 14, 2012 at 2:44 PM, Thierry Reding
> <thierry.reding@avionic-design.de> wrote:
> > In order to keep pci_fixup_irqs() around after init (e.g. for hotplug),
> > mark it __devinit instead of __init. This requires the same change for
> > the implementation of the pcibios_update_irq() function on all
> > architectures.
> >
> > Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
> > ---
> > Note: Ideally these annotations should go away completely in order to
> > be independent of the HOTPLUG symbol. However, there is work underway
> > to get rid of HOTPLUG altogether, so I've kept the __devinit for now.

No, just take away the __init marking completly.  For 3.7,
CONFIG_HOTPLUG will always be enabled, making it be the same thing.
That way this saves me the time and energy from deleting the __devinit
markings when I get to that point in the patch series :)

thanks,

greg k-h

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

* Re: [PATCH 2/2] PCI: Provide a default pcibios_update_irq()
  2012-09-14 20:44 ` [PATCH 2/2] PCI: Provide a default pcibios_update_irq() Thierry Reding
@ 2012-09-15  7:32   ` Geert Uytterhoeven
  2012-09-15  7:53     ` Thierry Reding
  0 siblings, 1 reply; 10+ messages in thread
From: Geert Uytterhoeven @ 2012-09-15  7:32 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Bjorn Helgaas, Richard Henderson, Ivan Kokshaysky, Matt Turner,
	Russell King, Tony Luck, Fenghua Yu, Ralf Baechle, Paul Mundt,
	David S. Miller, Chris Metcalf, Guan Xuetao, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, x86, Chris Zankel, Greg Ungerer,
	linux-alpha, linux-kernel, linux-arm-kernel, linux-ia64,
	linux-m68k, linux-mips, linux-sh, sparclinux, linux-pci

On Fri, Sep 14, 2012 at 10:44 PM, Thierry Reding
<thierry.reding@avionic-design.de> wrote:
> --- a/drivers/pci/setup-irq.c
> +++ b/drivers/pci/setup-irq.c
> @@ -17,6 +17,14 @@
>  #include <linux/ioport.h>
>  #include <linux/cache.h>
>
> +void __devinit __weak pcibios_update_irq(struct pci_dev *dev, int irq)
> +{
> +#ifdef CONFIG_PCI_DEBUG
> +       printk(KERN_DEBUG "PCI: Assigning IRQ %02d to %s\n", irq,
> +              pci_name(dev));

pr_debug()?
Or even better, dev_dbg()?

> +#endif
> +       pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
> +}

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 2/2] PCI: Provide a default pcibios_update_irq()
  2012-09-15  7:32   ` Geert Uytterhoeven
@ 2012-09-15  7:53     ` Thierry Reding
  2012-09-15 22:22       ` Bjorn Helgaas
  2012-09-15 22:23       ` Bjorn Helgaas
  0 siblings, 2 replies; 10+ messages in thread
From: Thierry Reding @ 2012-09-15  7:53 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Bjorn Helgaas, Richard Henderson, Ivan Kokshaysky, Matt Turner,
	Russell King, Tony Luck, Fenghua Yu, Ralf Baechle, Paul Mundt,
	David S. Miller, Chris Metcalf, Guan Xuetao, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, x86, Chris Zankel, Greg Ungerer,
	linux-alpha, linux-kernel, linux-arm-kernel, linux-ia64,
	linux-m68k, linux-mips, linux-sh, sparclinux, linux-pci

[-- Attachment #1: Type: text/plain, Size: 799 bytes --]

On Sat, Sep 15, 2012 at 09:32:10AM +0200, Geert Uytterhoeven wrote:
> On Fri, Sep 14, 2012 at 10:44 PM, Thierry Reding
> <thierry.reding@avionic-design.de> wrote:
> > --- a/drivers/pci/setup-irq.c
> > +++ b/drivers/pci/setup-irq.c
> > @@ -17,6 +17,14 @@
> >  #include <linux/ioport.h>
> >  #include <linux/cache.h>
> >
> > +void __devinit __weak pcibios_update_irq(struct pci_dev *dev, int irq)
> > +{
> > +#ifdef CONFIG_PCI_DEBUG
> > +       printk(KERN_DEBUG "PCI: Assigning IRQ %02d to %s\n", irq,
> > +              pci_name(dev));
> 
> pr_debug()?
> Or even better, dev_dbg()?

The problem with pr_debug() and dev_dbg() is that they will be compiled
out if DEBUG is not defined. Perhaps we should pass -DDEBUG if PCI_DEBUG
is configured and make this dev_dbg()?

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 1/2] PCI: Annotate pci_fixup_irqs with __devinit
  2012-09-14 22:35   ` Greg Kroah-Hartman
@ 2012-09-15  7:57     ` Thierry Reding
  0 siblings, 0 replies; 10+ messages in thread
From: Thierry Reding @ 2012-09-15  7:57 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Bjorn Helgaas, Richard Henderson, Ivan Kokshaysky, Matt Turner,
	Russell King, Tony Luck, Fenghua Yu, Geert Uytterhoeven,
	Ralf Baechle, Paul Mundt, David S. Miller, Chris Metcalf,
	Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Chris Zankel, Greg Ungerer, linux-alpha, linux-kernel,
	linux-arm-kernel, linux-ia64, linux-m68k, linux-mips, linux-sh,
	sparclinux, linux-pci

[-- Attachment #1: Type: text/plain, Size: 1199 bytes --]

On Fri, Sep 14, 2012 at 03:35:31PM -0700, Greg Kroah-Hartman wrote:
> On Fri, Sep 14, 2012 at 02:53:11PM -0600, Bjorn Helgaas wrote:
> > +cc Greg KH
> > 
> > On Fri, Sep 14, 2012 at 2:44 PM, Thierry Reding
> > <thierry.reding@avionic-design.de> wrote:
> > > In order to keep pci_fixup_irqs() around after init (e.g. for hotplug),
> > > mark it __devinit instead of __init. This requires the same change for
> > > the implementation of the pcibios_update_irq() function on all
> > > architectures.
> > >
> > > Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
> > > ---
> > > Note: Ideally these annotations should go away completely in order to
> > > be independent of the HOTPLUG symbol. However, there is work underway
> > > to get rid of HOTPLUG altogether, so I've kept the __devinit for now.
> 
> No, just take away the __init marking completly.  For 3.7,
> CONFIG_HOTPLUG will always be enabled, making it be the same thing.
> That way this saves me the time and energy from deleting the __devinit
> markings when I get to that point in the patch series :)

Done. I'll give other people some time to comment before sending the
updated series.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 2/2] PCI: Provide a default pcibios_update_irq()
  2012-09-15  7:53     ` Thierry Reding
@ 2012-09-15 22:22       ` Bjorn Helgaas
  2012-09-15 22:23       ` Bjorn Helgaas
  1 sibling, 0 replies; 10+ messages in thread
From: Bjorn Helgaas @ 2012-09-15 22:22 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Geert Uytterhoeven, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, Russell King, Tony Luck, Fenghua Yu, Ralf Baechle,
	Paul Mundt, David S. Miller, Chris Metcalf, Guan Xuetao,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Chris Zankel,
	Greg Ungerer, linux-alpha, linux-kernel, linux-arm-kernel,
	linux-ia64, linux-m68k, linux-mips, linux-sh, sparclinux,
	linux-pci

On Sat, Sep 15, 2012 at 1:53 AM, Thierry Reding
<thierry.reding@avionic-design.de> wrote:
> On Sat, Sep 15, 2012 at 09:32:10AM +0200, Geert Uytterhoeven wrote:
>> On Fri, Sep 14, 2012 at 10:44 PM, Thierry Reding
>> <thierry.reding@avionic-design.de> wrote:
>> > --- a/drivers/pci/setup-irq.c
>> > +++ b/drivers/pci/setup-irq.c
>> > @@ -17,6 +17,14 @@
>> >  #include <linux/ioport.h>
>> >  #include <linux/cache.h>
>> >
>> > +void __devinit __weak pcibios_update_irq(struct pci_dev *dev, int irq)
>> > +{
>> > +#ifdef CONFIG_PCI_DEBUG
>> > +       printk(KERN_DEBUG "PCI: Assigning IRQ %02d to %s\n", irq,
>> > +              pci_name(dev));
>>
>> pr_debug()?
>> Or even better, dev_dbg()?
>
> The problem with pr_debug() and dev_dbg() is that they will be compiled
> out if DEBUG is not defined. Perhaps we should pass -DDEBUG if PCI_DEBUG
> is configured and make this dev_dbg()?

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

* Re: [PATCH 2/2] PCI: Provide a default pcibios_update_irq()
  2012-09-15  7:53     ` Thierry Reding
  2012-09-15 22:22       ` Bjorn Helgaas
@ 2012-09-15 22:23       ` Bjorn Helgaas
  2012-09-16  6:50         ` Thierry Reding
  1 sibling, 1 reply; 10+ messages in thread
From: Bjorn Helgaas @ 2012-09-15 22:23 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Geert Uytterhoeven, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, Russell King, Tony Luck, Fenghua Yu, Ralf Baechle,
	Paul Mundt, David S. Miller, Chris Metcalf, Guan Xuetao,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Chris Zankel,
	Greg Ungerer, linux-alpha, linux-kernel, linux-arm-kernel,
	linux-ia64, linux-m68k, linux-mips, linux-sh, sparclinux,
	linux-pci

On Sat, Sep 15, 2012 at 1:53 AM, Thierry Reding
<thierry.reding@avionic-design.de> wrote:
> On Sat, Sep 15, 2012 at 09:32:10AM +0200, Geert Uytterhoeven wrote:
>> On Fri, Sep 14, 2012 at 10:44 PM, Thierry Reding
>> <thierry.reding@avionic-design.de> wrote:
>> > --- a/drivers/pci/setup-irq.c
>> > +++ b/drivers/pci/setup-irq.c
>> > @@ -17,6 +17,14 @@
>> >  #include <linux/ioport.h>
>> >  #include <linux/cache.h>
>> >
>> > +void __devinit __weak pcibios_update_irq(struct pci_dev *dev, int irq)
>> > +{
>> > +#ifdef CONFIG_PCI_DEBUG
>> > +       printk(KERN_DEBUG "PCI: Assigning IRQ %02d to %s\n", irq,
>> > +              pci_name(dev));
>>
>> pr_debug()?
>> Or even better, dev_dbg()?
>
> The problem with pr_debug() and dev_dbg() is that they will be compiled
> out if DEBUG is not defined. Perhaps we should pass -DDEBUG if PCI_DEBUG
> is configured and make this dev_dbg()?

Sorry, fat-fingered the previous empty response.

We already have this in drivers/pci/Makefile:

    ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG

so dev_dbg() should be perfect.

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

* Re: [PATCH 2/2] PCI: Provide a default pcibios_update_irq()
  2012-09-15 22:23       ` Bjorn Helgaas
@ 2012-09-16  6:50         ` Thierry Reding
  0 siblings, 0 replies; 10+ messages in thread
From: Thierry Reding @ 2012-09-16  6:50 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Geert Uytterhoeven, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, Russell King, Tony Luck, Fenghua Yu, Ralf Baechle,
	Paul Mundt, David S. Miller, Chris Metcalf, Guan Xuetao,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Chris Zankel,
	Greg Ungerer, linux-alpha, linux-kernel, linux-arm-kernel,
	linux-ia64, linux-m68k, linux-mips, linux-sh, sparclinux,
	linux-pci

[-- Attachment #1: Type: text/plain, Size: 1352 bytes --]

On Sat, Sep 15, 2012 at 04:23:33PM -0600, Bjorn Helgaas wrote:
> On Sat, Sep 15, 2012 at 1:53 AM, Thierry Reding
> <thierry.reding@avionic-design.de> wrote:
> > On Sat, Sep 15, 2012 at 09:32:10AM +0200, Geert Uytterhoeven wrote:
> >> On Fri, Sep 14, 2012 at 10:44 PM, Thierry Reding
> >> <thierry.reding@avionic-design.de> wrote:
> >> > --- a/drivers/pci/setup-irq.c
> >> > +++ b/drivers/pci/setup-irq.c
> >> > @@ -17,6 +17,14 @@
> >> >  #include <linux/ioport.h>
> >> >  #include <linux/cache.h>
> >> >
> >> > +void __devinit __weak pcibios_update_irq(struct pci_dev *dev, int irq)
> >> > +{
> >> > +#ifdef CONFIG_PCI_DEBUG
> >> > +       printk(KERN_DEBUG "PCI: Assigning IRQ %02d to %s\n", irq,
> >> > +              pci_name(dev));
> >>
> >> pr_debug()?
> >> Or even better, dev_dbg()?
> >
> > The problem with pr_debug() and dev_dbg() is that they will be compiled
> > out if DEBUG is not defined. Perhaps we should pass -DDEBUG if PCI_DEBUG
> > is configured and make this dev_dbg()?
> 
> Sorry, fat-fingered the previous empty response.
> 
> We already have this in drivers/pci/Makefile:
> 
>     ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG
> 
> so dev_dbg() should be perfect.

Yeah, this occurred to me as well and I was just about to look it up
when I read your response. I'll make it dev_dbg() then.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2012-09-16  6:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-14 20:44 [PATCH 1/2] PCI: Annotate pci_fixup_irqs with __devinit Thierry Reding
2012-09-14 20:44 ` [PATCH 2/2] PCI: Provide a default pcibios_update_irq() Thierry Reding
2012-09-15  7:32   ` Geert Uytterhoeven
2012-09-15  7:53     ` Thierry Reding
2012-09-15 22:22       ` Bjorn Helgaas
2012-09-15 22:23       ` Bjorn Helgaas
2012-09-16  6:50         ` Thierry Reding
2012-09-14 20:53 ` [PATCH 1/2] PCI: Annotate pci_fixup_irqs with __devinit Bjorn Helgaas
2012-09-14 22:35   ` Greg Kroah-Hartman
2012-09-15  7:57     ` Thierry Reding

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).