linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv4 02/11] pci: use weak functions for MSI arch-specific functions
       [not found] <1372686136-1370-1-git-send-email-thomas.petazzoni@free-electrons.com>
@ 2013-07-01 13:42 ` Thomas Petazzoni
  2013-07-02  0:53   ` Michael Ellerman
  2013-07-05 21:32   ` Bjorn Helgaas
  2013-07-01 13:42 ` [PATCHv4 03/11] pci: remove ARCH_SUPPORTS_MSI kconfig option Thomas Petazzoni
  1 sibling, 2 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2013-07-01 13:42 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci, Russell King, Grant Likely, Rob Herring,
	Thomas Gleixner, Jason Cooper, Andrew Lunn, Gregory Clement
  Cc: Lior Amsalem, linux-mips, linux-ia64, Heiko Carstens,
	Thierry Reding, Paul Mackerras, H. Peter Anvin, sparclinux,
	linux-s390, x86, Ingo Molnar, Ezequiel Garcia, Fenghua Yu,
	Chris Metcalf, linux-arm-kernel, Tony Luck, Ralf Baechle,
	Maen Suleiman, Martin Schwidefsky, linux390, linuxppc-dev,
	David S. Miller

Until now, the MSI architecture-specific functions could be overloaded
using a fairly complex set of #define and compile-time
conditionals. In order to prepare for the introduction of the msi_chip
infrastructure, it is desirable to switch all those functions to use
the 'weak' mechanism. This commit converts all the architectures that
were overidding those MSI functions to use the new strategy.

Note that we keep a separate, non-weak, function
default_teardown_msi_irqs() for the default behavior of the
arch_teardown_msi_irqs(), as the default behavior is needed by the Xen
x86 PCI code.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux390@de.ibm.com
Cc: linux-s390@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: x86@kernel.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: linux-ia64@vger.kernel.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: David S. Miller <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Cc: Chris Metcalf <cmetcalf@tilera.com>
---
 arch/mips/include/asm/pci.h    |  5 -----
 arch/powerpc/include/asm/pci.h |  5 -----
 arch/s390/include/asm/pci.h    |  4 ----
 arch/x86/include/asm/pci.h     | 28 --------------------------
 arch/x86/kernel/x86_init.c     | 21 ++++++++++++++++++++
 drivers/pci/msi.c              | 45 +++++++++++++++++++-----------------------
 include/linux/msi.h            |  7 ++++++-
 7 files changed, 47 insertions(+), 68 deletions(-)

diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
index b8e24fd..031f4c1 100644
--- a/arch/mips/include/asm/pci.h
+++ b/arch/mips/include/asm/pci.h
@@ -137,11 +137,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
 	return channel ? 15 : 14;
 }
 
-#ifdef CONFIG_CPU_CAVIUM_OCTEON
-/* MSI arch hook for OCTEON */
-#define arch_setup_msi_irqs arch_setup_msi_irqs
-#endif
-
 extern char * (*pcibios_plat_setup)(char *str);
 
 #ifdef CONFIG_OF
diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h
index 6653f27..95145a1 100644
--- a/arch/powerpc/include/asm/pci.h
+++ b/arch/powerpc/include/asm/pci.h
@@ -113,11 +113,6 @@ extern int pci_domain_nr(struct pci_bus *bus);
 /* Decide whether to display the domain number in /proc */
 extern int pci_proc_domain(struct pci_bus *bus);
 
-/* MSI arch hooks */
-#define arch_setup_msi_irqs arch_setup_msi_irqs
-#define arch_teardown_msi_irqs arch_teardown_msi_irqs
-#define arch_msi_check_device arch_msi_check_device
-
 struct vm_area_struct;
 /* Map a range of PCI memory or I/O space for a device into user space */
 int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h
index 6c18012..8641e8d 100644
--- a/arch/s390/include/asm/pci.h
+++ b/arch/s390/include/asm/pci.h
@@ -21,10 +21,6 @@ void pci_iounmap(struct pci_dev *, void __iomem *);
 int pci_domain_nr(struct pci_bus *);
 int pci_proc_domain(struct pci_bus *);
 
-/* MSI arch hooks */
-#define arch_setup_msi_irqs	arch_setup_msi_irqs
-#define arch_teardown_msi_irqs	arch_teardown_msi_irqs
-
 #define ZPCI_BUS_NR			0	/* default bus number */
 #define ZPCI_DEVFN			0	/* default device number */
 
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index d9e9e6c..8c61de0 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -100,29 +100,6 @@ static inline void early_quirks(void) { }
 extern void pci_iommu_alloc(void);
 
 #ifdef CONFIG_PCI_MSI
-/* MSI arch specific hooks */
-static inline int x86_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
-{
-	return x86_msi.setup_msi_irqs(dev, nvec, type);
-}
-
-static inline void x86_teardown_msi_irqs(struct pci_dev *dev)
-{
-	x86_msi.teardown_msi_irqs(dev);
-}
-
-static inline void x86_teardown_msi_irq(unsigned int irq)
-{
-	x86_msi.teardown_msi_irq(irq);
-}
-static inline void x86_restore_msi_irqs(struct pci_dev *dev, int irq)
-{
-	x86_msi.restore_msi_irqs(dev, irq);
-}
-#define arch_setup_msi_irqs x86_setup_msi_irqs
-#define arch_teardown_msi_irqs x86_teardown_msi_irqs
-#define arch_teardown_msi_irq x86_teardown_msi_irq
-#define arch_restore_msi_irqs x86_restore_msi_irqs
 /* implemented in arch/x86/kernel/apic/io_apic. */
 struct msi_desc;
 int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
@@ -130,11 +107,6 @@ void native_teardown_msi_irq(unsigned int irq);
 void native_restore_msi_irqs(struct pci_dev *dev, int irq);
 int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc,
 		  unsigned int irq_base, unsigned int irq_offset);
-/* default to the implementation in drivers/lib/msi.c */
-#define HAVE_DEFAULT_MSI_TEARDOWN_IRQS
-#define HAVE_DEFAULT_MSI_RESTORE_IRQS
-void default_teardown_msi_irqs(struct pci_dev *dev);
-void default_restore_msi_irqs(struct pci_dev *dev, int irq);
 #else
 #define native_setup_msi_irqs		NULL
 #define native_teardown_msi_irq		NULL
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 45a14db..a2b189c 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -116,6 +116,27 @@ struct x86_msi_ops x86_msi = {
 	.setup_hpet_msi		= default_setup_hpet_msi,
 };
 
+/* MSI arch specific hooks */
+int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
+{
+	return x86_msi.setup_msi_irqs(dev, nvec, type);
+}
+
+void arch_teardown_msi_irqs(struct pci_dev *dev)
+{
+	x86_msi.teardown_msi_irqs(dev);
+}
+
+void arch_teardown_msi_irq(unsigned int irq)
+{
+	x86_msi.teardown_msi_irq(irq);
+}
+
+void arch_restore_msi_irqs(struct pci_dev *dev, int irq)
+{
+	x86_msi.restore_msi_irqs(dev, irq);
+}
+
 struct x86_io_apic_ops x86_io_apic_ops = {
 	.init			= native_io_apic_init_mappings,
 	.read			= native_io_apic_read,
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 2c10752..289fbfd 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -30,20 +30,21 @@ static int pci_msi_enable = 1;
 
 /* Arch hooks */
 
-#ifndef arch_msi_check_device
-int arch_msi_check_device(struct pci_dev *dev, int nvec, int type)
+int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
 {
-	return 0;
+	return -EINVAL;
 }
-#endif
 
-#ifndef arch_setup_msi_irqs
-# define arch_setup_msi_irqs default_setup_msi_irqs
-# define HAVE_DEFAULT_MSI_SETUP_IRQS
-#endif
+void __weak arch_teardown_msi_irq(unsigned int irq)
+{
+}
 
-#ifdef HAVE_DEFAULT_MSI_SETUP_IRQS
-int default_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
+int __weak arch_msi_check_device(struct pci_dev *dev, int nvec, int type)
+{
+	return 0;
+}
+
+int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 {
 	struct msi_desc *entry;
 	int ret;
@@ -65,14 +66,11 @@ int default_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 
 	return 0;
 }
-#endif
 
-#ifndef arch_teardown_msi_irqs
-# define arch_teardown_msi_irqs default_teardown_msi_irqs
-# define HAVE_DEFAULT_MSI_TEARDOWN_IRQS
-#endif
-
-#ifdef HAVE_DEFAULT_MSI_TEARDOWN_IRQS
+/*
+ * We have a default implementation available as a separate non-weak
+ * function, as it is used by the Xen x86 PCI code
+ */
 void default_teardown_msi_irqs(struct pci_dev *dev)
 {
 	struct msi_desc *entry;
@@ -86,15 +84,13 @@ void default_teardown_msi_irqs(struct pci_dev *dev)
 			arch_teardown_msi_irq(entry->irq + i);
 	}
 }
-#endif
 
-#ifndef arch_restore_msi_irqs
-# define arch_restore_msi_irqs default_restore_msi_irqs
-# define HAVE_DEFAULT_MSI_RESTORE_IRQS
-#endif
+void __weak arch_teardown_msi_irqs(struct pci_dev *dev)
+{
+	return default_teardown_msi_irqs(dev);
+}
 
-#ifdef HAVE_DEFAULT_MSI_RESTORE_IRQS
-void default_restore_msi_irqs(struct pci_dev *dev, int irq)
+void __weak arch_restore_msi_irqs(struct pci_dev *dev, int irq)
 {
 	struct msi_desc *entry;
 
@@ -111,7 +107,6 @@ void default_restore_msi_irqs(struct pci_dev *dev, int irq)
 	if (entry)
 		write_msi_msg(irq, &entry->msg);
 }
-#endif
 
 static void msi_set_enable(struct pci_dev *dev, int enable)
 {
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 20c2d6d..c82ff8d 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -50,12 +50,17 @@ struct msi_desc {
 };
 
 /*
- * The arch hook for setup up msi irqs
+ * The arch hooks to setup up msi irqs. Those functions are
+ * implemented as weak symbols so that they /can/ be overriden by
+ * architecture specific code if needed.
  */
 int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc);
 void arch_teardown_msi_irq(unsigned int irq);
 int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
 void arch_teardown_msi_irqs(struct pci_dev *dev);
 int arch_msi_check_device(struct pci_dev* dev, int nvec, int type);
+void arch_restore_msi_irqs(struct pci_dev *dev, int irq);
+
+void default_teardown_msi_irqs(struct pci_dev *dev);
 
 #endif /* LINUX_MSI_H */
-- 
1.8.1.2

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

* [PATCHv4 03/11] pci: remove ARCH_SUPPORTS_MSI kconfig option
       [not found] <1372686136-1370-1-git-send-email-thomas.petazzoni@free-electrons.com>
  2013-07-01 13:42 ` [PATCHv4 02/11] pci: use weak functions for MSI arch-specific functions Thomas Petazzoni
@ 2013-07-01 13:42 ` Thomas Petazzoni
  2013-07-05 21:37   ` Bjorn Helgaas
  1 sibling, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2013-07-01 13:42 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci, Russell King, Grant Likely, Rob Herring,
	Thomas Gleixner, Jason Cooper, Andrew Lunn, Gregory Clement
  Cc: Lior Amsalem, linux-mips, linux-ia64, Heiko Carstens,
	Thierry Reding, Paul Mackerras, H. Peter Anvin, sparclinux,
	linux-s390, x86, Ingo Molnar, Ezequiel Garcia, Fenghua Yu,
	Chris Metcalf, linux-arm-kernel, Tony Luck, Ralf Baechle,
	Maen Suleiman, Martin Schwidefsky, linux390, linuxppc-dev,
	David S. Miller

Now that we have weak versions for each of the PCI MSI architecture
functions, we can actually build the MSI support for all platforms,
regardless of whether they provide or not architecture-specific
versions of those functions. For this reason, the ARCH_SUPPORTS_MSI
hidden kconfig boolean becomes useless, and this patch gets rid of it.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux390@de.ibm.com
Cc: linux-s390@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: x86@kernel.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: linux-ia64@vger.kernel.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: David S. Miller <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Cc: Chris Metcalf <cmetcalf@tilera.com>
---
 arch/arm/Kconfig     | 1 -
 arch/ia64/Kconfig    | 1 -
 arch/mips/Kconfig    | 2 --
 arch/powerpc/Kconfig | 1 -
 arch/s390/Kconfig    | 1 -
 arch/sparc/Kconfig   | 1 -
 arch/tile/Kconfig    | 1 -
 arch/x86/Kconfig     | 1 -
 drivers/pci/Kconfig  | 4 ----
 9 files changed, 13 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 8ab5962..3413679 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -435,7 +435,6 @@ config ARCH_NETX
 config ARCH_IOP13XX
 	bool "IOP13xx-based"
 	depends on MMU
-	select ARCH_SUPPORTS_MSI
 	select CPU_XSC3
 	select NEED_MACH_MEMORY_H
 	select NEED_RET_TO_USER
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 1a2b774..943d425 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -9,7 +9,6 @@ config IA64
 	select PCI if (!IA64_HP_SIM)
 	select ACPI if (!IA64_HP_SIM)
 	select PM if (!IA64_HP_SIM)
-	select ARCH_SUPPORTS_MSI
 	select HAVE_UNSTABLE_SCHED_CLOCK
 	select HAVE_IDE
 	select HAVE_OPROFILE
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 7a58ab9..96c1225 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -763,7 +763,6 @@ config CAVIUM_OCTEON_REFERENCE_BOARD
 	select SYS_HAS_CPU_CAVIUM_OCTEON
 	select SWAP_IO_SPACE
 	select HW_HAS_PCI
-	select ARCH_SUPPORTS_MSI
 	select ZONE_DMA32
 	select USB_ARCH_HAS_OHCI
 	select USB_ARCH_HAS_EHCI
@@ -799,7 +798,6 @@ config NLM_XLR_BOARD
 	select CEVT_R4K
 	select CSRC_R4K
 	select IRQ_CPU
-	select ARCH_SUPPORTS_MSI
 	select ZONE_DMA32 if 64BIT
 	select SYNC_R4K
 	select SYS_HAS_EARLY_PRINTK
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index c33e3ad..f9d9d8e 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -734,7 +734,6 @@ config PCI
 	default y if !40x && !CPM2 && !8xx && !PPC_83xx \
 		&& !PPC_85xx && !PPC_86xx && !GAMECUBE_COMMON
 	default PCI_QSPAN if !4xx && !CPM2 && 8xx
-	select ARCH_SUPPORTS_MSI
 	select GENERIC_PCI_IOMAP
 	help
 	  Find out whether your system includes a PCI bus. PCI is the name of
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index da183c5..9a6225b 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -429,7 +429,6 @@ menuconfig PCI
 	bool "PCI support"
 	default n
 	depends on 64BIT
-	select ARCH_SUPPORTS_MSI
 	select PCI_MSI
 	help
 	  Enable PCI support.
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 9ac9f16..822e1a1 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -52,7 +52,6 @@ config SPARC32
 
 config SPARC64
 	def_bool 64BIT
-	select ARCH_SUPPORTS_MSI
 	select HAVE_FUNCTION_TRACER
 	select HAVE_FUNCTION_GRAPH_TRACER
 	select HAVE_FUNCTION_GRAPH_FP_TEST
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
index 3aa3766..d2d519c 100644
--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
@@ -379,7 +379,6 @@ config PCI
 	select PCI_DOMAINS
 	select GENERIC_PCI_IOMAP
 	select TILE_GXIO_TRIO if TILEGX
-	select ARCH_SUPPORTS_MSI if TILEGX
 	select PCI_MSI if TILEGX
 	---help---
 	  Enable PCI root complex support, so PCIe endpoint devices can
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 685692c..4229ce0 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1999,7 +1999,6 @@ menu "Bus options (PCI etc.)"
 config PCI
 	bool "PCI support"
 	default y
-	select ARCH_SUPPORTS_MSI if (X86_LOCAL_APIC && X86_IO_APIC)
 	---help---
 	  Find out whether you have a PCI motherboard. PCI is the name of a
 	  bus system, i.e. the way the CPU talks to the other stuff inside
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index ac45398..3d4c061 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -1,13 +1,9 @@
 #
 # PCI configuration
 #
-config ARCH_SUPPORTS_MSI
-	bool
-
 config PCI_MSI
 	bool "Message Signaled Interrupts (MSI and MSI-X)"
 	depends on PCI
-	depends on ARCH_SUPPORTS_MSI
 	help
 	   This allows device drivers to enable MSI (Message Signaled
 	   Interrupts).  Message Signaled Interrupts enable a device to
-- 
1.8.1.2

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

* Re: [PATCHv4 02/11] pci: use weak functions for MSI arch-specific functions
  2013-07-01 13:42 ` [PATCHv4 02/11] pci: use weak functions for MSI arch-specific functions Thomas Petazzoni
@ 2013-07-02  0:53   ` Michael Ellerman
  2013-07-02  5:30     ` Thomas Petazzoni
  2013-07-05 21:32   ` Bjorn Helgaas
  1 sibling, 1 reply; 15+ messages in thread
From: Michael Ellerman @ 2013-07-02  0:53 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Lior Amsalem, Andrew Lunn, linux-ia64, linux-mips, linux-pci,
	Heiko Carstens, Bjorn Helgaas, Thierry Reding, Paul Mackerras,
	H. Peter Anvin, sparclinux, linux-s390, Russell King, x86,
	Ingo Molnar, Ezequiel Garcia, Fenghua Yu, Jason Cooper,
	Rob Herring, Chris Metcalf, Gregory Clement, Thomas Gleixner,
	linux-arm-kernel, Tony Luck, Ralf Baechle, Maen Suleiman,
	Martin Schwidefsky, linux390, linuxppc-dev, David S. Miller

On Mon, 2013-07-01 at 15:42 +0200, Thomas Petazzoni wrote:
> Until now, the MSI architecture-specific functions could be overloaded
> using a fairly complex set of #define and compile-time
> conditionals. In order to prepare for the introduction of the msi_chip
> infrastructure, it is desirable to switch all those functions to use
> the 'weak' mechanism. This commit converts all the architectures that
> were overidding those MSI functions to use the new strategy.

The MSI code used to use weak functions, until we discovered they were
being miscompiled on some toolchains (11df1f0). I assume these days
we're confident they work correctly.

cheers

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

* Re: [PATCHv4 02/11] pci: use weak functions for MSI arch-specific functions
  2013-07-02  0:53   ` Michael Ellerman
@ 2013-07-02  5:30     ` Thomas Petazzoni
  2013-07-02  6:52       ` Michael Ellerman
  2013-07-02 17:14       ` Bjorn Helgaas
  0 siblings, 2 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2013-07-02  5:30 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Lior Amsalem, Andrew Lunn, linux-ia64, linux-mips, linux-pci,
	Heiko Carstens, Bjorn Helgaas, Thierry Reding, Paul Mackerras,
	H. Peter Anvin, sparclinux, linux-s390, Russell King, x86,
	Ingo Molnar, Ezequiel Garcia, Fenghua Yu, Jason Cooper,
	Rob Herring, Chris Metcalf, Gregory Clement, Thomas Gleixner,
	linux-arm-kernel, Tony Luck, Ralf Baechle, Maen Suleiman,
	Martin Schwidefsky, linux390, linuxppc-dev, David S. Miller

Dear Michael Ellerman,

On Tue, 02 Jul 2013 10:53:16 +1000, Michael Ellerman wrote:
> On Mon, 2013-07-01 at 15:42 +0200, Thomas Petazzoni wrote:
> > Until now, the MSI architecture-specific functions could be overloaded
> > using a fairly complex set of #define and compile-time
> > conditionals. In order to prepare for the introduction of the msi_chip
> > infrastructure, it is desirable to switch all those functions to use
> > the 'weak' mechanism. This commit converts all the architectures that
> > were overidding those MSI functions to use the new strategy.
> 
> The MSI code used to use weak functions, until we discovered they were
> being miscompiled on some toolchains (11df1f0). I assume these days
> we're confident they work correctly.

Hum, interesting. I see from your commit that gcc 4.3.2 was apparently
affected, and gcc 4.3.x is not /that/ old. Bjorn, what's your point of
view on this?

Another option would be to have architecture register some msi_arch_ops
structure, with a set of operations, which I believe is a pattern that
is more widespread in the kernel than weak functions.

Thoughts?

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* Re: [PATCHv4 02/11] pci: use weak functions for MSI arch-specific functions
  2013-07-02  5:30     ` Thomas Petazzoni
@ 2013-07-02  6:52       ` Michael Ellerman
  2013-07-02 17:14       ` Bjorn Helgaas
  1 sibling, 0 replies; 15+ messages in thread
From: Michael Ellerman @ 2013-07-02  6:52 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Lior Amsalem, Andrew Lunn, linux-ia64, linux-mips, linux-pci,
	Heiko Carstens, Bjorn Helgaas, Thierry Reding, Paul Mackerras,
	H. Peter Anvin, sparclinux, linux-s390, Russell King, x86,
	Ingo Molnar, Ezequiel Garcia, Fenghua Yu, Jason Cooper,
	Rob Herring, Chris Metcalf, Gregory Clement, Thomas Gleixner,
	linux-arm-kernel, Tony Luck, Ralf Baechle, Maen Suleiman,
	Martin Schwidefsky, linux390, linuxppc-dev, David S. Miller

On Tue, Jul 02, 2013 at 07:30:37AM +0200, Thomas Petazzoni wrote:
> Dear Michael Ellerman,
> 
> On Tue, 02 Jul 2013 10:53:16 +1000, Michael Ellerman wrote:
> > On Mon, 2013-07-01 at 15:42 +0200, Thomas Petazzoni wrote:
> > > Until now, the MSI architecture-specific functions could be overloaded
> > > using a fairly complex set of #define and compile-time
> > > conditionals. In order to prepare for the introduction of the msi_chip
> > > infrastructure, it is desirable to switch all those functions to use
> > > the 'weak' mechanism. This commit converts all the architectures that
> > > were overidding those MSI functions to use the new strategy.
> > 
> > The MSI code used to use weak functions, until we discovered they were
> > being miscompiled on some toolchains (11df1f0). I assume these days
> > we're confident they work correctly.
> 
> Hum, interesting. I see from your commit that gcc 4.3.2 was apparently
> affected, and gcc 4.3.x is not /that/ old. Bjorn, what's your point of
> view on this?

Stop press.

I went back and found the old threads on this, it's been a while. It
looks like it was only gcc 4.1.[01] that miscompiled. The reference to
gcc 4.3.2 was WRT ellision of the unused code, which is a separate
issue.

The kernel blacklists gcc 4.1.[01] (see f9d1425), so weak should be
safe to use.

We merged the change to the PCI code anyway because we thought it was
nicer and it also avoided any problems with weak.

So pretend I never said anything :)

cheers

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

* Re: [PATCHv4 02/11] pci: use weak functions for MSI arch-specific functions
  2013-07-02  5:30     ` Thomas Petazzoni
  2013-07-02  6:52       ` Michael Ellerman
@ 2013-07-02 17:14       ` Bjorn Helgaas
  1 sibling, 0 replies; 15+ messages in thread
From: Bjorn Helgaas @ 2013-07-02 17:14 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Lior Amsalem, Andrew Lunn, linux-ia64@vger.kernel.org,
	linux-mips@linux-mips.org, linux-pci@vger.kernel.org,
	Heiko Carstens, Thierry Reding, Paul Mackerras, H. Peter Anvin,
	sparclinux, linux-s390, Russell King, x86@kernel.org, Ingo Molnar,
	Ezequiel Garcia, Fenghua Yu, Jason Cooper, Rob Herring,
	Chris Metcalf, Gregory Clement, Thomas Gleixner, linux-arm,
	Tony Luck, Ralf Baechle, Maen Suleiman, Martin Schwidefsky,
	linux390, linuxppc-dev, David S. Miller

On Mon, Jul 1, 2013 at 11:30 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Michael Ellerman,
>
> On Tue, 02 Jul 2013 10:53:16 +1000, Michael Ellerman wrote:
>> On Mon, 2013-07-01 at 15:42 +0200, Thomas Petazzoni wrote:
>> > Until now, the MSI architecture-specific functions could be overloaded
>> > using a fairly complex set of #define and compile-time
>> > conditionals. In order to prepare for the introduction of the msi_chip
>> > infrastructure, it is desirable to switch all those functions to use
>> > the 'weak' mechanism. This commit converts all the architectures that
>> > were overidding those MSI functions to use the new strategy.
>>
>> The MSI code used to use weak functions, until we discovered they were
>> being miscompiled on some toolchains (11df1f0). I assume these days
>> we're confident they work correctly.
>
> Hum, interesting. I see from your commit that gcc 4.3.2 was apparently
> affected, and gcc 4.3.x is not /that/ old. Bjorn, what's your point of
> view on this?

There *were* compilation issues with weak functions, but AFAIK they've
been resolved and there's no reason to avoid them.  Commit f9d142500
addressed this.

Bjorn

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

* Re: [PATCHv4 02/11] pci: use weak functions for MSI arch-specific functions
  2013-07-01 13:42 ` [PATCHv4 02/11] pci: use weak functions for MSI arch-specific functions Thomas Petazzoni
  2013-07-02  0:53   ` Michael Ellerman
@ 2013-07-05 21:32   ` Bjorn Helgaas
  2013-07-05 21:34     ` Bjorn Helgaas
  1 sibling, 1 reply; 15+ messages in thread
From: Bjorn Helgaas @ 2013-07-05 21:32 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Lior Amsalem, Andrew Lunn, linux-ia64@vger.kernel.org,
	linux-mips@linux-mips.org, linux-pci@vger.kernel.org,
	Heiko Carstens, Thierry Reding, Paul Mackerras, H. Peter Anvin,
	sparclinux, linux-s390, Russell King, x86@kernel.org, Ingo Molnar,
	Ezequiel Garcia, Fenghua Yu, Jason Cooper, Rob Herring,
	Chris Metcalf, Gregory Clement, Thomas Gleixner, linux-arm,
	Tony Luck, Ralf Baechle, Maen Suleiman, Martin Schwidefsky,
	linux390, linuxppc-dev, David S. Miller

On Mon, Jul 1, 2013 at 7:42 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Until now, the MSI architecture-specific functions could be overloaded
> using a fairly complex set of #define and compile-time
> conditionals. In order to prepare for the introduction of the msi_chip
> infrastructure, it is desirable to switch all those functions to use
> the 'weak' mechanism. This commit converts all the architectures that
> were overidding those MSI functions to use the new strategy.
>
> Note that we keep a separate, non-weak, function
> default_teardown_msi_irqs() for the default behavior of the
> arch_teardown_msi_irqs(), as the default behavior is needed by the Xen
> x86 PCI code.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
> Cc: linux390@de.ibm.com
> Cc: linux-s390@vger.kernel.org
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: linux-ia64@vger.kernel.org
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: linux-mips@linux-mips.org
> Cc: David S. Miller <davem@davemloft.net>
> Cc: sparclinux@vger.kernel.org
> Cc: Chris Metcalf <cmetcalf@tilera.com>

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

> ---
>  arch/mips/include/asm/pci.h    |  5 -----
>  arch/powerpc/include/asm/pci.h |  5 -----
>  arch/s390/include/asm/pci.h    |  4 ----
>  arch/x86/include/asm/pci.h     | 28 --------------------------
>  arch/x86/kernel/x86_init.c     | 21 ++++++++++++++++++++
>  drivers/pci/msi.c              | 45 +++++++++++++++++++-----------------------
>  include/linux/msi.h            |  7 ++++++-
>  7 files changed, 47 insertions(+), 68 deletions(-)
>
> diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
> index b8e24fd..031f4c1 100644
> --- a/arch/mips/include/asm/pci.h
> +++ b/arch/mips/include/asm/pci.h
> @@ -137,11 +137,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
>         return channel ? 15 : 14;
>  }
>
> -#ifdef CONFIG_CPU_CAVIUM_OCTEON
> -/* MSI arch hook for OCTEON */
> -#define arch_setup_msi_irqs arch_setup_msi_irqs
> -#endif
> -
>  extern char * (*pcibios_plat_setup)(char *str);
>
>  #ifdef CONFIG_OF
> diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h
> index 6653f27..95145a1 100644
> --- a/arch/powerpc/include/asm/pci.h
> +++ b/arch/powerpc/include/asm/pci.h
> @@ -113,11 +113,6 @@ extern int pci_domain_nr(struct pci_bus *bus);
>  /* Decide whether to display the domain number in /proc */
>  extern int pci_proc_domain(struct pci_bus *bus);
>
> -/* MSI arch hooks */
> -#define arch_setup_msi_irqs arch_setup_msi_irqs
> -#define arch_teardown_msi_irqs arch_teardown_msi_irqs
> -#define arch_msi_check_device arch_msi_check_device
> -
>  struct vm_area_struct;
>  /* Map a range of PCI memory or I/O space for a device into user space */
>  int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
> diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h
> index 6c18012..8641e8d 100644
> --- a/arch/s390/include/asm/pci.h
> +++ b/arch/s390/include/asm/pci.h
> @@ -21,10 +21,6 @@ void pci_iounmap(struct pci_dev *, void __iomem *);
>  int pci_domain_nr(struct pci_bus *);
>  int pci_proc_domain(struct pci_bus *);
>
> -/* MSI arch hooks */
> -#define arch_setup_msi_irqs    arch_setup_msi_irqs
> -#define arch_teardown_msi_irqs arch_teardown_msi_irqs
> -
>  #define ZPCI_BUS_NR                    0       /* default bus number */
>  #define ZPCI_DEVFN                     0       /* default device number */
>
> diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
> index d9e9e6c..8c61de0 100644
> --- a/arch/x86/include/asm/pci.h
> +++ b/arch/x86/include/asm/pci.h
> @@ -100,29 +100,6 @@ static inline void early_quirks(void) { }
>  extern void pci_iommu_alloc(void);
>
>  #ifdef CONFIG_PCI_MSI
> -/* MSI arch specific hooks */
> -static inline int x86_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
> -{
> -       return x86_msi.setup_msi_irqs(dev, nvec, type);
> -}
> -
> -static inline void x86_teardown_msi_irqs(struct pci_dev *dev)
> -{
> -       x86_msi.teardown_msi_irqs(dev);
> -}
> -
> -static inline void x86_teardown_msi_irq(unsigned int irq)
> -{
> -       x86_msi.teardown_msi_irq(irq);
> -}
> -static inline void x86_restore_msi_irqs(struct pci_dev *dev, int irq)
> -{
> -       x86_msi.restore_msi_irqs(dev, irq);
> -}
> -#define arch_setup_msi_irqs x86_setup_msi_irqs
> -#define arch_teardown_msi_irqs x86_teardown_msi_irqs
> -#define arch_teardown_msi_irq x86_teardown_msi_irq
> -#define arch_restore_msi_irqs x86_restore_msi_irqs
>  /* implemented in arch/x86/kernel/apic/io_apic. */
>  struct msi_desc;
>  int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
> @@ -130,11 +107,6 @@ void native_teardown_msi_irq(unsigned int irq);
>  void native_restore_msi_irqs(struct pci_dev *dev, int irq);
>  int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc,
>                   unsigned int irq_base, unsigned int irq_offset);
> -/* default to the implementation in drivers/lib/msi.c */
> -#define HAVE_DEFAULT_MSI_TEARDOWN_IRQS
> -#define HAVE_DEFAULT_MSI_RESTORE_IRQS
> -void default_teardown_msi_irqs(struct pci_dev *dev);
> -void default_restore_msi_irqs(struct pci_dev *dev, int irq);
>  #else
>  #define native_setup_msi_irqs          NULL
>  #define native_teardown_msi_irq                NULL
> diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
> index 45a14db..a2b189c 100644
> --- a/arch/x86/kernel/x86_init.c
> +++ b/arch/x86/kernel/x86_init.c
> @@ -116,6 +116,27 @@ struct x86_msi_ops x86_msi = {
>         .setup_hpet_msi         = default_setup_hpet_msi,
>  };
>
> +/* MSI arch specific hooks */
> +int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
> +{
> +       return x86_msi.setup_msi_irqs(dev, nvec, type);
> +}
> +
> +void arch_teardown_msi_irqs(struct pci_dev *dev)
> +{
> +       x86_msi.teardown_msi_irqs(dev);
> +}
> +
> +void arch_teardown_msi_irq(unsigned int irq)
> +{
> +       x86_msi.teardown_msi_irq(irq);
> +}
> +
> +void arch_restore_msi_irqs(struct pci_dev *dev, int irq)
> +{
> +       x86_msi.restore_msi_irqs(dev, irq);
> +}
> +
>  struct x86_io_apic_ops x86_io_apic_ops = {
>         .init                   = native_io_apic_init_mappings,
>         .read                   = native_io_apic_read,
> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> index 2c10752..289fbfd 100644
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -30,20 +30,21 @@ static int pci_msi_enable = 1;
>
>  /* Arch hooks */
>
> -#ifndef arch_msi_check_device
> -int arch_msi_check_device(struct pci_dev *dev, int nvec, int type)
> +int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
>  {
> -       return 0;
> +       return -EINVAL;
>  }
> -#endif
>
> -#ifndef arch_setup_msi_irqs
> -# define arch_setup_msi_irqs default_setup_msi_irqs
> -# define HAVE_DEFAULT_MSI_SETUP_IRQS
> -#endif
> +void __weak arch_teardown_msi_irq(unsigned int irq)
> +{
> +}
>
> -#ifdef HAVE_DEFAULT_MSI_SETUP_IRQS
> -int default_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
> +int __weak arch_msi_check_device(struct pci_dev *dev, int nvec, int type)
> +{
> +       return 0;
> +}
> +
> +int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>  {
>         struct msi_desc *entry;
>         int ret;
> @@ -65,14 +66,11 @@ int default_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>
>         return 0;
>  }
> -#endif
>
> -#ifndef arch_teardown_msi_irqs
> -# define arch_teardown_msi_irqs default_teardown_msi_irqs
> -# define HAVE_DEFAULT_MSI_TEARDOWN_IRQS
> -#endif
> -
> -#ifdef HAVE_DEFAULT_MSI_TEARDOWN_IRQS
> +/*
> + * We have a default implementation available as a separate non-weak
> + * function, as it is used by the Xen x86 PCI code
> + */
>  void default_teardown_msi_irqs(struct pci_dev *dev)
>  {
>         struct msi_desc *entry;
> @@ -86,15 +84,13 @@ void default_teardown_msi_irqs(struct pci_dev *dev)
>                         arch_teardown_msi_irq(entry->irq + i);
>         }
>  }
> -#endif
>
> -#ifndef arch_restore_msi_irqs
> -# define arch_restore_msi_irqs default_restore_msi_irqs
> -# define HAVE_DEFAULT_MSI_RESTORE_IRQS
> -#endif
> +void __weak arch_teardown_msi_irqs(struct pci_dev *dev)
> +{
> +       return default_teardown_msi_irqs(dev);
> +}
>
> -#ifdef HAVE_DEFAULT_MSI_RESTORE_IRQS
> -void default_restore_msi_irqs(struct pci_dev *dev, int irq)
> +void __weak arch_restore_msi_irqs(struct pci_dev *dev, int irq)
>  {
>         struct msi_desc *entry;
>
> @@ -111,7 +107,6 @@ void default_restore_msi_irqs(struct pci_dev *dev, int irq)
>         if (entry)
>                 write_msi_msg(irq, &entry->msg);
>  }
> -#endif
>
>  static void msi_set_enable(struct pci_dev *dev, int enable)
>  {
> diff --git a/include/linux/msi.h b/include/linux/msi.h
> index 20c2d6d..c82ff8d 100644
> --- a/include/linux/msi.h
> +++ b/include/linux/msi.h
> @@ -50,12 +50,17 @@ struct msi_desc {
>  };
>
>  /*
> - * The arch hook for setup up msi irqs
> + * The arch hooks to setup up msi irqs. Those functions are
> + * implemented as weak symbols so that they /can/ be overriden by
> + * architecture specific code if needed.
>   */
>  int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc);
>  void arch_teardown_msi_irq(unsigned int irq);
>  int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
>  void arch_teardown_msi_irqs(struct pci_dev *dev);
>  int arch_msi_check_device(struct pci_dev* dev, int nvec, int type);
> +void arch_restore_msi_irqs(struct pci_dev *dev, int irq);
> +
> +void default_teardown_msi_irqs(struct pci_dev *dev);
>
>  #endif /* LINUX_MSI_H */
> --
> 1.8.1.2
>

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

* Re: [PATCHv4 02/11] pci: use weak functions for MSI arch-specific functions
  2013-07-05 21:32   ` Bjorn Helgaas
@ 2013-07-05 21:34     ` Bjorn Helgaas
  2013-07-05 21:40       ` Thomas Petazzoni
  0 siblings, 1 reply; 15+ messages in thread
From: Bjorn Helgaas @ 2013-07-05 21:34 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Lior Amsalem, Andrew Lunn, linux-ia64@vger.kernel.org,
	linux-mips@linux-mips.org, linux-pci@vger.kernel.org,
	Heiko Carstens, Thierry Reding, Paul Mackerras, H. Peter Anvin,
	sparclinux, linux-s390, Russell King, x86@kernel.org, Ingo Molnar,
	Ezequiel Garcia, Fenghua Yu, Jason Cooper, Rob Herring,
	Chris Metcalf, Gregory Clement, Thomas Gleixner, linux-arm,
	Tony Luck, Ralf Baechle, Maen Suleiman, Martin Schwidefsky,
	linux390, linuxppc-dev, David S. Miller

On Fri, Jul 5, 2013 at 3:32 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:

> Acked-by: Bjorn Helgaas <bhelgaas@google.com>

But please update your subject line to use consistent capitalization, e.g.,

PCI: Use weak ...

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

* Re: [PATCHv4 03/11] pci: remove ARCH_SUPPORTS_MSI kconfig option
  2013-07-01 13:42 ` [PATCHv4 03/11] pci: remove ARCH_SUPPORTS_MSI kconfig option Thomas Petazzoni
@ 2013-07-05 21:37   ` Bjorn Helgaas
  2013-07-05 21:45     ` Thomas Petazzoni
  0 siblings, 1 reply; 15+ messages in thread
From: Bjorn Helgaas @ 2013-07-05 21:37 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Lior Amsalem, Andrew Lunn, linux-ia64@vger.kernel.org,
	linux-mips@linux-mips.org, linux-pci@vger.kernel.org,
	Heiko Carstens, Thierry Reding, Paul Mackerras, H. Peter Anvin,
	sparclinux, linux-s390, Russell King, x86@kernel.org, Ingo Molnar,
	Ezequiel Garcia, Fenghua Yu, Jason Cooper, Rob Herring,
	Chris Metcalf, Gregory Clement, Thomas Gleixner, linux-arm,
	Tony Luck, Ralf Baechle, Maen Suleiman, Martin Schwidefsky,
	linux390, linuxppc-dev, David S. Miller

On Mon, Jul 1, 2013 at 7:42 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Now that we have weak versions for each of the PCI MSI architecture
> functions, we can actually build the MSI support for all platforms,
> regardless of whether they provide or not architecture-specific
> versions of those functions. For this reason, the ARCH_SUPPORTS_MSI
> hidden kconfig boolean becomes useless, and this patch gets rid of it.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
> Cc: linux390@de.ibm.com
> Cc: linux-s390@vger.kernel.org
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: linux-ia64@vger.kernel.org
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: linux-mips@linux-mips.org
> Cc: David S. Miller <davem@davemloft.net>
> Cc: sparclinux@vger.kernel.org
> Cc: Chris Metcalf <cmetcalf@tilera.com>

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

Again, please update the subject line to "PCI: Remove ..."

I doubt that you'll get explicit acks from all the arches you touched,
but I think it's reasonable to put at least patches 2 & 3 in -next
soon after v3.11-rc1, so we should have time to shake out issues.

> ---
>  arch/arm/Kconfig     | 1 -
>  arch/ia64/Kconfig    | 1 -
>  arch/mips/Kconfig    | 2 --
>  arch/powerpc/Kconfig | 1 -
>  arch/s390/Kconfig    | 1 -
>  arch/sparc/Kconfig   | 1 -
>  arch/tile/Kconfig    | 1 -
>  arch/x86/Kconfig     | 1 -
>  drivers/pci/Kconfig  | 4 ----
>  9 files changed, 13 deletions(-)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 8ab5962..3413679 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -435,7 +435,6 @@ config ARCH_NETX
>  config ARCH_IOP13XX
>         bool "IOP13xx-based"
>         depends on MMU
> -       select ARCH_SUPPORTS_MSI
>         select CPU_XSC3
>         select NEED_MACH_MEMORY_H
>         select NEED_RET_TO_USER
> diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
> index 1a2b774..943d425 100644
> --- a/arch/ia64/Kconfig
> +++ b/arch/ia64/Kconfig
> @@ -9,7 +9,6 @@ config IA64
>         select PCI if (!IA64_HP_SIM)
>         select ACPI if (!IA64_HP_SIM)
>         select PM if (!IA64_HP_SIM)
> -       select ARCH_SUPPORTS_MSI
>         select HAVE_UNSTABLE_SCHED_CLOCK
>         select HAVE_IDE
>         select HAVE_OPROFILE
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index 7a58ab9..96c1225 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -763,7 +763,6 @@ config CAVIUM_OCTEON_REFERENCE_BOARD
>         select SYS_HAS_CPU_CAVIUM_OCTEON
>         select SWAP_IO_SPACE
>         select HW_HAS_PCI
> -       select ARCH_SUPPORTS_MSI
>         select ZONE_DMA32
>         select USB_ARCH_HAS_OHCI
>         select USB_ARCH_HAS_EHCI
> @@ -799,7 +798,6 @@ config NLM_XLR_BOARD
>         select CEVT_R4K
>         select CSRC_R4K
>         select IRQ_CPU
> -       select ARCH_SUPPORTS_MSI
>         select ZONE_DMA32 if 64BIT
>         select SYNC_R4K
>         select SYS_HAS_EARLY_PRINTK
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index c33e3ad..f9d9d8e 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -734,7 +734,6 @@ config PCI
>         default y if !40x && !CPM2 && !8xx && !PPC_83xx \
>                 && !PPC_85xx && !PPC_86xx && !GAMECUBE_COMMON
>         default PCI_QSPAN if !4xx && !CPM2 && 8xx
> -       select ARCH_SUPPORTS_MSI
>         select GENERIC_PCI_IOMAP
>         help
>           Find out whether your system includes a PCI bus. PCI is the name of
> diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
> index da183c5..9a6225b 100644
> --- a/arch/s390/Kconfig
> +++ b/arch/s390/Kconfig
> @@ -429,7 +429,6 @@ menuconfig PCI
>         bool "PCI support"
>         default n
>         depends on 64BIT
> -       select ARCH_SUPPORTS_MSI
>         select PCI_MSI
>         help
>           Enable PCI support.
> diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
> index 9ac9f16..822e1a1 100644
> --- a/arch/sparc/Kconfig
> +++ b/arch/sparc/Kconfig
> @@ -52,7 +52,6 @@ config SPARC32
>
>  config SPARC64
>         def_bool 64BIT
> -       select ARCH_SUPPORTS_MSI
>         select HAVE_FUNCTION_TRACER
>         select HAVE_FUNCTION_GRAPH_TRACER
>         select HAVE_FUNCTION_GRAPH_FP_TEST
> diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
> index 3aa3766..d2d519c 100644
> --- a/arch/tile/Kconfig
> +++ b/arch/tile/Kconfig
> @@ -379,7 +379,6 @@ config PCI
>         select PCI_DOMAINS
>         select GENERIC_PCI_IOMAP
>         select TILE_GXIO_TRIO if TILEGX
> -       select ARCH_SUPPORTS_MSI if TILEGX
>         select PCI_MSI if TILEGX
>         ---help---
>           Enable PCI root complex support, so PCIe endpoint devices can
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 685692c..4229ce0 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -1999,7 +1999,6 @@ menu "Bus options (PCI etc.)"
>  config PCI
>         bool "PCI support"
>         default y
> -       select ARCH_SUPPORTS_MSI if (X86_LOCAL_APIC && X86_IO_APIC)
>         ---help---
>           Find out whether you have a PCI motherboard. PCI is the name of a
>           bus system, i.e. the way the CPU talks to the other stuff inside
> diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
> index ac45398..3d4c061 100644
> --- a/drivers/pci/Kconfig
> +++ b/drivers/pci/Kconfig
> @@ -1,13 +1,9 @@
>  #
>  # PCI configuration
>  #
> -config ARCH_SUPPORTS_MSI
> -       bool
> -
>  config PCI_MSI
>         bool "Message Signaled Interrupts (MSI and MSI-X)"
>         depends on PCI
> -       depends on ARCH_SUPPORTS_MSI
>         help
>            This allows device drivers to enable MSI (Message Signaled
>            Interrupts).  Message Signaled Interrupts enable a device to
> --
> 1.8.1.2
>

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

* Re: [PATCHv4 02/11] pci: use weak functions for MSI arch-specific functions
  2013-07-05 21:34     ` Bjorn Helgaas
@ 2013-07-05 21:40       ` Thomas Petazzoni
  0 siblings, 0 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2013-07-05 21:40 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Lior Amsalem, Andrew Lunn, linux-ia64@vger.kernel.org,
	linux-mips@linux-mips.org, linux-pci@vger.kernel.org,
	Heiko Carstens, Thierry Reding, Paul Mackerras, H. Peter Anvin,
	sparclinux, linux-s390, Russell King, x86@kernel.org, Ingo Molnar,
	Ezequiel Garcia, Fenghua Yu, Jason Cooper, Rob Herring,
	Chris Metcalf, Gregory Clement, Thomas Gleixner, linux-arm,
	Tony Luck, Ralf Baechle, Maen Suleiman, Martin Schwidefsky,
	linux390, linuxppc-dev, David S. Miller

Dear Bjorn Helgaas,

On Fri, 5 Jul 2013 15:34:10 -0600, Bjorn Helgaas wrote:
> On Fri, Jul 5, 2013 at 3:32 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> 
> > Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> 
> But please update your subject line to use consistent capitalization, e.g.,
> 
> PCI: Use weak ...

Sure, will do.

Would it be possible to get Tested-by and/or Acked-by from the
different architecture maintainers affected by PATCH 02/11 and PATCH
03/11 ?

Thanks,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* Re: [PATCHv4 03/11] pci: remove ARCH_SUPPORTS_MSI kconfig option
  2013-07-05 21:37   ` Bjorn Helgaas
@ 2013-07-05 21:45     ` Thomas Petazzoni
  2013-07-06 13:54       ` Jason Cooper
  0 siblings, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2013-07-05 21:45 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Lior Amsalem, Andrew Lunn, linux-ia64@vger.kernel.org,
	linux-mips@linux-mips.org, linux-pci@vger.kernel.org,
	Heiko Carstens, Thierry Reding, Paul Mackerras, H. Peter Anvin,
	sparclinux, linux-s390, Russell King, x86@kernel.org, Ingo Molnar,
	Ezequiel Garcia, Fenghua Yu, Jason Cooper, Rob Herring,
	Chris Metcalf, Gregory Clement, Thomas Gleixner, linux-arm,
	Tony Luck, Ralf Baechle, Maen Suleiman, Martin Schwidefsky,
	linux390, linuxppc-dev, David S. Miller

Dear Bjorn Helgaas,

On Fri, 5 Jul 2013 15:37:33 -0600, Bjorn Helgaas wrote:

> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> 
> Again, please update the subject line to "PCI: Remove ..."
> 
> I doubt that you'll get explicit acks from all the arches you touched,
> but I think it's reasonable to put at least patches 2 & 3 in -next
> soon after v3.11-rc1, so we should have time to shake out issues.

Sure. Which merge strategy do you suggest for this patch series, which
touches a number of different areas, and has some build-time
dependencies between the patches (if needed, I can detail those build
time dependencies to help figuring out the best strategy).

Thanks,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* Re: [PATCHv4 03/11] pci: remove ARCH_SUPPORTS_MSI kconfig option
  2013-07-05 21:45     ` Thomas Petazzoni
@ 2013-07-06 13:54       ` Jason Cooper
  2013-07-06 15:40         ` Bjorn Helgaas
  0 siblings, 1 reply; 15+ messages in thread
From: Jason Cooper @ 2013-07-06 13:54 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Lior Amsalem, linux-mips@linux-mips.org,
	linux-ia64@vger.kernel.org, Andrew Lunn,
	linux-pci@vger.kernel.org, Heiko Carstens, Gregory Clement,
	Thierry Reding, Paul Mackerras, H. Peter Anvin, sparclinux,
	linux-s390, Russell King, x86@kernel.org, Ingo Molnar,
	Ezequiel Garcia, Fenghua Yu, Chris Metcalf, Rob Herring,
	Bjorn Helgaas, Thomas Gleixner, linux-arm, Tony Luck,
	Ralf Baechle, Maen Suleiman, Martin Schwidefsky, linux390,
	linuxppc-dev, David S. Miller

On Fri, Jul 05, 2013 at 11:45:01PM +0200, Thomas Petazzoni wrote:
> Dear Bjorn Helgaas,
> 
> On Fri, 5 Jul 2013 15:37:33 -0600, Bjorn Helgaas wrote:
> 
> > Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> > 
> > Again, please update the subject line to "PCI: Remove ..."
> > 
> > I doubt that you'll get explicit acks from all the arches you touched,
> > but I think it's reasonable to put at least patches 2 & 3 in -next
> > soon after v3.11-rc1, so we should have time to shake out issues.
> 
> Sure. Which merge strategy do you suggest for this patch series, which
> touches a number of different areas, and has some build-time
> dependencies between the patches (if needed, I can detail those build
> time dependencies to help figuring out the best strategy).

If we end up handling this the same as the of/pci & mvebu-pcie series
(whole series through mvebu -> arm-soc) I can have it up in -next within
a few days of -rc1.  Just let me know.

hth,

Jason.

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

* Re: [PATCHv4 03/11] pci: remove ARCH_SUPPORTS_MSI kconfig option
  2013-07-06 13:54       ` Jason Cooper
@ 2013-07-06 15:40         ` Bjorn Helgaas
  2013-07-06 16:17           ` Jason Cooper
  0 siblings, 1 reply; 15+ messages in thread
From: Bjorn Helgaas @ 2013-07-06 15:40 UTC (permalink / raw)
  To: Jason Cooper
  Cc: Lior Amsalem, linux-mips@linux-mips.org,
	linux-ia64@vger.kernel.org, Andrew Lunn,
	linux-pci@vger.kernel.org, Heiko Carstens, Thierry Reding,
	Paul Mackerras, H. Peter Anvin, sparclinux, linux-s390,
	Russell King, x86@kernel.org, Ingo Molnar, Ezequiel Garcia,
	Fenghua Yu, Chris Metcalf, Rob Herring, Gregory Clement,
	Thomas Gleixner, linux-arm, Thomas Petazzoni, Tony Luck,
	Ralf Baechle, Maen Suleiman, Martin Schwidefsky, linux390,
	linuxppc-dev, David S. Miller

On Sat, Jul 6, 2013 at 7:54 AM, Jason Cooper <jason@lakedaemon.net> wrote:
> On Fri, Jul 05, 2013 at 11:45:01PM +0200, Thomas Petazzoni wrote:
>> Dear Bjorn Helgaas,
>>
>> On Fri, 5 Jul 2013 15:37:33 -0600, Bjorn Helgaas wrote:
>>
>> > Acked-by: Bjorn Helgaas <bhelgaas@google.com>
>> >
>> > Again, please update the subject line to "PCI: Remove ..."
>> >
>> > I doubt that you'll get explicit acks from all the arches you touched,
>> > but I think it's reasonable to put at least patches 2 & 3 in -next
>> > soon after v3.11-rc1, so we should have time to shake out issues.
>>
>> Sure. Which merge strategy do you suggest for this patch series, which
>> touches a number of different areas, and has some build-time
>> dependencies between the patches (if needed, I can detail those build
>> time dependencies to help figuring out the best strategy).
>
> If we end up handling this the same as the of/pci & mvebu-pcie series
> (whole series through mvebu -> arm-soc) I can have it up in -next within
> a few days of -rc1.  Just let me know.

That sounds fine with me.  I don't think it's worth trying to split
out the drivers/pci stuff and trying to coordinate it going through
different trees.

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

* Re: [PATCHv4 03/11] pci: remove ARCH_SUPPORTS_MSI kconfig option
  2013-07-06 15:40         ` Bjorn Helgaas
@ 2013-07-06 16:17           ` Jason Cooper
  2013-07-06 16:33             ` Thomas Petazzoni
  0 siblings, 1 reply; 15+ messages in thread
From: Jason Cooper @ 2013-07-06 16:17 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Lior Amsalem, linux-mips@linux-mips.org,
	linux-ia64@vger.kernel.org, Andrew Lunn,
	linux-pci@vger.kernel.org, Heiko Carstens, Thierry Reding,
	Paul Mackerras, H. Peter Anvin, sparclinux, linux-s390,
	Russell King, x86@kernel.org, Ingo Molnar, Ezequiel Garcia,
	Fenghua Yu, Chris Metcalf, Rob Herring, Gregory Clement,
	Thomas Gleixner, linux-arm, Thomas Petazzoni, Tony Luck,
	Ralf Baechle, Maen Suleiman, Martin Schwidefsky, linux390,
	linuxppc-dev, David S. Miller

On Sat, Jul 06, 2013 at 09:40:55AM -0600, Bjorn Helgaas wrote:
> On Sat, Jul 6, 2013 at 7:54 AM, Jason Cooper <jason@lakedaemon.net> wrote:
> > On Fri, Jul 05, 2013 at 11:45:01PM +0200, Thomas Petazzoni wrote:
> >> Dear Bjorn Helgaas,
> >>
> >> On Fri, 5 Jul 2013 15:37:33 -0600, Bjorn Helgaas wrote:
> >>
> >> > Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> >> >
> >> > Again, please update the subject line to "PCI: Remove ..."
> >> >
> >> > I doubt that you'll get explicit acks from all the arches you touched,
> >> > but I think it's reasonable to put at least patches 2 & 3 in -next
> >> > soon after v3.11-rc1, so we should have time to shake out issues.
> >>
> >> Sure. Which merge strategy do you suggest for this patch series, which
> >> touches a number of different areas, and has some build-time
> >> dependencies between the patches (if needed, I can detail those build
> >> time dependencies to help figuring out the best strategy).
> >
> > If we end up handling this the same as the of/pci & mvebu-pcie series
> > (whole series through mvebu -> arm-soc) I can have it up in -next within
> > a few days of -rc1.  Just let me know.
> 
> That sounds fine with me.  I don't think it's worth trying to split
> out the drivers/pci stuff and trying to coordinate it going through
> different trees.

Ok, will do.

Thomas, I assume there will be one more version to address Bjorn's last
comments?

thx,

Jason.

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

* Re: [PATCHv4 03/11] pci: remove ARCH_SUPPORTS_MSI kconfig option
  2013-07-06 16:17           ` Jason Cooper
@ 2013-07-06 16:33             ` Thomas Petazzoni
  0 siblings, 0 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2013-07-06 16:33 UTC (permalink / raw)
  To: Jason Cooper
  Cc: Lior Amsalem, Andrew Lunn, linux-ia64@vger.kernel.org,
	linux-mips@linux-mips.org, linux-pci@vger.kernel.org,
	Heiko Carstens, Gregory Clement, Thierry Reding, Paul Mackerras,
	H. Peter Anvin, sparclinux, linux-s390, Russell King,
	x86@kernel.org, Ingo Molnar, Ezequiel Garcia, Fenghua Yu,
	Chris Metcalf, Rob Herring, Bjorn Helgaas, Thomas Gleixner,
	linux-arm, Tony Luck, Ralf Baechle, Maen Suleiman,
	Martin Schwidefsky, linux390, linuxppc-dev, David S. Miller

Dear Jason Cooper,

On Sat, 6 Jul 2013 12:17:43 -0400, Jason Cooper wrote:

> > > If we end up handling this the same as the of/pci & mvebu-pcie series
> > > (whole series through mvebu -> arm-soc) I can have it up in -next within
> > > a few days of -rc1.  Just let me know.
> > 
> > That sounds fine with me.  I don't think it's worth trying to split
> > out the drivers/pci stuff and trying to coordinate it going through
> > different trees.
> 
> Ok, will do.
> 
> Thomas, I assume there will be one more version to address Bjorn's last
> comments?

Yes, indeed. I was waiting to see if Thierry Redding would give some
additional feedback on Bjorn's comment, but if he doesn't, I'll resend
an updated version, most likely next week.

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

end of thread, other threads:[~2013-07-06 16:33 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1372686136-1370-1-git-send-email-thomas.petazzoni@free-electrons.com>
2013-07-01 13:42 ` [PATCHv4 02/11] pci: use weak functions for MSI arch-specific functions Thomas Petazzoni
2013-07-02  0:53   ` Michael Ellerman
2013-07-02  5:30     ` Thomas Petazzoni
2013-07-02  6:52       ` Michael Ellerman
2013-07-02 17:14       ` Bjorn Helgaas
2013-07-05 21:32   ` Bjorn Helgaas
2013-07-05 21:34     ` Bjorn Helgaas
2013-07-05 21:40       ` Thomas Petazzoni
2013-07-01 13:42 ` [PATCHv4 03/11] pci: remove ARCH_SUPPORTS_MSI kconfig option Thomas Petazzoni
2013-07-05 21:37   ` Bjorn Helgaas
2013-07-05 21:45     ` Thomas Petazzoni
2013-07-06 13:54       ` Jason Cooper
2013-07-06 15:40         ` Bjorn Helgaas
2013-07-06 16:17           ` Jason Cooper
2013-07-06 16:33             ` Thomas Petazzoni

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