linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms
@ 2014-09-05 10:09 Yijing Wang
  2014-09-05 10:09 ` [PATCH v1 01/21] PCI/MSI: Clean up struct msi_chip argument Yijing Wang
                   ` (21 more replies)
  0 siblings, 22 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:09 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

This series is based Bjorn's pci-next branch + Alexander Gordeev's two patches
"Remove arch_msi_check_device()" link: https://lkml.org/lkml/2014/7/12/41

Currently, there are a lot of weak arch functions in MSI code.
Thierry Reding Introduced MSI chip framework to configure MSI/MSI-X in arm.
This series use MSI chip framework to refactor MSI code across all platforms
to eliminate weak arch functions. It has been tested fine in x86(with or without
irq remap).


RFC->v1: Updated "[patch 4/21] x86/xen/MSI: Eliminate...", export msi_chip instead
         of #ifdef to fix MSI bug in xen running in x86. 
		 Rename arch_get_match_msi_chip() to arch_find_msi_chip().
		 Drop use struct device as the msi_chip argument, we will do that
		 later in another patchset.

Yijing Wang (21):
  PCI/MSI: Clean up struct msi_chip argument
  PCI/MSI: Remove useless bus->msi assignment
  MSI: Remove the redundant irq_set_chip_data()
  x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq()
  PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip
  PCI/MSI: Refactor struct msi_chip to make it become more common
  x86/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  x86/xen/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  Irq_remapping/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  x86/MSI: Remove unused MSI weak arch functions
  MIPS/Octeon/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  MIPS/Xlp: Remove the dead function destroy_irq() to fix build error
  MIPS/Xlp/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  MIPS/Xlr/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  Powerpc/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  s390/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  arm/iop13xx/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  IA64/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  Sparc/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  tile/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  PCI/MSI: Clean up unused MSI arch functions

 arch/arm/mach-iop13xx/include/mach/pci.h |    2 +
 arch/arm/mach-iop13xx/iq81340mc.c        |    1 +
 arch/arm/mach-iop13xx/iq81340sc.c        |    1 +
 arch/arm/mach-iop13xx/msi.c              |    9 ++-
 arch/arm/mach-iop13xx/pci.c              |    6 ++
 arch/ia64/kernel/msi_ia64.c              |   18 ++++-
 arch/mips/pci/msi-octeon.c               |   35 +++++---
 arch/mips/pci/msi-xlp.c                  |   18 +++-
 arch/mips/pci/pci-xlr.c                  |   15 +++-
 arch/powerpc/kernel/msi.c                |   14 +++-
 arch/s390/pci/pci.c                      |   18 ++++-
 arch/sparc/kernel/pci.c                  |   14 +++-
 arch/tile/kernel/pci_gx.c                |   14 +++-
 arch/x86/include/asm/apic.h              |    4 +
 arch/x86/include/asm/pci.h               |    4 +-
 arch/x86/include/asm/x86_init.h          |    7 --
 arch/x86/kernel/apic/io_apic.c           |   16 ++++-
 arch/x86/kernel/x86_init.c               |   34 --------
 arch/x86/pci/xen.c                       |   60 +++++++++------
 drivers/iommu/irq_remapping.c            |    9 ++-
 drivers/irqchip/irq-armada-370-xp.c      |   12 +--
 drivers/pci/host/pci-tegra.c             |    8 +-
 drivers/pci/host/pcie-designware.c       |    4 +-
 drivers/pci/host/pcie-rcar.c             |    8 +-
 drivers/pci/msi.c                        |  123 +++++++++++++-----------------
 drivers/pci/probe.c                      |    1 -
 include/linux/msi.h                      |   26 ++-----
 27 files changed, 268 insertions(+), 213 deletions(-)


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

* [PATCH v1 01/21] PCI/MSI: Clean up struct msi_chip argument
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
@ 2014-09-05 10:09 ` Yijing Wang
  2014-09-05 10:09 ` [PATCH v1 02/21] PCI/MSI: Remove useless bus->msi assignment Yijing Wang
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:09 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang, Thierry Reding, Thomas Petazzoni

Msi_chip functions setup_irq/teardown_irq rarely use msi_chip
argument. We can look up msi_chip pointer by the device pointer
or irq number, so clean up msi_chip argument.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
CC: Thierry Reding <thierry.reding@gmail.com>
CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 drivers/irqchip/irq-armada-370-xp.c |   12 +++++-------
 drivers/pci/host/pci-tegra.c        |    8 +++++---
 drivers/pci/host/pcie-designware.c  |    4 ++--
 drivers/pci/host/pcie-rcar.c        |    8 +++++---
 drivers/pci/msi.c                   |    4 ++--
 include/linux/msi.h                 |    5 ++---
 6 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index 574aba0..658990c 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -129,9 +129,8 @@ static void armada_370_xp_free_msi(int hwirq)
 	mutex_unlock(&msi_used_lock);
 }
 
-static int armada_370_xp_setup_msi_irq(struct msi_chip *chip,
-				       struct pci_dev *pdev,
-				       struct msi_desc *desc)
+static int armada_370_xp_setup_msi_irq(struct pci_dev *pdev,
+		struct msi_desc *desc)
 {
 	struct msi_msg msg;
 	int virq, hwirq;
@@ -156,8 +155,7 @@ static int armada_370_xp_setup_msi_irq(struct msi_chip *chip,
 	return 0;
 }
 
-static void armada_370_xp_teardown_msi_irq(struct msi_chip *chip,
-					   unsigned int irq)
+static void armada_370_xp_teardown_msi_irq(unsigned int irq)
 {
 	struct irq_data *d = irq_get_irq_data(irq);
 	unsigned long hwirq = d->hwirq;
@@ -166,8 +164,8 @@ static void armada_370_xp_teardown_msi_irq(struct msi_chip *chip,
 	armada_370_xp_free_msi(hwirq);
 }
 
-static int armada_370_xp_check_msi_device(struct msi_chip *chip, struct pci_dev *dev,
-					  int nvec, int type)
+static int armada_370_xp_check_msi_device(struct pci_dev *dev,
+		int nvec, int type)
 {
 	/* We support MSI, but not MSI-X */
 	if (type == PCI_CAP_ID_MSI)
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 0fb0fdb..edd4040 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -1157,9 +1157,10 @@ static irqreturn_t tegra_pcie_msi_irq(int irq, void *data)
 	return processed > 0 ? IRQ_HANDLED : IRQ_NONE;
 }
 
-static int tegra_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev,
+static int tegra_msi_setup_irq(struct pci_dev *pdev,
 			       struct msi_desc *desc)
 {
+	struct msi_chip *chip = pdev->bus->msi;
 	struct tegra_msi *msi = to_tegra_msi(chip);
 	struct msi_msg msg;
 	unsigned int irq;
@@ -1185,10 +1186,11 @@ static int tegra_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev,
 	return 0;
 }
 
-static void tegra_msi_teardown_irq(struct msi_chip *chip, unsigned int irq)
+static void tegra_msi_teardown_irq(unsigned int irq)
 {
-	struct tegra_msi *msi = to_tegra_msi(chip);
 	struct irq_data *d = irq_get_irq_data(irq);
+	struct msi_chip *chip = irq_get_chip_data(irq);
+	struct tegra_msi *msi = to_tegra_msi(chip);
 
 	tegra_msi_free(msi, d->hwirq);
 }
diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index 52bd3a1..2204456 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -342,7 +342,7 @@ static void clear_irq(unsigned int irq)
 	msi->msi_attrib.multiple = 0;
 }
 
-static int dw_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev,
+static int dw_msi_setup_irq(struct pci_dev *pdev,
 			struct msi_desc *desc)
 {
 	int irq, pos, msgvec;
@@ -384,7 +384,7 @@ static int dw_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev,
 	return 0;
 }
 
-static void dw_msi_teardown_irq(struct msi_chip *chip, unsigned int irq)
+static void dw_msi_teardown_irq(unsigned int irq)
 {
 	clear_irq(irq);
 }
diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index 4884ee5..647bc9f 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -615,9 +615,10 @@ static irqreturn_t rcar_pcie_msi_irq(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static int rcar_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev,
+static int rcar_msi_setup_irq(struct pci_dev *pdev,
 			      struct msi_desc *desc)
 {
+	struct msi_chip *chip = pdev->bus->msi;
 	struct rcar_msi *msi = to_rcar_msi(chip);
 	struct rcar_pcie *pcie = container_of(chip, struct rcar_pcie, msi.chip);
 	struct msi_msg msg;
@@ -645,10 +646,11 @@ static int rcar_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev,
 	return 0;
 }
 
-static void rcar_msi_teardown_irq(struct msi_chip *chip, unsigned int irq)
+static void rcar_msi_teardown_irq(unsigned int irq)
 {
-	struct rcar_msi *msi = to_rcar_msi(chip);
 	struct irq_data *d = irq_get_irq_data(irq);
+	struct msi_chip *chip = irq_get_chip_data(irq);
+	struct rcar_msi *msi = to_rcar_msi(chip);
 
 	rcar_msi_free(msi, d->hwirq);
 }
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 8fc9587..f6cb317 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -37,7 +37,7 @@ int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
 	if (!chip || !chip->setup_irq)
 		return -EINVAL;
 
-	err = chip->setup_irq(chip, dev, desc);
+	err = chip->setup_irq(dev, desc);
 	if (err < 0)
 		return err;
 
@@ -53,7 +53,7 @@ void __weak arch_teardown_msi_irq(unsigned int irq)
 	if (!chip || !chip->teardown_irq)
 		return;
 
-	chip->teardown_irq(chip, irq);
+	chip->teardown_irq(irq);
 }
 
 int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
diff --git a/include/linux/msi.h b/include/linux/msi.h
index c3c70a6..762fe61 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -71,9 +71,8 @@ struct msi_chip {
 	struct device_node *of_node;
 	struct list_head list;
 
-	int (*setup_irq)(struct msi_chip *chip, struct pci_dev *dev,
-			 struct msi_desc *desc);
-	void (*teardown_irq)(struct msi_chip *chip, unsigned int irq);
+	int (*setup_irq)(struct pci_dev *dev, struct msi_desc *desc);
+	void (*teardown_irq)(unsigned int irq);
 };
 
 #endif /* LINUX_MSI_H */
-- 
1.7.1


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

* [PATCH v1 02/21] PCI/MSI: Remove useless bus->msi assignment
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
  2014-09-05 10:09 ` [PATCH v1 01/21] PCI/MSI: Clean up struct msi_chip argument Yijing Wang
@ 2014-09-05 10:09 ` Yijing Wang
  2014-09-05 10:09 ` [PATCH v1 03/21] MSI: Remove the redundant irq_set_chip_data() Yijing Wang
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:09 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang, Thierry Reding, Thomas Petazzoni

Currently, PCI drivers will initialize bus->msi in
pcibios_add_bus(). pcibios_add_bus() will be called
in every pci bus initialization. So the bus->msi
assignment in pci_alloc_child_bus() is useless.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
CC: Thierry Reding <thierry.reding@avionic-design.de>
CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 drivers/pci/probe.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index e3cf8a2..8296576 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -677,7 +677,6 @@ static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent,
 
 	child->parent = parent;
 	child->ops = parent->ops;
-	child->msi = parent->msi;
 	child->sysdata = parent->sysdata;
 	child->bus_flags = parent->bus_flags;
 
-- 
1.7.1


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

* [PATCH v1 03/21] MSI: Remove the redundant irq_set_chip_data()
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
  2014-09-05 10:09 ` [PATCH v1 01/21] PCI/MSI: Clean up struct msi_chip argument Yijing Wang
  2014-09-05 10:09 ` [PATCH v1 02/21] PCI/MSI: Remove useless bus->msi assignment Yijing Wang
@ 2014-09-05 10:09 ` Yijing Wang
  2014-09-15 14:00   ` Lucas Stach
  2014-09-05 10:09 ` [PATCH v1 04/21] x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq() Yijing Wang
                   ` (18 subsequent siblings)
  21 siblings, 1 reply; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:09 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Currently, pcie-designware, pcie-rcar, pci-tegra drivers
use irq chip_data to save the msi_chip pointer. They
already call irq_set_chip_data() in their own MSI irq map
functions. So irq_set_chip_data() in arch_setup_msi_irq()
is useless.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/pci/msi.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index f6cb317..d547f7f 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -41,8 +41,6 @@ int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
 	if (err < 0)
 		return err;
 
-	irq_set_chip_data(desc->irq, chip);
-
 	return 0;
 }
 
-- 
1.7.1


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

* [PATCH v1 04/21] x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq()
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (2 preceding siblings ...)
  2014-09-05 10:09 ` [PATCH v1 03/21] MSI: Remove the redundant irq_set_chip_data() Yijing Wang
@ 2014-09-05 10:09 ` Yijing Wang
  2014-09-10 12:36   ` [Xen-devel] " David Vrabel
  2014-09-05 10:09 ` [PATCH v1 05/21] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip Yijing Wang
                   ` (17 subsequent siblings)
  21 siblings, 1 reply; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:09 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Commit 0e4ccb150 added two __weak arch functions arch_msix_mask_irq()
and arch_msi_mask_irq() to fix a bug found when running xen in x86.
Introduced these two funcntions make MSI code complex. And mask/unmask
is the irq actions related to interrupt controller, should not use
weak arch functions to override mask/unmask interfaces. This patch
reverted commit 0e4ccb150 and export struct irq_chip msi_chip, modify
msi_chip->irq_mask/irq_unmask() in xen init functions to fix this
bug for simplicity. Also this is preparation for using struct
msi_chip instead of weak arch MSI functions in all platforms.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 arch/x86/include/asm/apic.h     |    4 ++++
 arch/x86/include/asm/x86_init.h |    3 ---
 arch/x86/kernel/apic/io_apic.c  |    2 +-
 arch/x86/kernel/x86_init.c      |   10 ----------
 arch/x86/pci/xen.c              |   16 ++++++----------
 drivers/pci/msi.c               |   22 ++++++----------------
 include/linux/msi.h             |    4 ++--
 7 files changed, 19 insertions(+), 42 deletions(-)

diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 465b309..47a5f94 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -43,6 +43,10 @@ static inline void generic_apic_probe(void)
 }
 #endif
 
+#ifdef CONFIG_PCI_MSI
+extern struct irq_chip msi_chip;
+#endif
+
 #ifdef CONFIG_X86_LOCAL_APIC
 
 extern unsigned int apic_verbosity;
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index e45e4da..f58a9c7 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -172,7 +172,6 @@ struct x86_platform_ops {
 
 struct pci_dev;
 struct msi_msg;
-struct msi_desc;
 
 struct x86_msi_ops {
 	int (*setup_msi_irqs)(struct pci_dev *dev, int nvec, int type);
@@ -183,8 +182,6 @@ struct x86_msi_ops {
 	void (*teardown_msi_irqs)(struct pci_dev *dev);
 	void (*restore_msi_irqs)(struct pci_dev *dev);
 	int  (*setup_hpet_msi)(unsigned int irq, unsigned int id);
-	u32 (*msi_mask_irq)(struct msi_desc *desc, u32 mask, u32 flag);
-	u32 (*msix_mask_irq)(struct msi_desc *desc, u32 flag);
 };
 
 struct IO_APIC_route_entry;
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index e877cfb..2a2ec28 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3161,7 +3161,7 @@ msi_set_affinity(struct irq_data *data, const struct cpumask *mask, bool force)
  * IRQ Chip for MSI PCI/PCI-X/PCI-Express Devices,
  * which implement the MSI or MSI-X Capability Structure.
  */
-static struct irq_chip msi_chip = {
+struct irq_chip msi_chip = {
 	.name			= "PCI-MSI",
 	.irq_unmask		= unmask_msi_irq,
 	.irq_mask		= mask_msi_irq,
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index e48b674..234b072 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -116,8 +116,6 @@ struct x86_msi_ops x86_msi = {
 	.teardown_msi_irqs	= default_teardown_msi_irqs,
 	.restore_msi_irqs	= default_restore_msi_irqs,
 	.setup_hpet_msi		= default_setup_hpet_msi,
-	.msi_mask_irq		= default_msi_mask_irq,
-	.msix_mask_irq		= default_msix_mask_irq,
 };
 
 /* MSI arch specific hooks */
@@ -140,14 +138,6 @@ void arch_restore_msi_irqs(struct pci_dev *dev)
 {
 	x86_msi.restore_msi_irqs(dev);
 }
-u32 arch_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
-{
-	return x86_msi.msi_mask_irq(desc, mask, flag);
-}
-u32 arch_msix_mask_irq(struct msi_desc *desc, u32 flag)
-{
-	return x86_msi.msix_mask_irq(desc, flag);
-}
 #endif
 
 struct x86_io_apic_ops x86_io_apic_ops = {
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
index ad03739..84c2fce 100644
--- a/arch/x86/pci/xen.c
+++ b/arch/x86/pci/xen.c
@@ -394,13 +394,9 @@ static void xen_teardown_msi_irq(unsigned int irq)
 {
 	xen_destroy_irq(irq);
 }
-static u32 xen_nop_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
-{
-	return 0;
-}
-static u32 xen_nop_msix_mask_irq(struct msi_desc *desc, u32 flag)
+
+void xen_nop_msi_mask(struct irq_data *data)
 {
-	return 0;
 }
 #endif
 
@@ -425,8 +421,8 @@ int __init pci_xen_init(void)
 	x86_msi.setup_msi_irqs = xen_setup_msi_irqs;
 	x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
 	x86_msi.teardown_msi_irqs = xen_teardown_msi_irqs;
-	x86_msi.msi_mask_irq = xen_nop_msi_mask_irq;
-	x86_msi.msix_mask_irq = xen_nop_msix_mask_irq;
+	msi_chip.irq_mask = xen_nop_msi_mask;
+	msi_chip.irq_unmask = xen_nop_msi_mask;
 #endif
 	return 0;
 }
@@ -506,8 +502,8 @@ int __init pci_xen_initial_domain(void)
 	x86_msi.setup_msi_irqs = xen_initdom_setup_msi_irqs;
 	x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
 	x86_msi.restore_msi_irqs = xen_initdom_restore_msi_irqs;
-	x86_msi.msi_mask_irq = xen_nop_msi_mask_irq;
-	x86_msi.msix_mask_irq = xen_nop_msix_mask_irq;
+	msi_chip.irq_mask = xen_nop_msi_mask;
+	msi_chip.irq_unmask = xen_nop_msi_mask;
 #endif
 	xen_setup_acpi_sci();
 	__acpi_register_gsi = acpi_register_gsi_xen;
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index d547f7f..a77e7f7 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -161,7 +161,7 @@ static inline __attribute_const__ u32 msi_mask(unsigned x)
  * reliably as devices without an INTx disable bit will then generate a
  * level IRQ which will never be cleared.
  */
-u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
+u32 __msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
 {
 	u32 mask_bits = desc->masked;
 
@@ -175,14 +175,9 @@ u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
 	return mask_bits;
 }
 
-__weak u32 arch_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
-{
-	return default_msi_mask_irq(desc, mask, flag);
-}
-
 static void msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
 {
-	desc->masked = arch_msi_mask_irq(desc, mask, flag);
+	desc->masked = __msi_mask_irq(desc, mask, flag);
 }
 
 /*
@@ -192,7 +187,7 @@ static void msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
  * file.  This saves a few milliseconds when initialising devices with lots
  * of MSI-X interrupts.
  */
-u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag)
+u32 __msix_mask_irq(struct msi_desc *desc, u32 flag)
 {
 	u32 mask_bits = desc->masked;
 	unsigned offset = desc->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE +
@@ -205,14 +200,9 @@ u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag)
 	return mask_bits;
 }
 
-__weak u32 arch_msix_mask_irq(struct msi_desc *desc, u32 flag)
-{
-	return default_msix_mask_irq(desc, flag);
-}
-
 static void msix_mask_irq(struct msi_desc *desc, u32 flag)
 {
-	desc->masked = arch_msix_mask_irq(desc, flag);
+	desc->masked = __msix_mask_irq(desc, flag);
 }
 
 static void msi_set_mask_bit(struct irq_data *data, u32 flag)
@@ -864,7 +854,7 @@ void pci_msi_shutdown(struct pci_dev *dev)
 	/* Return the device with MSI unmasked as initial states */
 	mask = msi_mask(desc->msi_attrib.multi_cap);
 	/* Keep cached state to be restored */
-	arch_msi_mask_irq(desc, mask, ~mask);
+	__msi_mask_irq(desc, mask, ~mask);
 
 	/* Restore dev->irq to its default pin-assertion irq */
 	dev->irq = desc->msi_attrib.default_irq;
@@ -964,7 +954,7 @@ void pci_msix_shutdown(struct pci_dev *dev)
 	/* Return the device with MSI-X masked as initial states */
 	list_for_each_entry(entry, &dev->msi_list, list) {
 		/* Keep cached states to be restored */
-		arch_msix_mask_irq(entry, 1);
+		__msix_mask_irq(entry, 1);
 	}
 
 	msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_ENABLE, 0);
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 762fe61..5650848 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -19,6 +19,8 @@ void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
 void get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
 void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
 void write_msi_msg(unsigned int irq, struct msi_msg *msg);
+u32 __msix_mask_irq(struct msi_desc *desc, u32 flag);
+u32 __msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag);
 
 struct msi_desc {
 	struct {
@@ -62,8 +64,6 @@ void arch_restore_msi_irqs(struct pci_dev *dev);
 
 void default_teardown_msi_irqs(struct pci_dev *dev);
 void default_restore_msi_irqs(struct pci_dev *dev);
-u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag);
-u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag);
 
 struct msi_chip {
 	struct module *owner;
-- 
1.7.1


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

* [PATCH v1 05/21] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (3 preceding siblings ...)
  2014-09-05 10:09 ` [PATCH v1 04/21] x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq() Yijing Wang
@ 2014-09-05 10:09 ` Yijing Wang
  2014-09-15 14:42   ` Lucas Stach
  2014-09-05 10:09 ` [PATCH v1 06/21] PCI/MSI: Refactor struct msi_chip to make it become more common Yijing Wang
                   ` (16 subsequent siblings)
  21 siblings, 1 reply; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:09 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Introduce weak arch_find_msi_chip() to find the match msi_chip.
Currently, MSI chip associates pci bus to msi_chip. Because in
ARM platform, there may be more than one MSI controller in system.
Associate pci bus to msi_chip help pci device to find the match
msi_chip and setup MSI/MSI-X irq correctly. But in other platform,
like in x86. we only need one MSI chip, because all device use
the same MSI address/data and irq etc. So it's no need to associate
pci bus to MSI chip, just use a arch function, arch_find_msi_chip()
to return the MSI chip for simplicity. The default weak
arch_find_msi_chip() used in ARM platform, find the MSI chip
by pci bus.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/pci/msi.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index a77e7f7..539c11d 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -29,9 +29,14 @@ static int pci_msi_enable = 1;
 
 /* Arch hooks */
 
+struct msi_chip * __weak arch_find_msi_chip(struct pci_dev *dev)
+{
+	return dev->bus->msi;
+}
+
 int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
 {
-	struct msi_chip *chip = dev->bus->msi;
+	struct msi_chip *chip = arch_find_msi_chip(dev);
 	int err;
 
 	if (!chip || !chip->setup_irq)
-- 
1.7.1


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

* [PATCH v1 06/21] PCI/MSI: Refactor struct msi_chip to make it become more common
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (4 preceding siblings ...)
  2014-09-05 10:09 ` [PATCH v1 05/21] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip Yijing Wang
@ 2014-09-05 10:09 ` Yijing Wang
  2014-09-15 14:44   ` Lucas Stach
  2014-09-05 10:09 ` [PATCH v1 07/21] x86/MSI: Use MSI chip framework to configure MSI/MSI-X irq Yijing Wang
                   ` (15 subsequent siblings)
  21 siblings, 1 reply; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:09 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Now there are a lot of __weak arch functions in MSI code.
These functions make MSI driver complex. Thierry Reding Introduced
a new MSI chip framework to configure MSI/MSI-X irq in ARM. Use
the new MSI chip framework to refactor all other platform MSI
arch code to eliminate weak arch MSI functions. This patch add
.restore_irq() and .setup_irqs() to make it become more common.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/pci/msi.c   |   15 +++++++++++++++
 include/linux/msi.h |    3 +++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 539c11d..d78d637 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -63,6 +63,11 @@ int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 {
 	struct msi_desc *entry;
 	int ret;
+	struct msi_chip *chip;
+
+	chip = arch_find_msi_chip(dev);
+	if (chip && chip->setup_irqs)
+		return chip->setup_irqs(dev, nvec, type);
 
 	/*
 	 * If an architecture wants to support multiple MSI, it needs to
@@ -105,6 +110,11 @@ void default_teardown_msi_irqs(struct pci_dev *dev)
 
 void __weak arch_teardown_msi_irqs(struct pci_dev *dev)
 {
+	struct msi_chip *chip = arch_find_msi_chip(dev);
+
+	if (chip && chip->teardown_irqs)
+		return chip->teardown_irqs(dev);
+
 	return default_teardown_msi_irqs(dev);
 }
 
@@ -128,6 +138,11 @@ static void default_restore_msi_irq(struct pci_dev *dev, int irq)
 
 void __weak arch_restore_msi_irqs(struct pci_dev *dev)
 {
+	struct msi_chip *chip = arch_find_msi_chip(dev);
+
+	if (chip && chip->restore_irqs)
+		return chip->restore_irqs(dev);
+
 	return default_restore_msi_irqs(dev);
 }
 
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 5650848..92a51e7 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -72,7 +72,10 @@ struct msi_chip {
 	struct list_head list;
 
 	int (*setup_irq)(struct pci_dev *dev, struct msi_desc *desc);
+	int (*setup_irqs)(struct pci_dev *dev, int nvec, int type);
 	void (*teardown_irq)(unsigned int irq);
+	void (*teardown_irqs)(struct pci_dev *dev);
+	void (*restore_irqs)(struct pci_dev *dev);
 };
 
 #endif /* LINUX_MSI_H */
-- 
1.7.1


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

* [PATCH v1 07/21] x86/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (5 preceding siblings ...)
  2014-09-05 10:09 ` [PATCH v1 06/21] PCI/MSI: Refactor struct msi_chip to make it become more common Yijing Wang
@ 2014-09-05 10:09 ` Yijing Wang
  2014-09-05 10:09 ` [PATCH v1 08/21] x86/xen/MSI: " Yijing Wang
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:09 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Use MSI chip framework instead of arch MSI functions to configure
MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/x86/include/asm/pci.h     |    1 +
 arch/x86/kernel/apic/io_apic.c |   12 ++++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 0892ea0..878a06d 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -101,6 +101,7 @@ void native_teardown_msi_irq(unsigned int irq);
 void native_restore_msi_irqs(struct pci_dev *dev);
 int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc,
 		  unsigned int irq_base, unsigned int irq_offset);
+extern struct msi_chip *x86_msi_chip;
 #else
 #define native_setup_msi_irqs		NULL
 #define native_teardown_msi_irq		NULL
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 2a2ec28..882b95e 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3337,6 +3337,18 @@ int default_setup_hpet_msi(unsigned int irq, unsigned int id)
 }
 #endif
 
+struct msi_chip apic_msi_chip = {
+	.setup_irqs = native_setup_msi_irqs,
+	.teardown_irq = native_teardown_msi_irq,
+};
+
+struct msi_chip *arch_find_msi_chip(struct pci_dev *dev)
+{
+	return x86_msi_chip;
+}
+
+struct msi_chip *x86_msi_chip = &apic_msi_chip;
+
 #endif /* CONFIG_PCI_MSI */
 /*
  * Hypertransport interrupt support
-- 
1.7.1


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

* [PATCH v1 08/21] x86/xen/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (6 preceding siblings ...)
  2014-09-05 10:09 ` [PATCH v1 07/21] x86/MSI: Use MSI chip framework to configure MSI/MSI-X irq Yijing Wang
@ 2014-09-05 10:09 ` Yijing Wang
  2014-09-05 14:29   ` [Xen-devel] " David Vrabel
  2014-09-05 10:09 ` [PATCH v1 09/21] Irq_remapping/MSI: " Yijing Wang
                   ` (13 subsequent siblings)
  21 siblings, 1 reply; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:09 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Use MSI chip framework instead of arch MSI functions to configure
MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 arch/x86/pci/xen.c |   46 ++++++++++++++++++++++++++++++----------------
 1 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
index 84c2fce..e669ee4 100644
--- a/arch/x86/pci/xen.c
+++ b/arch/x86/pci/xen.c
@@ -376,6 +376,11 @@ static void xen_initdom_restore_msi_irqs(struct pci_dev *dev)
 }
 #endif
 
+static void xen_teardown_msi_irq(unsigned int irq)
+{
+	xen_destroy_irq(irq);
+}
+
 static void xen_teardown_msi_irqs(struct pci_dev *dev)
 {
 	struct msi_desc *msidesc;
@@ -385,19 +390,26 @@ static void xen_teardown_msi_irqs(struct pci_dev *dev)
 		xen_pci_frontend_disable_msix(dev);
 	else
 		xen_pci_frontend_disable_msi(dev);
-
-	/* Free the IRQ's and the msidesc using the generic code. */
-	default_teardown_msi_irqs(dev);
-}
-
-static void xen_teardown_msi_irq(unsigned int irq)
-{
-	xen_destroy_irq(irq);
+
+	list_for_each_entry(msidesc, &dev->msi_list, list) {
+		int i, nvec;
+		if (msidesc->irq == 0)
+			continue;
+		if (msidesc->nvec_used)
+			nvec = msidesc->nvec_used;
+		else
+			nvec = 1 << msidesc->msi_attrib.multiple;
+		for (i = 0; i < nvec; i++)
+			xen_teardown_msi_irq(msidesc->irq + i);
+	}
 }
 
 void xen_nop_msi_mask(struct irq_data *data)
 {
 }
+
+struct msi_chip xen_msi_chip;
+
 #endif
 
 int __init pci_xen_init(void)
@@ -418,9 +430,9 @@ int __init pci_xen_init(void)
 #endif
 
 #ifdef CONFIG_PCI_MSI
-	x86_msi.setup_msi_irqs = xen_setup_msi_irqs;
-	x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
-	x86_msi.teardown_msi_irqs = xen_teardown_msi_irqs;
+	xen_msi_chip.setup_irqs = xen_setup_msi_irqs;
+	xen_msi_chip.teardown_irqs = xen_teardown_msi_irqs;
+	x86_msi_chip = &xen_msi_chip;
 	msi_chip.irq_mask = xen_nop_msi_mask;
 	msi_chip.irq_unmask = xen_nop_msi_mask;
 #endif
@@ -441,8 +453,9 @@ int __init pci_xen_hvm_init(void)
 #endif
 
 #ifdef CONFIG_PCI_MSI
-	x86_msi.setup_msi_irqs = xen_hvm_setup_msi_irqs;
-	x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
+	xen_msi_chip.setup_irqs = xen_hvm_setup_msi_irqs;
+	xen_msi_chip.teardown_irq = xen_teardown_msi_irq;
+	x86_msi_chip = &xen_msi_chip;
 #endif
 	return 0;
 }
@@ -499,9 +512,10 @@ int __init pci_xen_initial_domain(void)
 	int irq;
 
 #ifdef CONFIG_PCI_MSI
-	x86_msi.setup_msi_irqs = xen_initdom_setup_msi_irqs;
-	x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
-	x86_msi.restore_msi_irqs = xen_initdom_restore_msi_irqs;
+	xen_msi_chip.setup_irqs = xen_initdom_setup_msi_irqs;
+	xen_msi_chip.teardown_irq = xen_teardown_msi_irq;
+	xen_msi_chip.restore_irqs = xen_initdom_restore_msi_irqs;
+	x86_msi_chip = &xen_msi_chip;
 	msi_chip.irq_mask = xen_nop_msi_mask;
 	msi_chip.irq_unmask = xen_nop_msi_mask;
 #endif
-- 
1.7.1


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

* [PATCH v1 09/21] Irq_remapping/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (7 preceding siblings ...)
  2014-09-05 10:09 ` [PATCH v1 08/21] x86/xen/MSI: " Yijing Wang
@ 2014-09-05 10:09 ` Yijing Wang
  2014-09-05 10:42   ` Sergei Shtylyov
  2014-09-05 10:09 ` [PATCH v1 10/21] x86/MSI: Remove unused MSI weak arch functions Yijing Wang
                   ` (12 subsequent siblings)
  21 siblings, 1 reply; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:09 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Use MSI chip framework instead of arch MSI functions to configure
MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/iommu/irq_remapping.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
index 33c4395..e75026e 100644
--- a/drivers/iommu/irq_remapping.c
+++ b/drivers/iommu/irq_remapping.c
@@ -148,6 +148,11 @@ static int irq_remapping_setup_msi_irqs(struct pci_dev *dev,
 		return do_setup_msix_irqs(dev, nvec);
 }
 
+static struct msi_chip remap_msi_chip = {
+	.setup_irqs = irq_remapping_setup_msi_irqs,
+	.teardown_irq = native_teardown_msi_irq,
+};
+
 static void eoi_ioapic_pin_remapped(int apic, int pin, int vector)
 {
 	/*
@@ -165,9 +170,10 @@ static void __init irq_remapping_modify_x86_ops(void)
 	x86_io_apic_ops.set_affinity	= set_remapped_irq_affinity;
 	x86_io_apic_ops.setup_entry	= setup_ioapic_remapped_entry;
 	x86_io_apic_ops.eoi_ioapic_pin	= eoi_ioapic_pin_remapped;
-	x86_msi.setup_msi_irqs		= irq_remapping_setup_msi_irqs;
+	x86_msi.setup_msi_irqs          = irq_remapping_setup_msi_irqs;
 	x86_msi.setup_hpet_msi		= setup_hpet_msi_remapped;
 	x86_msi.compose_msi_msg		= compose_remapped_msi_msg;
+	x86_msi_chip = &remap_msi_chip;
 }
 
 static __init int setup_nointremap(char *str)
-- 
1.7.1


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

* [PATCH v1 10/21] x86/MSI: Remove unused MSI weak arch functions
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (8 preceding siblings ...)
  2014-09-05 10:09 ` [PATCH v1 09/21] Irq_remapping/MSI: " Yijing Wang
@ 2014-09-05 10:09 ` Yijing Wang
  2014-09-05 10:09 ` [PATCH v1 11/21] MIPS/Octeon/MSI: Use MSI chip framework to configure MSI/MSI-X irq Yijing Wang
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:09 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Now we can clean up MSI weak arch functions in x86.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/x86/include/asm/pci.h      |    3 ---
 arch/x86/include/asm/x86_init.h |    4 ----
 arch/x86/kernel/apic/io_apic.c  |    2 +-
 arch/x86/kernel/x86_init.c      |   24 ------------------------
 drivers/iommu/irq_remapping.c   |    1 -
 5 files changed, 1 insertions(+), 33 deletions(-)

diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 878a06d..34f9676 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -96,14 +96,11 @@ extern void pci_iommu_alloc(void);
 #ifdef CONFIG_PCI_MSI
 /* implemented in arch/x86/kernel/apic/io_apic. */
 struct msi_desc;
-int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
 void native_teardown_msi_irq(unsigned int irq);
-void native_restore_msi_irqs(struct pci_dev *dev);
 int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc,
 		  unsigned int irq_base, unsigned int irq_offset);
 extern struct msi_chip *x86_msi_chip;
 #else
-#define native_setup_msi_irqs		NULL
 #define native_teardown_msi_irq		NULL
 #endif
 
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index f58a9c7..2514f67 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -174,13 +174,9 @@ struct pci_dev;
 struct msi_msg;
 
 struct x86_msi_ops {
-	int (*setup_msi_irqs)(struct pci_dev *dev, int nvec, int type);
 	void (*compose_msi_msg)(struct pci_dev *dev, unsigned int irq,
 				unsigned int dest, struct msi_msg *msg,
 			       u8 hpet_id);
-	void (*teardown_msi_irq)(unsigned int irq);
-	void (*teardown_msi_irqs)(struct pci_dev *dev);
-	void (*restore_msi_irqs)(struct pci_dev *dev);
 	int  (*setup_hpet_msi)(unsigned int irq, unsigned int id);
 };
 
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 882b95e..f998192 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3200,7 +3200,7 @@ int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc,
 	return 0;
 }
 
-int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
+static int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 {
 	struct msi_desc *msidesc;
 	unsigned int irq;
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 234b072..cc32568 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -110,34 +110,10 @@ EXPORT_SYMBOL_GPL(x86_platform);
 
 #if defined(CONFIG_PCI_MSI)
 struct x86_msi_ops x86_msi = {
-	.setup_msi_irqs		= native_setup_msi_irqs,
 	.compose_msi_msg	= native_compose_msi_msg,
-	.teardown_msi_irq	= native_teardown_msi_irq,
-	.teardown_msi_irqs	= default_teardown_msi_irqs,
-	.restore_msi_irqs	= default_restore_msi_irqs,
 	.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)
-{
-	x86_msi.restore_msi_irqs(dev);
-}
 #endif
 
 struct x86_io_apic_ops x86_io_apic_ops = {
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
index e75026e..99b1c0f 100644
--- a/drivers/iommu/irq_remapping.c
+++ b/drivers/iommu/irq_remapping.c
@@ -170,7 +170,6 @@ static void __init irq_remapping_modify_x86_ops(void)
 	x86_io_apic_ops.set_affinity	= set_remapped_irq_affinity;
 	x86_io_apic_ops.setup_entry	= setup_ioapic_remapped_entry;
 	x86_io_apic_ops.eoi_ioapic_pin	= eoi_ioapic_pin_remapped;
-	x86_msi.setup_msi_irqs          = irq_remapping_setup_msi_irqs;
 	x86_msi.setup_hpet_msi		= setup_hpet_msi_remapped;
 	x86_msi.compose_msi_msg		= compose_remapped_msi_msg;
 	x86_msi_chip = &remap_msi_chip;
-- 
1.7.1


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

* [PATCH v1 11/21] MIPS/Octeon/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (9 preceding siblings ...)
  2014-09-05 10:09 ` [PATCH v1 10/21] x86/MSI: Remove unused MSI weak arch functions Yijing Wang
@ 2014-09-05 10:09 ` Yijing Wang
  2014-09-05 10:09 ` [PATCH v1 12/21] MIPS/Xlp: Remove the dead function destroy_irq() to fix build error Yijing Wang
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:09 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Use MSI chip framework instead of arch MSI functions to configure
MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/mips/pci/msi-octeon.c |   35 ++++++++++++++++++++++-------------
 1 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/arch/mips/pci/msi-octeon.c b/arch/mips/pci/msi-octeon.c
index ab0c5d1..0335d75 100644
--- a/arch/mips/pci/msi-octeon.c
+++ b/arch/mips/pci/msi-octeon.c
@@ -57,7 +57,7 @@ static int msi_irq_size;
  *
  * Returns 0 on success.
  */
-int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
+static int octeon_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
 {
 	struct msi_msg msg;
 	u16 control;
@@ -133,12 +133,12 @@ msi_irq_allocated:
 	/* Make sure the search for available interrupts didn't fail */
 	if (irq >= 64) {
 		if (request_private_bits) {
-			pr_err("arch_setup_msi_irq: Unable to find %d free interrupts, trying just one",
+			pr_err("octeon_setup_msi_irq: Unable to find %d free interrupts, trying just one",
 			       1 << request_private_bits);
 			request_private_bits = 0;
 			goto try_only_one;
 		} else
-			panic("arch_setup_msi_irq: Unable to find a free MSI interrupt");
+			panic("octeon_setup_msi_irq: Unable to find a free MSI interrupt");
 	}
 
 	/* MSI interrupts start at logical IRQ OCTEON_IRQ_MSI_BIT0 */
@@ -169,7 +169,7 @@ msi_irq_allocated:
 		msg.address_hi = (0 + CVMX_SLI_PCIE_MSI_RCV) >> 32;
 		break;
 	default:
-		panic("arch_setup_msi_irq: Invalid octeon_dma_bar_type");
+		panic("octeon_setup_msi_irq: Invalid octeon_dma_bar_type");
 	}
 	msg.data = irq - OCTEON_IRQ_MSI_BIT0;
 
@@ -184,7 +184,7 @@ msi_irq_allocated:
 	return 0;
 }
 
-int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
+static int octeon_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 {
 	struct msi_desc *entry;
 	int ret;
@@ -203,7 +203,7 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 		return 1;
 
 	list_for_each_entry(entry, &dev->msi_list, list) {
-		ret = arch_setup_msi_irq(dev, entry);
+		ret = octeon_setup_msi_irq(dev, entry);
 		if (ret < 0)
 			return ret;
 		if (ret > 0)
@@ -212,14 +212,13 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 
 	return 0;
 }
-
 /**
  * Called when a device no longer needs its MSI interrupts. All
  * MSI interrupts for the device are freed.
  *
  * @irq:    The devices first irq number. There may be multple in sequence.
  */
-void arch_teardown_msi_irq(unsigned int irq)
+static void octeon_teardown_msi_irq(unsigned int irq)
 {
 	int number_irqs;
 	u64 bitmask;
@@ -228,8 +227,8 @@ void arch_teardown_msi_irq(unsigned int irq)
 
 	if ((irq < OCTEON_IRQ_MSI_BIT0)
 		|| (irq > msi_irq_size + OCTEON_IRQ_MSI_BIT0))
-		panic("arch_teardown_msi_irq: Attempted to teardown illegal "
-		      "MSI interrupt (%d)", irq);
+		panic("octeon_teardown_msi_irq: Attempted to teardown illegal "
+			"MSI interrupt (%d)", irq);
 
 	irq -= OCTEON_IRQ_MSI_BIT0;
 	index = irq / 64;
@@ -242,7 +241,7 @@ void arch_teardown_msi_irq(unsigned int irq)
 	 */
 	number_irqs = 0;
 	while ((irq0 + number_irqs < 64) &&
-	       (msi_multiple_irq_bitmask[index]
+		(msi_multiple_irq_bitmask[index]
 		& (1ull << (irq0 + number_irqs))))
 		number_irqs++;
 	number_irqs++;
@@ -251,8 +250,8 @@ void arch_teardown_msi_irq(unsigned int irq)
 	/* Shift the mask to the correct bit location */
 	bitmask <<= irq0;
 	if ((msi_free_irq_bitmask[index] & bitmask) != bitmask)
-		panic("arch_teardown_msi_irq: Attempted to teardown MSI "
-		      "interrupt (%d) not in use", irq);
+		panic("octeon_teardown_msi_irq: Attempted to teardown MSI "
+			"interrupt (%d) not in use", irq);
 
 	/* Checks are done, update the in use bitmask */
 	spin_lock(&msi_free_irq_bitmask_lock);
@@ -261,6 +260,16 @@ void arch_teardown_msi_irq(unsigned int irq)
 	spin_unlock(&msi_free_irq_bitmask_lock);
 }
 
+static struct msi_chip octeon_msi_chip = {
+	.setup_irqs = octeon_setup_msi_irqs,
+	.teardown_irq = octeon_teardown_msi_irq,
+};
+
+struct msi_chip *arch_find_msi_chip(struct pci_dev *dev)
+{
+	return &octeon_msi_chip;
+}
+
 static DEFINE_RAW_SPINLOCK(octeon_irq_msi_lock);
 
 static u64 msi_rcv_reg[4];
-- 
1.7.1


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

* [PATCH v1 12/21] MIPS/Xlp: Remove the dead function destroy_irq() to fix build error
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (10 preceding siblings ...)
  2014-09-05 10:09 ` [PATCH v1 11/21] MIPS/Octeon/MSI: Use MSI chip framework to configure MSI/MSI-X irq Yijing Wang
@ 2014-09-05 10:09 ` Yijing Wang
  2014-09-05 10:09 ` [PATCH v1 13/21] MIPS/Xlp/MSI: Use MSI chip framework to configure MSI/MSI-X irq Yijing Wang
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:09 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang, Yijing Wang

Commit 465665f78a7 ("mips: Kill pointless destroy_irq()") removed
the destroy_irq(). So remove the leftover one in xlp_setup_msix()
to fix build error.

arch/mips/pci/msi-xlp.c: In function 'xlp_setup_msix':
arch/mips/pci/msi-xlp.c:447:3: error: implicit declaration of function 'destroy_irq'..
cc1: some warnings being treated as errors
make[1]: *** [arch/mips/pci/msi-xlp.o] Error 1
make: *** [arch/mips/pci/] Error 2

Signed-off-by: Yijing Wang <wangyiijng@huawei.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 arch/mips/pci/msi-xlp.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/arch/mips/pci/msi-xlp.c b/arch/mips/pci/msi-xlp.c
index fa374fe..e469dc7 100644
--- a/arch/mips/pci/msi-xlp.c
+++ b/arch/mips/pci/msi-xlp.c
@@ -443,10 +443,8 @@ static int xlp_setup_msix(uint64_t lnkbase, int node, int link,
 	msg.data = 0xc00 | msixvec;
 
 	ret = irq_set_msi_desc(xirq, desc);
-	if (ret < 0) {
-		destroy_irq(xirq);
+	if (ret < 0)
 		return ret;
-	}
 
 	write_msi_msg(xirq, &msg);
 	return 0;
-- 
1.7.1


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

* [PATCH v1 13/21] MIPS/Xlp/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (11 preceding siblings ...)
  2014-09-05 10:09 ` [PATCH v1 12/21] MIPS/Xlp: Remove the dead function destroy_irq() to fix build error Yijing Wang
@ 2014-09-05 10:09 ` Yijing Wang
  2014-09-05 10:09 ` [PATCH v1 14/21] MIPS/Xlr/MSI: " Yijing Wang
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:09 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Use MSI chip framework instead of arch MSI functions to configure
MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/mips/pci/msi-xlp.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/mips/pci/msi-xlp.c b/arch/mips/pci/msi-xlp.c
index e469dc7..6b791ef 100644
--- a/arch/mips/pci/msi-xlp.c
+++ b/arch/mips/pci/msi-xlp.c
@@ -245,7 +245,7 @@ static struct irq_chip xlp_msix_chip = {
 	.irq_unmask	= unmask_msi_irq,
 };
 
-void arch_teardown_msi_irq(unsigned int irq)
+void xlp_teardown_msi_irq(unsigned int irq)
 {
 }
 
@@ -450,7 +450,7 @@ static int xlp_setup_msix(uint64_t lnkbase, int node, int link,
 	return 0;
 }
 
-int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
+static int xlp_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
 {
 	struct pci_dev *lnkdev;
 	uint64_t lnkbase;
@@ -472,6 +472,16 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
 		return xlp_setup_msi(lnkbase, node, link, desc);
 }
 
+static struct msi_chip xlp_chip = {
+	.setup_irq = xlp_setup_msi_irq,
+	.teardown_irq = xlp_teardown_msi_irq,
+};
+
+struct msi_chip *arch_find_msi_chip(struct pci_dev *dev)
+{
+	return &xlp_chip;
+}
+
 void __init xlp_init_node_msi_irqs(int node, int link)
 {
 	struct nlm_soc_info *nodep;
-- 
1.7.1


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

* [PATCH v1 14/21] MIPS/Xlr/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (12 preceding siblings ...)
  2014-09-05 10:09 ` [PATCH v1 13/21] MIPS/Xlp/MSI: Use MSI chip framework to configure MSI/MSI-X irq Yijing Wang
@ 2014-09-05 10:09 ` Yijing Wang
  2014-09-05 10:10 ` [PATCH v1 15/21] Powerpc/MSI: " Yijing Wang
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:09 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Use MSI chip framework instead of arch MSI functions to configure
MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/mips/pci/pci-xlr.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/mips/pci/pci-xlr.c b/arch/mips/pci/pci-xlr.c
index 0dde803..7bd91cc 100644
--- a/arch/mips/pci/pci-xlr.c
+++ b/arch/mips/pci/pci-xlr.c
@@ -214,11 +214,11 @@ static int get_irq_vector(const struct pci_dev *dev)
 }
 
 #ifdef CONFIG_PCI_MSI
-void arch_teardown_msi_irq(unsigned int irq)
+void xlr_teardown_msi_irq(unsigned int irq)
 {
 }
 
-int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
+int xlr_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
 {
 	struct msi_msg msg;
 	struct pci_dev *lnk;
@@ -263,6 +263,17 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
 	write_msi_msg(irq, &msg);
 	return 0;
 }
+
+static struct msi_chip xlr_msi_chip = {
+	.setup_irq = xlr_setup_msi_irq,
+	.teardown_irq = xlr_teardown_msi_irq,
+};
+
+struct msi_chip *arch_find_msi_chip(struct pci_dev *dev)
+{
+	return &xlr_msi_chip;
+}
+
 #endif
 
 /* Extra ACK needed for XLR on chip PCI controller */
-- 
1.7.1


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

* [PATCH v1 15/21] Powerpc/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (13 preceding siblings ...)
  2014-09-05 10:09 ` [PATCH v1 14/21] MIPS/Xlr/MSI: " Yijing Wang
@ 2014-09-05 10:10 ` Yijing Wang
  2014-09-05 10:47   ` Sergei Shtylyov
  2014-09-16  5:28   ` Michael Ellerman
  2014-09-05 10:10 ` [PATCH v1 16/21] s390/MSI: " Yijing Wang
                   ` (6 subsequent siblings)
  21 siblings, 2 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:10 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Use MSI chip framework instead of arch MSI functions to configure
MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/powerpc/kernel/msi.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c
index 71bd161..01781a4 100644
--- a/arch/powerpc/kernel/msi.c
+++ b/arch/powerpc/kernel/msi.c
@@ -13,7 +13,7 @@
 
 #include <asm/machdep.h>
 
-int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
+static int ppc_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 {
 	if (!ppc_md.setup_msi_irqs || !ppc_md.teardown_msi_irqs) {
 		pr_debug("msi: Platform doesn't provide MSI callbacks.\n");
@@ -27,7 +27,17 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 	return ppc_md.setup_msi_irqs(dev, nvec, type);
 }
 
-void arch_teardown_msi_irqs(struct pci_dev *dev)
+static void ppc_teardown_msi_irqs(struct pci_dev *dev)
 {
 	ppc_md.teardown_msi_irqs(dev);
 }
+
+static struct msi_chip ppc_msi_chip = {
+	.setup_irqs = ppc_setup_msi_irqs,
+	.teardown_irqs = ppc_teardown_msi_irqs,
+};
+
+struct msi_chip *arch_find_msi_chip(struct pci_dev *dev)
+{
+	return &ppc_msi_chip;
+}
-- 
1.7.1


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

* [PATCH v1 16/21] s390/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (14 preceding siblings ...)
  2014-09-05 10:10 ` [PATCH v1 15/21] Powerpc/MSI: " Yijing Wang
@ 2014-09-05 10:10 ` Yijing Wang
  2014-09-16 11:35   ` Sebastian Ott
  2014-09-05 10:10 ` [PATCH v1 17/21] arm/iop13xx/MSI: " Yijing Wang
                   ` (5 subsequent siblings)
  21 siblings, 1 reply; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:10 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Use MSI chip framework instead of arch MSI functions to configure
MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/s390/pci/pci.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index 2fa7b14..da5316e 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -358,7 +358,7 @@ static void zpci_irq_handler(struct airq_struct *airq)
 	}
 }
 
-int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
+int zpci_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
 {
 	struct zpci_dev *zdev = get_zdev(pdev);
 	unsigned int hwirq, msi_vecs;
@@ -434,7 +434,7 @@ out:
 	return rc;
 }
 
-void arch_teardown_msi_irqs(struct pci_dev *pdev)
+static void zpci_teardown_msi_irqs(struct pci_dev *pdev)
 {
 	struct zpci_dev *zdev = get_zdev(pdev);
 	struct msi_desc *msi;
@@ -448,9 +448,9 @@ void arch_teardown_msi_irqs(struct pci_dev *pdev)
 	/* Release MSI interrupts */
 	list_for_each_entry(msi, &pdev->msi_list, list) {
 		if (msi->msi_attrib.is_msix)
-			default_msix_mask_irq(msi, 1);
+			__msix_mask_irq(msi, 1);
 		else
-			default_msi_mask_irq(msi, 1, 1);
+			__msi_mask_irq(msi, 1, 1);
 		irq_set_msi_desc(msi->irq, NULL);
 		irq_free_desc(msi->irq);
 		msi->msg.address_lo = 0;
@@ -464,6 +464,16 @@ void arch_teardown_msi_irqs(struct pci_dev *pdev)
 	airq_iv_free_bit(zpci_aisb_iv, zdev->aisb);
 }
 
+static struct msi_chip zpci_msi_chip = {
+	.setup_irqs = zpci_setup_msi_irqs,
+	.teardown_irqs = zpci_teardown_msi_irqs,
+};
+
+struct msi_chip *arch_find_msi_chip(struct pci_dev *dev)
+{
+	return &zpci_msi_chip;
+}
+
 static void zpci_map_resources(struct zpci_dev *zdev)
 {
 	struct pci_dev *pdev = zdev->pdev;
-- 
1.7.1


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

* [PATCH v1 17/21] arm/iop13xx/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (15 preceding siblings ...)
  2014-09-05 10:10 ` [PATCH v1 16/21] s390/MSI: " Yijing Wang
@ 2014-09-05 10:10 ` Yijing Wang
  2014-09-05 10:10 ` [PATCH v1 18/21] IA64/MSI: " Yijing Wang
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:10 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Use MSI chip framework instead of arch MSI functions to configure
MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/arm/mach-iop13xx/include/mach/pci.h |    2 ++
 arch/arm/mach-iop13xx/iq81340mc.c        |    1 +
 arch/arm/mach-iop13xx/iq81340sc.c        |    1 +
 arch/arm/mach-iop13xx/msi.c              |    9 +++++++--
 arch/arm/mach-iop13xx/pci.c              |    6 ++++++
 5 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-iop13xx/include/mach/pci.h b/arch/arm/mach-iop13xx/include/mach/pci.h
index 59f42b5..7a073cb 100644
--- a/arch/arm/mach-iop13xx/include/mach/pci.h
+++ b/arch/arm/mach-iop13xx/include/mach/pci.h
@@ -10,6 +10,8 @@ struct pci_bus *iop13xx_scan_bus(int nr, struct pci_sys_data *);
 void iop13xx_atu_select(struct hw_pci *plat_pci);
 void iop13xx_pci_init(void);
 void iop13xx_map_pci_memory(void);
+void iop13xx_add_bus(struct pci_bus *bus);
+extern struct msi_chip iop13xx_msi_chip;
 
 #define IOP_PCI_STATUS_ERROR (PCI_STATUS_PARITY |	     \
 			       PCI_STATUS_SIG_TARGET_ABORT | \
diff --git a/arch/arm/mach-iop13xx/iq81340mc.c b/arch/arm/mach-iop13xx/iq81340mc.c
index 9cd07d3..19d47cb 100644
--- a/arch/arm/mach-iop13xx/iq81340mc.c
+++ b/arch/arm/mach-iop13xx/iq81340mc.c
@@ -59,6 +59,7 @@ static struct hw_pci iq81340mc_pci __initdata = {
 	.map_irq	= iq81340mc_pcix_map_irq,
 	.scan		= iop13xx_scan_bus,
 	.preinit	= iop13xx_pci_init,
+	.add_bus	= iop13xx_add_bus;
 };
 
 static int __init iq81340mc_pci_init(void)
diff --git a/arch/arm/mach-iop13xx/iq81340sc.c b/arch/arm/mach-iop13xx/iq81340sc.c
index b3ec11c..4d56993 100644
--- a/arch/arm/mach-iop13xx/iq81340sc.c
+++ b/arch/arm/mach-iop13xx/iq81340sc.c
@@ -61,6 +61,7 @@ static struct hw_pci iq81340sc_pci __initdata = {
 	.scan		= iop13xx_scan_bus,
 	.map_irq	= iq81340sc_atux_map_irq,
 	.preinit	= iop13xx_pci_init
+	.add_bus	= iop13xx_add_bus;
 };
 
 static int __init iq81340sc_pci_init(void)
diff --git a/arch/arm/mach-iop13xx/msi.c b/arch/arm/mach-iop13xx/msi.c
index e7730cf..1a8cb2f 100644
--- a/arch/arm/mach-iop13xx/msi.c
+++ b/arch/arm/mach-iop13xx/msi.c
@@ -132,7 +132,7 @@ static struct irq_chip iop13xx_msi_chip = {
 	.irq_unmask = unmask_msi_irq,
 };
 
-int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
+static int iop13xx_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
 {
 	int id, irq = irq_alloc_desc_from(IRQ_IOP13XX_MSI_0, -1);
 	struct msi_msg msg;
@@ -159,7 +159,12 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
 	return 0;
 }
 
-void arch_teardown_msi_irq(unsigned int irq)
+static void iop13xx_teardown_msi_irq(unsigned int irq)
 {
 	irq_free_desc(irq);
 }
+
+struct msi_chip iop13xx_chip = {
+	.setup_irq = iop13xx_setup_msi_irq,
+	.teardown_irq = iop13xx_teardown_msi_irq,
+};
diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c
index 9082b84..f498800 100644
--- a/arch/arm/mach-iop13xx/pci.c
+++ b/arch/arm/mach-iop13xx/pci.c
@@ -962,6 +962,12 @@ void __init iop13xx_atu_select(struct hw_pci *plat_pci)
 	}
 }
 
+void iop13xx_add_bus(struct pci_bus *bus)
+{
+	if (IS_ENABLED(CONFIG_PCI_MSI))
+		bus->msi = &iop13xx_msi_chip;
+}
+
 void __init iop13xx_pci_init(void)
 {
 	/* clear pre-existing south bridge errors */
-- 
1.7.1


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

* [PATCH v1 18/21] IA64/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (16 preceding siblings ...)
  2014-09-05 10:10 ` [PATCH v1 17/21] arm/iop13xx/MSI: " Yijing Wang
@ 2014-09-05 10:10 ` Yijing Wang
  2014-09-05 10:10 ` [PATCH v1 19/21] Sparc/MSI: " Yijing Wang
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:10 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Use MSI chip framework instead of arch MSI functions to configure
MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/ia64/kernel/msi_ia64.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/arch/ia64/kernel/msi_ia64.c b/arch/ia64/kernel/msi_ia64.c
index 4efe748..55ac859 100644
--- a/arch/ia64/kernel/msi_ia64.c
+++ b/arch/ia64/kernel/msi_ia64.c
@@ -112,15 +112,15 @@ static struct irq_chip ia64_msi_chip = {
 };
 
 
-int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
+static int arch_ia64_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
 {
 	if (platform_setup_msi_irq)
-		return platform_setup_msi_irq(pdev, desc);
+		return platform_setup_msi_irq(dev, desc);
 
-	return ia64_setup_msi_irq(pdev, desc);
+	return ia64_setup_msi_irq(dev, desc);
 }
 
-void arch_teardown_msi_irq(unsigned int irq)
+static void arch_ia64_teardown_msi_irq(unsigned int irq)
 {
 	if (platform_teardown_msi_irq)
 		return platform_teardown_msi_irq(irq);
@@ -128,6 +128,16 @@ void arch_teardown_msi_irq(unsigned int irq)
 	return ia64_teardown_msi_irq(irq);
 }
 
+static struct msi_chip chip = {
+	.setup_irq = arch_ia64_setup_msi_irq,
+	.teardown_irq = arch_ia64_teardown_msi_irq,
+};
+
+struct msi_chip *arch_find_msi_chip(struct pci_dev *dev)
+{
+	return &chip;
+}
+
 #ifdef CONFIG_INTEL_IOMMU
 #ifdef CONFIG_SMP
 static int dmar_msi_set_affinity(struct irq_data *data,
-- 
1.7.1


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

* [PATCH v1 19/21] Sparc/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (17 preceding siblings ...)
  2014-09-05 10:10 ` [PATCH v1 18/21] IA64/MSI: " Yijing Wang
@ 2014-09-05 10:10 ` Yijing Wang
  2014-09-05 10:10 ` [PATCH v1 20/21] tile/MSI: " Yijing Wang
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:10 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Use MSI chip framework instead of arch MSI functions to configure
MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/sparc/kernel/pci.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index b36365f..2a89ee2 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -905,7 +905,7 @@ int pci_domain_nr(struct pci_bus *pbus)
 EXPORT_SYMBOL(pci_domain_nr);
 
 #ifdef CONFIG_PCI_MSI
-int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
+int sparc_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
 {
 	struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller;
 	unsigned int irq;
@@ -916,7 +916,7 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
 	return pbm->setup_msi_irq(&irq, pdev, desc);
 }
 
-void arch_teardown_msi_irq(unsigned int irq)
+void sparc_teardown_msi_irq(unsigned int irq)
 {
 	struct msi_desc *entry = irq_get_msi_desc(irq);
 	struct pci_dev *pdev = entry->dev;
@@ -925,6 +925,16 @@ void arch_teardown_msi_irq(unsigned int irq)
 	if (pbm->teardown_msi_irq)
 		pbm->teardown_msi_irq(irq, pdev);
 }
+
+static struct msi_chip sparc_msi_chip = {
+	.setup_irq = sparc_setup_msi_irq,
+	.teardown_irq = sparc_teardown_msi_irq,
+};
+
+struct msi_chip *arch_find_msi_chip(struct pci_dev *dev)
+{
+	return &sparc_msi_chip;
+}
 #endif /* !(CONFIG_PCI_MSI) */
 
 static void ali_sound_dma_hack(struct pci_dev *pdev, int set_bit)
-- 
1.7.1


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

* [PATCH v1 20/21] tile/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (18 preceding siblings ...)
  2014-09-05 10:10 ` [PATCH v1 19/21] Sparc/MSI: " Yijing Wang
@ 2014-09-05 10:10 ` Yijing Wang
  2014-09-05 10:10 ` [PATCH v1 21/21] PCI/MSI: Clean up unused MSI arch functions Yijing Wang
  2014-09-23 21:09 ` [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Bjorn Helgaas
  21 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:10 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Use MSI chip framework instead of arch MSI functions to configure
MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/tile/kernel/pci_gx.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c
index e39f9c5..4912b75 100644
--- a/arch/tile/kernel/pci_gx.c
+++ b/arch/tile/kernel/pci_gx.c
@@ -1485,7 +1485,7 @@ static struct irq_chip tilegx_msi_chip = {
 	/* TBD: support set_affinity. */
 };
 
-int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
+static int tile_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
 {
 	struct pci_controller *controller;
 	gxio_trio_context_t *trio_context;
@@ -1604,7 +1604,17 @@ is_64_failure:
 	return ret;
 }
 
-void arch_teardown_msi_irq(unsigned int irq)
+void tile_teardown_msi_irq(unsigned int irq)
 {
 	irq_free_hwirq(irq);
 }
+
+static struct msi_chip tile_msi_chip = {
+	.setup_irq = tile_setup_msi_irq,
+	.teardown_irq = tile_teardown_msi_irq,
+};
+
+struct msi_chip *arch_find_msi_chip(struct pci_dev *dev)
+{
+	return &tile_msi_chip;
+}
-- 
1.7.1


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

* [PATCH v1 21/21] PCI/MSI: Clean up unused MSI arch functions
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (19 preceding siblings ...)
  2014-09-05 10:10 ` [PATCH v1 20/21] tile/MSI: " Yijing Wang
@ 2014-09-05 10:10 ` Yijing Wang
  2014-09-15 14:47   ` Lucas Stach
  2014-09-23 21:09 ` [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Bjorn Helgaas
  21 siblings, 1 reply; 52+ messages in thread
From: Yijing Wang @ 2014-09-05 10:10 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle,
	Yijing Wang

Now we use struct msi_chip in all platforms to configure
MSI/MSI-X. We can clean up the unused arch functions.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/iommu/irq_remapping.c |    2 +-
 drivers/pci/msi.c             |   99 ++++++++++++++++-------------------------
 include/linux/msi.h           |   14 ------
 3 files changed, 39 insertions(+), 76 deletions(-)

diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
index 99b1c0f..6e645f0 100644
--- a/drivers/iommu/irq_remapping.c
+++ b/drivers/iommu/irq_remapping.c
@@ -92,7 +92,7 @@ error:
 
 	/*
 	 * Restore altered MSI descriptor fields and prevent just destroyed
-	 * IRQs from tearing down again in default_teardown_msi_irqs()
+	 * IRQs from tearing down again in teardown_msi_irqs()
 	 */
 	msidesc->irq = 0;
 	msidesc->nvec_used = 0;
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index d78d637..e3e7f4f 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -34,50 +34,31 @@ struct msi_chip * __weak arch_find_msi_chip(struct pci_dev *dev)
 	return dev->bus->msi;
 }
 
-int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
-{
-	struct msi_chip *chip = arch_find_msi_chip(dev);
-	int err;
-
-	if (!chip || !chip->setup_irq)
-		return -EINVAL;
-
-	err = chip->setup_irq(dev, desc);
-	if (err < 0)
-		return err;
-
-	return 0;
-}
-
-void __weak arch_teardown_msi_irq(unsigned int irq)
-{
-	struct msi_chip *chip = irq_get_chip_data(irq);
-
-	if (!chip || !chip->teardown_irq)
-		return;
-
-	chip->teardown_irq(irq);
-}
-
-int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
+int setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 {
 	struct msi_desc *entry;
 	int ret;
 	struct msi_chip *chip;
 
 	chip = arch_find_msi_chip(dev);
-	if (chip && chip->setup_irqs)
+	if (!chip)
+		return -EINVAL;
+
+	if (chip->setup_irqs)
 		return chip->setup_irqs(dev, nvec, type);
 
 	/*
 	 * If an architecture wants to support multiple MSI, it needs to
-	 * override arch_setup_msi_irqs()
+	 * implement chip->setup_irqs().
 	 */
 	if (type == PCI_CAP_ID_MSI && nvec > 1)
 		return 1;
 
+	if (!chip->setup_irq)
+		return -EINVAL;
+
 	list_for_each_entry(entry, &dev->msi_list, list) {
-		ret = arch_setup_msi_irq(dev, entry);
+		ret = chip->setup_irq(dev, entry);
 		if (ret < 0)
 			return ret;
 		if (ret > 0)
@@ -87,13 +68,20 @@ int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 	return 0;
 }
 
-/*
- * 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)
+static void teardown_msi_irqs(struct pci_dev *dev)
 {
 	struct msi_desc *entry;
+	struct msi_chip *chip;
+
+	chip = arch_find_msi_chip(dev);
+	if (!chip)
+		return;
+
+	if (chip->teardown_irqs)
+		return chip->teardown_irqs(dev);
+
+	if (!chip->teardown_irq)
+		return;
 
 	list_for_each_entry(entry, &dev->msi_list, list) {
 		int i, nvec;
@@ -104,20 +92,10 @@ void default_teardown_msi_irqs(struct pci_dev *dev)
 		else
 			nvec = 1 << entry->msi_attrib.multiple;
 		for (i = 0; i < nvec; i++)
-			arch_teardown_msi_irq(entry->irq + i);
+			chip->teardown_irq(entry->irq + i);
 	}
 }
 
-void __weak arch_teardown_msi_irqs(struct pci_dev *dev)
-{
-	struct msi_chip *chip = arch_find_msi_chip(dev);
-
-	if (chip && chip->teardown_irqs)
-		return chip->teardown_irqs(dev);
-
-	return default_teardown_msi_irqs(dev);
-}
-
 static void default_restore_msi_irq(struct pci_dev *dev, int irq)
 {
 	struct msi_desc *entry;
@@ -136,10 +114,18 @@ static void default_restore_msi_irq(struct pci_dev *dev, int irq)
 		write_msi_msg(irq, &entry->msg);
 }
 
-void __weak arch_restore_msi_irqs(struct pci_dev *dev)
+static void default_restore_msi_irqs(struct pci_dev *dev)
 {
-	struct msi_chip *chip = arch_find_msi_chip(dev);
+	struct msi_desc *entry = NULL;
+
+	list_for_each_entry(entry, &dev->msi_list, list) {
+		default_restore_msi_irq(dev, entry->irq);
+	}
+}
 
+static void restore_msi_irqs(struct pci_dev *dev)
+{
+	struct msi_chip *chip = arch_find_msi_chip(dev);
 	if (chip && chip->restore_irqs)
 		return chip->restore_irqs(dev);
 
@@ -248,15 +234,6 @@ void unmask_msi_irq(struct irq_data *data)
 	msi_set_mask_bit(data, 0);
 }
 
-void default_restore_msi_irqs(struct pci_dev *dev)
-{
-	struct msi_desc *entry;
-
-	list_for_each_entry(entry, &dev->msi_list, list) {
-		default_restore_msi_irq(dev, entry->irq);
-	}
-}
-
 void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
 	BUG_ON(entry->dev->current_state != PCI_D0);
@@ -360,7 +337,7 @@ static void free_msi_irqs(struct pci_dev *dev)
 			BUG_ON(irq_has_action(entry->irq + i));
 	}
 
-	arch_teardown_msi_irqs(dev);
+	teardown_msi_irqs(dev);
 
 	list_for_each_entry_safe(entry, tmp, &dev->msi_list, list) {
 		if (entry->msi_attrib.is_msix) {
@@ -430,7 +407,7 @@ static void __pci_restore_msi_state(struct pci_dev *dev)
 
 	pci_intx_for_msi(dev, 0);
 	msi_set_enable(dev, 0);
-	arch_restore_msi_irqs(dev);
+	restore_msi_irqs(dev);
 
 	pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control);
 	msi_mask_irq(entry, msi_mask(entry->msi_attrib.multi_cap),
@@ -453,7 +430,7 @@ static void __pci_restore_msix_state(struct pci_dev *dev)
 	msix_clear_and_set_ctrl(dev, 0,
 				PCI_MSIX_FLAGS_ENABLE | PCI_MSIX_FLAGS_MASKALL);
 
-	arch_restore_msi_irqs(dev);
+	restore_msi_irqs(dev);
 	list_for_each_entry(entry, &dev->msi_list, list) {
 		msix_mask_irq(entry, entry->masked);
 	}
@@ -624,7 +601,7 @@ static int msi_capability_init(struct pci_dev *dev, int nvec)
 	list_add_tail(&entry->list, &dev->msi_list);
 
 	/* Configure MSI capability structure */
-	ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSI);
+	ret = setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSI);
 	if (ret) {
 		msi_mask_irq(entry, mask, ~mask);
 		free_msi_irqs(dev);
@@ -740,7 +717,7 @@ static int msix_capability_init(struct pci_dev *dev,
 	if (ret)
 		return ret;
 
-	ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX);
+	ret = setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX);
 	if (ret)
 		goto out_avail;
 
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 92a51e7..d6e1f7c 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -51,20 +51,6 @@ struct msi_desc {
 	struct kobject kobj;
 };
 
-/*
- * 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);
-void arch_restore_msi_irqs(struct pci_dev *dev);
-
-void default_teardown_msi_irqs(struct pci_dev *dev);
-void default_restore_msi_irqs(struct pci_dev *dev);
-
 struct msi_chip {
 	struct module *owner;
 	struct device *dev;
-- 
1.7.1


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

* Re: [PATCH v1 09/21] Irq_remapping/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:09 ` [PATCH v1 09/21] Irq_remapping/MSI: " Yijing Wang
@ 2014-09-05 10:42   ` Sergei Shtylyov
  2014-09-05 11:30     ` wangyijing
  0 siblings, 1 reply; 52+ messages in thread
From: Sergei Shtylyov @ 2014-09-05 10:42 UTC (permalink / raw)
  To: Yijing Wang, Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle

Hello.

On 9/5/2014 2:09 PM, Yijing Wang wrote:

> Use MSI chip framework instead of arch MSI functions to configure
> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.

> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> ---
>   drivers/iommu/irq_remapping.c |    8 +++++++-
>   1 files changed, 7 insertions(+), 1 deletions(-)

> diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
> index 33c4395..e75026e 100644
> --- a/drivers/iommu/irq_remapping.c
> +++ b/drivers/iommu/irq_remapping.c
[...]
> @@ -165,9 +170,10 @@ static void __init irq_remapping_modify_x86_ops(void)
>   	x86_io_apic_ops.set_affinity	= set_remapped_irq_affinity;
>   	x86_io_apic_ops.setup_entry	= setup_ioapic_remapped_entry;
>   	x86_io_apic_ops.eoi_ioapic_pin	= eoi_ioapic_pin_remapped;
> -	x86_msi.setup_msi_irqs		= irq_remapping_setup_msi_irqs;
> +	x86_msi.setup_msi_irqs          = irq_remapping_setup_msi_irqs;

    AFAICS, this change only converts tabs to spaces, so not needed at all.

>   	x86_msi.setup_hpet_msi		= setup_hpet_msi_remapped;
>   	x86_msi.compose_msi_msg		= compose_remapped_msi_msg;
> +	x86_msi_chip = &remap_msi_chip;

    Please align = with the rest of assignments.

WBR, Sergei


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

* Re: [PATCH v1 15/21] Powerpc/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:10 ` [PATCH v1 15/21] Powerpc/MSI: " Yijing Wang
@ 2014-09-05 10:47   ` Sergei Shtylyov
  2014-09-05 11:33     ` wangyijing
  2014-09-16  5:28   ` Michael Ellerman
  1 sibling, 1 reply; 52+ messages in thread
From: Sergei Shtylyov @ 2014-09-05 10:47 UTC (permalink / raw)
  To: Yijing Wang, Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle

Hello.

On 9/5/2014 2:10 PM, Yijing Wang wrote:

> Use MSI chip framework instead of arch MSI functions to configure
> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.

> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> ---
>   arch/powerpc/kernel/msi.c |   14 ++++++++++++--
>   1 files changed, 12 insertions(+), 2 deletions(-)

> diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c
> index 71bd161..01781a4 100644
> --- a/arch/powerpc/kernel/msi.c
> +++ b/arch/powerpc/kernel/msi.c
[...]
> @@ -27,7 +27,17 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>   	return ppc_md.setup_msi_irqs(dev, nvec, type);
>   }
>
> -void arch_teardown_msi_irqs(struct pci_dev *dev)
> +static void ppc_teardown_msi_irqs(struct pci_dev *dev)

    Shouldn't this function take IRQ # instead?

>   {
>   	ppc_md.teardown_msi_irqs(dev);
>   }
> +
> +static struct msi_chip ppc_msi_chip = {
> +	.setup_irqs = ppc_setup_msi_irqs,
> +	.teardown_irqs = ppc_teardown_msi_irqs,
> +};
> +
> +struct msi_chip *arch_find_msi_chip(struct pci_dev *dev)
> +{
> +	return &ppc_msi_chip;
> +}

WBR, Sergei


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

* Re: [PATCH v1 09/21] Irq_remapping/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:42   ` Sergei Shtylyov
@ 2014-09-05 11:30     ` wangyijing
  0 siblings, 0 replies; 52+ messages in thread
From: wangyijing @ 2014-09-05 11:30 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Yijing Wang, Bjorn Helgaas, Xinwei Hu, Wuyun, linux-pci,
	linux-arm-kernel, Russell King, linux-arch, arnab.basu,
	Bharat.Bhushan, x86, Arnd Bergmann, Thomas Gleixner,
	Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel, iommu,
	linux-mips, Benjamin Herrenschmidt, linuxppc-dev, linux-s390,
	Sebastian Ott, Tony Luck, linux-ia64, David S. Miller,
	sparclinux, Chris Metcalf, Ralf Baechle


> 在 2014年9月5日,18:42,Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> 写道:
> 
> Hello.
> 
>> On 9/5/2014 2:09 PM, Yijing Wang wrote:
>> 
>> Use MSI chip framework instead of arch MSI functions to configure
>> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.
> 
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
>> ---
>>  drivers/iommu/irq_remapping.c |    8 +++++++-
>>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
>> diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
>> index 33c4395..e75026e 100644
>> --- a/drivers/iommu/irq_remapping.c
>> +++ b/drivers/iommu/irq_remapping.c
> [...]
>> @@ -165,9 +170,10 @@ static void __init irq_remapping_modify_x86_ops(void)
>>      x86_io_apic_ops.set_affinity    = set_remapped_irq_affinity;
>>      x86_io_apic_ops.setup_entry    = setup_ioapic_remapped_entry;
>>      x86_io_apic_ops.eoi_ioapic_pin    = eoi_ioapic_pin_remapped;
>> -    x86_msi.setup_msi_irqs        = irq_remapping_setup_msi_irqs;
>> +    x86_msi.setup_msi_irqs          = irq_remapping_setup_msi_irqs;
> 
>   AFAICS, this change only converts tabs to spaces, so not needed at all.

Will update,  thanks.

> 
>>      x86_msi.setup_hpet_msi        = setup_hpet_msi_remapped;
>>      x86_msi.compose_msi_msg        = compose_remapped_msi_msg;
>> +    x86_msi_chip = &remap_msi_chip;
> 
>   Please align = with the rest of assignments.

Ok.

Thanks!
Yijing.

> 
> WBR, Sergei
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v1 15/21] Powerpc/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:47   ` Sergei Shtylyov
@ 2014-09-05 11:33     ` wangyijing
  2014-09-05 11:41       ` Sergei Shtylyov
  0 siblings, 1 reply; 52+ messages in thread
From: wangyijing @ 2014-09-05 11:33 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Yijing Wang, Bjorn Helgaas, Xinwei Hu, Wuyun, linux-pci,
	linux-arm-kernel, Russell King, linux-arch, arnab.basu,
	Bharat.Bhushan, x86, Arnd Bergmann, Thomas Gleixner,
	Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel, iommu,
	linux-mips, Benjamin Herrenschmidt, linuxppc-dev, linux-s390,
	Sebastian Ott, Tony Luck, linux-ia64, David S. Miller,
	sparclinux, Chris Metcalf, Ralf Baechle



> 在 2014年9月5日,18:47,Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> 写道:
> 
> Hello.
> 
>> On 9/5/2014 2:10 PM, Yijing Wang wrote:
>> 
>> Use MSI chip framework instead of arch MSI functions to configure
>> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.
> 
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
>> ---
>>  arch/powerpc/kernel/msi.c |   14 ++++++++++++--
>>  1 files changed, 12 insertions(+), 2 deletions(-)
> 
>> diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c
>> index 71bd161..01781a4 100644
>> --- a/arch/powerpc/kernel/msi.c
>> +++ b/arch/powerpc/kernel/msi.c
> [...]
>> @@ -27,7 +27,17 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>>      return ppc_md.setup_msi_irqs(dev, nvec, type);
>>  }
>> 
>> -void arch_teardown_msi_irqs(struct pci_dev *dev)
>> +static void ppc_teardown_msi_irqs(struct pci_dev *dev)
> 
>   Shouldn't this function take IRQ # instead?

This function need to teardown all msi irqs of the pci dev, we should pass the pci dev as argument .

Thanks!
Yijing.

> 
>>  {
>>      ppc_md.teardown_msi_irqs(dev);
>>  }
>> +
>> +static struct msi_chip ppc_msi_chip = {
>> +    .setup_irqs = ppc_setup_msi_irqs,
>> +    .teardown_irqs = ppc_teardown_msi_irqs,
>> +};
>> +
>> +struct msi_chip *arch_find_msi_chip(struct pci_dev *dev)
>> +{
>> +    return &ppc_msi_chip;
>> +}
> 
> WBR, Sergei
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v1 15/21] Powerpc/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 11:33     ` wangyijing
@ 2014-09-05 11:41       ` Sergei Shtylyov
  0 siblings, 0 replies; 52+ messages in thread
From: Sergei Shtylyov @ 2014-09-05 11:41 UTC (permalink / raw)
  To: wangyijing
  Cc: Yijing Wang, Bjorn Helgaas, Xinwei Hu, Wuyun, linux-pci,
	linux-arm-kernel, Russell King, linux-arch, arnab.basu,
	Bharat.Bhushan, x86, Arnd Bergmann, Thomas Gleixner,
	Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel, iommu,
	linux-mips, Benjamin Herrenschmidt, linuxppc-dev, linux-s390,
	Sebastian Ott, Tony Luck, linux-ia64, David S. Miller,
	sparclinux, Chris Metcalf, Ralf Baechle

On 9/5/2014 3:33 PM, wangyijing wrote:

>>> Use MSI chip framework instead of arch MSI functions to configure
>>> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.

>>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
>>> ---
>>>   arch/powerpc/kernel/msi.c |   14 ++++++++++++--
>>>   1 files changed, 12 insertions(+), 2 deletions(-)

>>> diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c
>>> index 71bd161..01781a4 100644
>>> --- a/arch/powerpc/kernel/msi.c
>>> +++ b/arch/powerpc/kernel/msi.c
>> [...]
>>> @@ -27,7 +27,17 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>>>       return ppc_md.setup_msi_irqs(dev, nvec, type);
>>>   }
>>>
>>> -void arch_teardown_msi_irqs(struct pci_dev *dev)
>>> +static void ppc_teardown_msi_irqs(struct pci_dev *dev)

>>    Shouldn't this function take IRQ # instead?

> This function need to teardown all msi irqs of the pci dev, we should pass the pci dev as argument .

    Ah, I've mixed up the teardown_irqs() method with teardown_irq()! Too 
similar. :-)

> Thanks!
> Yijing.

WBR, Sergei


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

* Re: [Xen-devel] [PATCH v1 08/21] x86/xen/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:09 ` [PATCH v1 08/21] x86/xen/MSI: " Yijing Wang
@ 2014-09-05 14:29   ` David Vrabel
  2014-09-09  2:06     ` Yijing Wang
  0 siblings, 1 reply; 52+ messages in thread
From: David Vrabel @ 2014-09-05 14:29 UTC (permalink / raw)
  To: Yijing Wang, Bjorn Helgaas
  Cc: linux-mips, linux-ia64, linux-pci, Bharat.Bhushan, sparclinux,
	linux-arch, linux-s390, Russell King, Joerg Roedel, x86,
	Sebastian Ott, Benjamin Herrenschmidt, xen-devel, arnab.basu,
	Arnd Bergmann, Chris Metcalf, Thomas Gleixner, linux-arm-kernel,
	Xinwei Hu, Tony Luck, Ralf Baechle, iommu, Wuyun, linuxppc-dev,
	David S. Miller

On 05/09/14 11:09, Yijing Wang wrote:
> Use MSI chip framework instead of arch MSI functions to configure
> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.
[...]
> --- a/arch/x86/pci/xen.c
> +++ b/arch/x86/pci/xen.c
[...]
> @@ -418,9 +430,9 @@ int __init pci_xen_init(void)
>  #endif
>  
>  #ifdef CONFIG_PCI_MSI
> -	x86_msi.setup_msi_irqs = xen_setup_msi_irqs;
> -	x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
> -	x86_msi.teardown_msi_irqs = xen_teardown_msi_irqs;
> +	xen_msi_chip.setup_irqs = xen_setup_msi_irqs;
> +	xen_msi_chip.teardown_irqs = xen_teardown_msi_irqs;
> +	x86_msi_chip = &xen_msi_chip;
>  	msi_chip.irq_mask = xen_nop_msi_mask;
>  	msi_chip.irq_unmask = xen_nop_msi_mask;

Why have these not been changed to set the x86_msi_chip.mask/unmask
fields instead?

David

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

* Re: [Xen-devel] [PATCH v1 08/21] x86/xen/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 14:29   ` [Xen-devel] " David Vrabel
@ 2014-09-09  2:06     ` Yijing Wang
  2014-09-10 12:38       ` David Vrabel
  0 siblings, 1 reply; 52+ messages in thread
From: Yijing Wang @ 2014-09-09  2:06 UTC (permalink / raw)
  To: David Vrabel, Bjorn Helgaas
  Cc: linux-mips, linux-ia64, linux-pci, Bharat.Bhushan, sparclinux,
	linux-arch, linux-s390, Russell King, Joerg Roedel, x86,
	Sebastian Ott, Benjamin Herrenschmidt, xen-devel, arnab.basu,
	Arnd Bergmann, Chris Metcalf, Thomas Gleixner, linux-arm-kernel,
	Xinwei Hu, Tony Luck, Ralf Baechle, iommu, Wuyun, linuxppc-dev,
	David S. Miller

On 2014/9/5 22:29, David Vrabel wrote:
> On 05/09/14 11:09, Yijing Wang wrote:
>> Use MSI chip framework instead of arch MSI functions to configure
>> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.
> [...]
>> --- a/arch/x86/pci/xen.c
>> +++ b/arch/x86/pci/xen.c
> [...]
>> @@ -418,9 +430,9 @@ int __init pci_xen_init(void)
>>  #endif
>>  
>>  #ifdef CONFIG_PCI_MSI
>> -	x86_msi.setup_msi_irqs = xen_setup_msi_irqs;
>> -	x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
>> -	x86_msi.teardown_msi_irqs = xen_teardown_msi_irqs;
>> +	xen_msi_chip.setup_irqs = xen_setup_msi_irqs;
>> +	xen_msi_chip.teardown_irqs = xen_teardown_msi_irqs;
>> +	x86_msi_chip = &xen_msi_chip;
>>  	msi_chip.irq_mask = xen_nop_msi_mask;
>>  	msi_chip.irq_unmask = xen_nop_msi_mask;
> 
> Why have these not been changed to set the x86_msi_chip.mask/unmask
> fields instead?

Hi David, x86_msi_chip here is struct msi_chip data type, used to configure MSI/MSI-X
irq. msi_chip above is struct irq_chip data type, represent the MSI irq controller. They are
not the same object. Their name easily confusing people.

Defined in arch/x86/kernel/apic/io_apic.c
/*
 * IRQ Chip for MSI PCI/PCI-X/PCI-Express Devices,
 * which implement the MSI or MSI-X Capability Structure.
 */
static struct irq_chip msi_chip = {
	.name			= "PCI-MSI",
	.irq_unmask		= unmask_msi_irq,
	.irq_mask		= mask_msi_irq,
	.irq_ack		= ack_apic_edge,
	.irq_set_affinity	= msi_set_affinity,
	.irq_retrigger		= ioapic_retrigger_irq,
};


Defined in arch/x86/kernel/apic/io_apic.c, introduced in patch 7/21
struct msi_chip apic_msi_chip = {
	.setup_irqs = native_setup_msi_irqs,
	.teardown_irq = native_teardown_msi_irq,
};
[...]
struct msi_chip *x86_msi_chip = &apic_msi_chip;


Thanks!
Yijing.

> 
> David
> 
> .
> 


-- 
Thanks!
Yijing


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

* Re: [Xen-devel] [PATCH v1 04/21] x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq()
  2014-09-05 10:09 ` [PATCH v1 04/21] x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq() Yijing Wang
@ 2014-09-10 12:36   ` David Vrabel
  2014-09-11  1:22     ` Yijing Wang
  0 siblings, 1 reply; 52+ messages in thread
From: David Vrabel @ 2014-09-10 12:36 UTC (permalink / raw)
  To: Yijing Wang, Bjorn Helgaas
  Cc: linux-mips, linux-ia64, linux-pci, Bharat.Bhushan, sparclinux,
	linux-arch, linux-s390, Russell King, Joerg Roedel, x86,
	Sebastian Ott, Benjamin Herrenschmidt, xen-devel, arnab.basu,
	Arnd Bergmann, Chris Metcalf, Thomas Gleixner, linux-arm-kernel,
	Xinwei Hu, Tony Luck, Ralf Baechle, iommu, Wuyun, linuxppc-dev,
	David S. Miller

On 05/09/14 11:09, Yijing Wang wrote:
> Commit 0e4ccb150 added two __weak arch functions arch_msix_mask_irq()
> and arch_msi_mask_irq() to fix a bug found when running xen in x86.
> Introduced these two funcntions make MSI code complex. And mask/unmask
> is the irq actions related to interrupt controller, should not use
> weak arch functions to override mask/unmask interfaces. This patch
> reverted commit 0e4ccb150 and export struct irq_chip msi_chip, modify
> msi_chip->irq_mask/irq_unmask() in xen init functions to fix this
> bug for simplicity. Also this is preparation for using struct
> msi_chip instead of weak arch MSI functions in all platforms.

Acked-by: David Vrabel <david.vrabel@citrix.com>

But I wonder if it would be better the Xen subsystem to provide its own
struct irq_chip instead of adjusting the fields in the generic x86 one.

David

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

* Re: [Xen-devel] [PATCH v1 08/21] x86/xen/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-09  2:06     ` Yijing Wang
@ 2014-09-10 12:38       ` David Vrabel
  2014-09-10 14:59         ` Konrad Rzeszutek Wilk
  2014-09-11  1:27         ` Yijing Wang
  0 siblings, 2 replies; 52+ messages in thread
From: David Vrabel @ 2014-09-10 12:38 UTC (permalink / raw)
  To: Yijing Wang, David Vrabel, Bjorn Helgaas
  Cc: linux-mips, linux-ia64, linux-pci, Xinwei Hu, sparclinux,
	linux-arch, linux-s390, Russell King, Joerg Roedel, x86,
	Sebastian Ott, Benjamin Herrenschmidt, xen-devel, arnab.basu,
	Arnd Bergmann, Chris Metcalf, Thomas Gleixner, linux-arm-kernel,
	Bharat.Bhushan, Tony Luck, Ralf Baechle, iommu, Wuyun,
	linuxppc-dev, David S. Miller

On 09/09/14 03:06, Yijing Wang wrote:
> On 2014/9/5 22:29, David Vrabel wrote:
>> On 05/09/14 11:09, Yijing Wang wrote:
>>> Use MSI chip framework instead of arch MSI functions to configure
>>> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.
>> [...]
>>> --- a/arch/x86/pci/xen.c
>>> +++ b/arch/x86/pci/xen.c
>> [...]
>>> @@ -418,9 +430,9 @@ int __init pci_xen_init(void)
>>>  #endif
>>>  
>>>  #ifdef CONFIG_PCI_MSI
>>> -	x86_msi.setup_msi_irqs = xen_setup_msi_irqs;
>>> -	x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
>>> -	x86_msi.teardown_msi_irqs = xen_teardown_msi_irqs;
>>> +	xen_msi_chip.setup_irqs = xen_setup_msi_irqs;
>>> +	xen_msi_chip.teardown_irqs = xen_teardown_msi_irqs;
>>> +	x86_msi_chip = &xen_msi_chip;
>>>  	msi_chip.irq_mask = xen_nop_msi_mask;
>>>  	msi_chip.irq_unmask = xen_nop_msi_mask;
>>
>> Why have these not been changed to set the x86_msi_chip.mask/unmask
>> fields instead?
> 
> Hi David, x86_msi_chip here is struct msi_chip data type, used to configure MSI/MSI-X
> irq. msi_chip above is struct irq_chip data type, represent the MSI irq controller. They are
> not the same object. Their name easily confusing people.

Ok, it all makes sense now.

Acked-by: David Vrabel <david.vrabel@citrix.com>

David

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

* Re: [Xen-devel] [PATCH v1 08/21] x86/xen/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-10 12:38       ` David Vrabel
@ 2014-09-10 14:59         ` Konrad Rzeszutek Wilk
  2014-09-11  1:28           ` Yijing Wang
  2014-09-11  1:27         ` Yijing Wang
  1 sibling, 1 reply; 52+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-09-10 14:59 UTC (permalink / raw)
  To: David Vrabel
  Cc: Yijing Wang, Bjorn Helgaas, linux-mips, linux-ia64, linux-pci,
	Xinwei Hu, sparclinux, linux-arch, linux-s390, Russell King,
	Joerg Roedel, x86, Sebastian Ott, Benjamin Herrenschmidt,
	xen-devel, arnab.basu, Arnd Bergmann, Chris Metcalf,
	Thomas Gleixner, linux-arm-kernel, Bharat.Bhushan, Tony Luck,
	Ralf Baechle, iommu, Wuyun, linuxppc-dev, David S. Miller

On Wed, Sep 10, 2014 at 01:38:25PM +0100, David Vrabel wrote:
> On 09/09/14 03:06, Yijing Wang wrote:
> > On 2014/9/5 22:29, David Vrabel wrote:
> >> On 05/09/14 11:09, Yijing Wang wrote:
> >>> Use MSI chip framework instead of arch MSI functions to configure
> >>> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.
> >> [...]
> >>> --- a/arch/x86/pci/xen.c
> >>> +++ b/arch/x86/pci/xen.c
> >> [...]
> >>> @@ -418,9 +430,9 @@ int __init pci_xen_init(void)
> >>>  #endif
> >>>  
> >>>  #ifdef CONFIG_PCI_MSI
> >>> -	x86_msi.setup_msi_irqs = xen_setup_msi_irqs;
> >>> -	x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
> >>> -	x86_msi.teardown_msi_irqs = xen_teardown_msi_irqs;
> >>> +	xen_msi_chip.setup_irqs = xen_setup_msi_irqs;
> >>> +	xen_msi_chip.teardown_irqs = xen_teardown_msi_irqs;
> >>> +	x86_msi_chip = &xen_msi_chip;
> >>>  	msi_chip.irq_mask = xen_nop_msi_mask;
> >>>  	msi_chip.irq_unmask = xen_nop_msi_mask;
> >>
> >> Why have these not been changed to set the x86_msi_chip.mask/unmask
> >> fields instead?
> > 
> > Hi David, x86_msi_chip here is struct msi_chip data type, used to configure MSI/MSI-X
> > irq. msi_chip above is struct irq_chip data type, represent the MSI irq controller. They are
> > not the same object. Their name easily confusing people.
> 
> Ok, it all makes sense now.
> 
> Acked-by: David Vrabel <david.vrabel@citrix.com>

You can also add 'Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>'

on the whole series - I ran it through on Xen and on baremetal with a mix of 32/64 builds.

Oh, and also Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> the Xen parts.

> 
> David
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

* Re: [Xen-devel] [PATCH v1 04/21] x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq()
  2014-09-10 12:36   ` [Xen-devel] " David Vrabel
@ 2014-09-11  1:22     ` Yijing Wang
  2014-09-11 13:08       ` David Vrabel
  0 siblings, 1 reply; 52+ messages in thread
From: Yijing Wang @ 2014-09-11  1:22 UTC (permalink / raw)
  To: David Vrabel, Bjorn Helgaas
  Cc: linux-mips, linux-ia64, linux-pci, Bharat.Bhushan, sparclinux,
	linux-arch, linux-s390, Russell King, Joerg Roedel, x86,
	Sebastian Ott, Benjamin Herrenschmidt, xen-devel, arnab.basu,
	Arnd Bergmann, Chris Metcalf, Thomas Gleixner, linux-arm-kernel,
	Xinwei Hu, Tony Luck, Ralf Baechle, iommu, Wuyun, linuxppc-dev,
	David S. Miller

On 2014/9/10 20:36, David Vrabel wrote:
> On 05/09/14 11:09, Yijing Wang wrote:
>> Commit 0e4ccb150 added two __weak arch functions arch_msix_mask_irq()
>> and arch_msi_mask_irq() to fix a bug found when running xen in x86.
>> Introduced these two funcntions make MSI code complex. And mask/unmask
>> is the irq actions related to interrupt controller, should not use
>> weak arch functions to override mask/unmask interfaces. This patch
>> reverted commit 0e4ccb150 and export struct irq_chip msi_chip, modify
>> msi_chip->irq_mask/irq_unmask() in xen init functions to fix this
>> bug for simplicity. Also this is preparation for using struct
>> msi_chip instead of weak arch MSI functions in all platforms.
> 
> Acked-by: David Vrabel <david.vrabel@citrix.com>
> 
> But I wonder if it would be better the Xen subsystem to provide its own
> struct irq_chip instead of adjusting the fields in the generic x86 one.

Thanks! Currently, Xen and the bare x86 system only have the different irq_chip->irq_mask/irq_unmask.
So I chose to override the two ops of bare x86 irq_chip in xen. Konrad Rzeszutek Wilk has been tested it
ok in his platform, so I think we could use its own irq_chip for xen later if the difference become large.

Thanks!
Yijing.

> 
> David
> 
> .
> 


-- 
Thanks!
Yijing


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

* Re: [Xen-devel] [PATCH v1 08/21] x86/xen/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-10 12:38       ` David Vrabel
  2014-09-10 14:59         ` Konrad Rzeszutek Wilk
@ 2014-09-11  1:27         ` Yijing Wang
  1 sibling, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-11  1:27 UTC (permalink / raw)
  To: David Vrabel, Bjorn Helgaas
  Cc: linux-mips, linux-ia64, linux-pci, Xinwei Hu, sparclinux,
	linux-arch, linux-s390, Russell King, Joerg Roedel, x86,
	Sebastian Ott, Benjamin Herrenschmidt, xen-devel, arnab.basu,
	Arnd Bergmann, Chris Metcalf, Thomas Gleixner, linux-arm-kernel,
	Bharat.Bhushan, Tony Luck, Ralf Baechle, iommu, Wuyun,
	linuxppc-dev, David S. Miller

On 2014/9/10 20:38, David Vrabel wrote:
> On 09/09/14 03:06, Yijing Wang wrote:
>> On 2014/9/5 22:29, David Vrabel wrote:
>>> On 05/09/14 11:09, Yijing Wang wrote:
>>>> Use MSI chip framework instead of arch MSI functions to configure
>>>> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.
>>> [...]
>>>> --- a/arch/x86/pci/xen.c
>>>> +++ b/arch/x86/pci/xen.c
>>> [...]
>>>> @@ -418,9 +430,9 @@ int __init pci_xen_init(void)
>>>>  #endif
>>>>  
>>>>  #ifdef CONFIG_PCI_MSI
>>>> -	x86_msi.setup_msi_irqs = xen_setup_msi_irqs;
>>>> -	x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
>>>> -	x86_msi.teardown_msi_irqs = xen_teardown_msi_irqs;
>>>> +	xen_msi_chip.setup_irqs = xen_setup_msi_irqs;
>>>> +	xen_msi_chip.teardown_irqs = xen_teardown_msi_irqs;
>>>> +	x86_msi_chip = &xen_msi_chip;
>>>>  	msi_chip.irq_mask = xen_nop_msi_mask;
>>>>  	msi_chip.irq_unmask = xen_nop_msi_mask;
>>>
>>> Why have these not been changed to set the x86_msi_chip.mask/unmask
>>> fields instead?
>>
>> Hi David, x86_msi_chip here is struct msi_chip data type, used to configure MSI/MSI-X
>> irq. msi_chip above is struct irq_chip data type, represent the MSI irq controller. They are
>> not the same object. Their name easily confusing people.
> 
> Ok, it all makes sense now.
> 
> Acked-by: David Vrabel <david.vrabel@citrix.com>

Thanks!

> 
> David
> 
> .
> 


-- 
Thanks!
Yijing


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

* Re: [Xen-devel] [PATCH v1 08/21] x86/xen/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-10 14:59         ` Konrad Rzeszutek Wilk
@ 2014-09-11  1:28           ` Yijing Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-11  1:28 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk, David Vrabel
  Cc: Bjorn Helgaas, linux-mips, linux-ia64, linux-pci, Xinwei Hu,
	sparclinux, linux-arch, linux-s390, Russell King, Joerg Roedel,
	x86, Sebastian Ott, Benjamin Herrenschmidt, xen-devel,
	arnab.basu, Arnd Bergmann, Chris Metcalf, Thomas Gleixner,
	linux-arm-kernel, Bharat.Bhushan, Tony Luck, Ralf Baechle, iommu,
	Wuyun, linuxppc-dev, David S. Miller

On 2014/9/10 22:59, Konrad Rzeszutek Wilk wrote:
> On Wed, Sep 10, 2014 at 01:38:25PM +0100, David Vrabel wrote:
>> On 09/09/14 03:06, Yijing Wang wrote:
>>> On 2014/9/5 22:29, David Vrabel wrote:
>>>> On 05/09/14 11:09, Yijing Wang wrote:
>>>>> Use MSI chip framework instead of arch MSI functions to configure
>>>>> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.
>>>> [...]
>>>>> --- a/arch/x86/pci/xen.c
>>>>> +++ b/arch/x86/pci/xen.c
>>>> [...]
>>>>> @@ -418,9 +430,9 @@ int __init pci_xen_init(void)
>>>>>  #endif
>>>>>  
>>>>>  #ifdef CONFIG_PCI_MSI
>>>>> -	x86_msi.setup_msi_irqs = xen_setup_msi_irqs;
>>>>> -	x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
>>>>> -	x86_msi.teardown_msi_irqs = xen_teardown_msi_irqs;
>>>>> +	xen_msi_chip.setup_irqs = xen_setup_msi_irqs;
>>>>> +	xen_msi_chip.teardown_irqs = xen_teardown_msi_irqs;
>>>>> +	x86_msi_chip = &xen_msi_chip;
>>>>>  	msi_chip.irq_mask = xen_nop_msi_mask;
>>>>>  	msi_chip.irq_unmask = xen_nop_msi_mask;
>>>>
>>>> Why have these not been changed to set the x86_msi_chip.mask/unmask
>>>> fields instead?
>>>
>>> Hi David, x86_msi_chip here is struct msi_chip data type, used to configure MSI/MSI-X
>>> irq. msi_chip above is struct irq_chip data type, represent the MSI irq controller. They are
>>> not the same object. Their name easily confusing people.
>>
>> Ok, it all makes sense now.
>>
>> Acked-by: David Vrabel <david.vrabel@citrix.com>
> 
> You can also add 'Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>'
> 
> on the whole series - I ran it through on Xen and on baremetal with a mix of 32/64 builds.
> 
> Oh, and also Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> the Xen parts.

Thanks very much for your test and review!

Thanks!
Yijing.

> 
>>
>> David
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
> 
> .
> 


-- 
Thanks!
Yijing


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

* Re: [Xen-devel] [PATCH v1 04/21] x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq()
  2014-09-11  1:22     ` Yijing Wang
@ 2014-09-11 13:08       ` David Vrabel
  0 siblings, 0 replies; 52+ messages in thread
From: David Vrabel @ 2014-09-11 13:08 UTC (permalink / raw)
  To: Yijing Wang, David Vrabel, Bjorn Helgaas
  Cc: linux-mips, linux-ia64, linux-pci, Xinwei Hu, sparclinux,
	linux-arch, linux-s390, Russell King, Joerg Roedel, x86,
	Sebastian Ott, Benjamin Herrenschmidt, xen-devel, arnab.basu,
	Arnd Bergmann, Chris Metcalf, Thomas Gleixner, linux-arm-kernel,
	Bharat.Bhushan, Tony Luck, Ralf Baechle, iommu, Wuyun,
	linuxppc-dev, David S. Miller

On 11/09/14 02:22, Yijing Wang wrote:
> On 2014/9/10 20:36, David Vrabel wrote:
>> On 05/09/14 11:09, Yijing Wang wrote:
>>> Commit 0e4ccb150 added two __weak arch functions arch_msix_mask_irq()
>>> and arch_msi_mask_irq() to fix a bug found when running xen in x86.
>>> Introduced these two funcntions make MSI code complex. And mask/unmask
>>> is the irq actions related to interrupt controller, should not use
>>> weak arch functions to override mask/unmask interfaces. This patch
>>> reverted commit 0e4ccb150 and export struct irq_chip msi_chip, modify
>>> msi_chip->irq_mask/irq_unmask() in xen init functions to fix this
>>> bug for simplicity. Also this is preparation for using struct
>>> msi_chip instead of weak arch MSI functions in all platforms.
>>
>> Acked-by: David Vrabel <david.vrabel@citrix.com>
>>
>> But I wonder if it would be better the Xen subsystem to provide its own
>> struct irq_chip instead of adjusting the fields in the generic x86 one.
> 
> Thanks! Currently, Xen and the bare x86 system only have the different irq_chip->irq_mask/irq_unmask.
> So I chose to override the two ops of bare x86 irq_chip in xen. Konrad Rzeszutek Wilk has been tested it
> ok in his platform, so I think we could use its own irq_chip for xen later if the difference become large.

This sounds reasonable.

David

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

* Re: [PATCH v1 03/21] MSI: Remove the redundant irq_set_chip_data()
  2014-09-05 10:09 ` [PATCH v1 03/21] MSI: Remove the redundant irq_set_chip_data() Yijing Wang
@ 2014-09-15 14:00   ` Lucas Stach
  2014-09-16  1:30     ` Yijing Wang
  0 siblings, 1 reply; 52+ messages in thread
From: Lucas Stach @ 2014-09-15 14:00 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Bjorn Helgaas, Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel,
	Russell King, linux-arch, arnab.basu, Bharat.Bhushan, x86,
	Arnd Bergmann, Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel,
	Joerg Roedel, iommu, linux-mips, Benjamin Herrenschmidt,
	linuxppc-dev, linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle

Am Freitag, den 05.09.2014, 18:09 +0800 schrieb Yijing Wang:
> Currently, pcie-designware, pcie-rcar, pci-tegra drivers
> use irq chip_data to save the msi_chip pointer. They
> already call irq_set_chip_data() in their own MSI irq map
> functions. So irq_set_chip_data() in arch_setup_msi_irq()
> is useless.
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> ---
>  drivers/pci/msi.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> index f6cb317..d547f7f 100644
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -41,8 +41,6 @@ int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
>  	if (err < 0)
>  		return err;
>  
> -	irq_set_chip_data(desc->irq, chip);
> -
>  	return 0;
>  }
>  

arch_teardown_msi_irq() expects to find the msi_chip in the irq
chip_data field. As this means drivers don't have any reasonable other
possibility to stuff things into this field, I think it would make sense
to do the cleanup the other way around: keep the irq_set_chip_data
arch_setup_msi_irq() and rip it out of the individual drivers.

Regards,
Lucas

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |


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

* Re: [PATCH v1 05/21] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip
  2014-09-05 10:09 ` [PATCH v1 05/21] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip Yijing Wang
@ 2014-09-15 14:42   ` Lucas Stach
  2014-09-16  2:08     ` Yijing Wang
  0 siblings, 1 reply; 52+ messages in thread
From: Lucas Stach @ 2014-09-15 14:42 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Bjorn Helgaas, Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel,
	Russell King, linux-arch, arnab.basu, Bharat.Bhushan, x86,
	Arnd Bergmann, Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel,
	Joerg Roedel, iommu, linux-mips, Benjamin Herrenschmidt,
	linuxppc-dev, linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle

Am Freitag, den 05.09.2014, 18:09 +0800 schrieb Yijing Wang:
> Introduce weak arch_find_msi_chip() to find the match msi_chip.
> Currently, MSI chip associates pci bus to msi_chip. Because in
> ARM platform, there may be more than one MSI controller in system.
> Associate pci bus to msi_chip help pci device to find the match
> msi_chip and setup MSI/MSI-X irq correctly. But in other platform,
> like in x86. we only need one MSI chip, because all device use
> the same MSI address/data and irq etc. So it's no need to associate
> pci bus to MSI chip, just use a arch function, arch_find_msi_chip()
> to return the MSI chip for simplicity. The default weak
> arch_find_msi_chip() used in ARM platform, find the MSI chip
> by pci bus.
> 
Hm, while one weak function sounds much better than the plethora we have
now, I wonder how much work it would be to associate the msi_chip with
the pci bus on other arches the same way as done on ARM. This way we
could kill this calling into arch specific functions which would make
things a bit clearer to follow I think.

Regards,
Lucas

> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> ---
>  drivers/pci/msi.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> index a77e7f7..539c11d 100644
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -29,9 +29,14 @@ static int pci_msi_enable = 1;
>  
>  /* Arch hooks */
>  
> +struct msi_chip * __weak arch_find_msi_chip(struct pci_dev *dev)
> +{
> +	return dev->bus->msi;
> +}
> +
>  int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
>  {
> -	struct msi_chip *chip = dev->bus->msi;
> +	struct msi_chip *chip = arch_find_msi_chip(dev);
>  	int err;
>  
>  	if (!chip || !chip->setup_irq)

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |


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

* Re: [PATCH v1 06/21] PCI/MSI: Refactor struct msi_chip to make it become more common
  2014-09-05 10:09 ` [PATCH v1 06/21] PCI/MSI: Refactor struct msi_chip to make it become more common Yijing Wang
@ 2014-09-15 14:44   ` Lucas Stach
  2014-09-16  2:09     ` Yijing Wang
  0 siblings, 1 reply; 52+ messages in thread
From: Lucas Stach @ 2014-09-15 14:44 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Bjorn Helgaas, Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel,
	Russell King, linux-arch, arnab.basu, Bharat.Bhushan, x86,
	Arnd Bergmann, Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel,
	Joerg Roedel, iommu, linux-mips, Benjamin Herrenschmidt,
	linuxppc-dev, linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle

Am Freitag, den 05.09.2014, 18:09 +0800 schrieb Yijing Wang:
> Now there are a lot of __weak arch functions in MSI code.
> These functions make MSI driver complex. Thierry Reding Introduced
> a new MSI chip framework to configure MSI/MSI-X irq in ARM. Use
> the new MSI chip framework to refactor all other platform MSI
> arch code to eliminate weak arch MSI functions. This patch add
> .restore_irq() and .setup_irqs() to make it become more common.
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>

This change looks good to me:
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
>  drivers/pci/msi.c   |   15 +++++++++++++++
>  include/linux/msi.h |    3 +++
>  2 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> index 539c11d..d78d637 100644
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -63,6 +63,11 @@ int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>  {
>  	struct msi_desc *entry;
>  	int ret;
> +	struct msi_chip *chip;
> +
> +	chip = arch_find_msi_chip(dev);
> +	if (chip && chip->setup_irqs)
> +		return chip->setup_irqs(dev, nvec, type);
>  
>  	/*
>  	 * If an architecture wants to support multiple MSI, it needs to
> @@ -105,6 +110,11 @@ void default_teardown_msi_irqs(struct pci_dev *dev)
>  
>  void __weak arch_teardown_msi_irqs(struct pci_dev *dev)
>  {
> +	struct msi_chip *chip = arch_find_msi_chip(dev);
> +
> +	if (chip && chip->teardown_irqs)
> +		return chip->teardown_irqs(dev);
> +
>  	return default_teardown_msi_irqs(dev);
>  }
>  
> @@ -128,6 +138,11 @@ static void default_restore_msi_irq(struct pci_dev *dev, int irq)
>  
>  void __weak arch_restore_msi_irqs(struct pci_dev *dev)
>  {
> +	struct msi_chip *chip = arch_find_msi_chip(dev);
> +
> +	if (chip && chip->restore_irqs)
> +		return chip->restore_irqs(dev);
> +
>  	return default_restore_msi_irqs(dev);
>  }
>  
> diff --git a/include/linux/msi.h b/include/linux/msi.h
> index 5650848..92a51e7 100644
> --- a/include/linux/msi.h
> +++ b/include/linux/msi.h
> @@ -72,7 +72,10 @@ struct msi_chip {
>  	struct list_head list;
>  
>  	int (*setup_irq)(struct pci_dev *dev, struct msi_desc *desc);
> +	int (*setup_irqs)(struct pci_dev *dev, int nvec, int type);
>  	void (*teardown_irq)(unsigned int irq);
> +	void (*teardown_irqs)(struct pci_dev *dev);
> +	void (*restore_irqs)(struct pci_dev *dev);
>  };
>  
>  #endif /* LINUX_MSI_H */

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |


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

* Re: [PATCH v1 21/21] PCI/MSI: Clean up unused MSI arch functions
  2014-09-05 10:10 ` [PATCH v1 21/21] PCI/MSI: Clean up unused MSI arch functions Yijing Wang
@ 2014-09-15 14:47   ` Lucas Stach
  2014-09-16  2:09     ` Yijing Wang
  0 siblings, 1 reply; 52+ messages in thread
From: Lucas Stach @ 2014-09-15 14:47 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Bjorn Helgaas, Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel,
	Russell King, linux-arch, arnab.basu, Bharat.Bhushan, x86,
	Arnd Bergmann, Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel,
	Joerg Roedel, iommu, linux-mips, Benjamin Herrenschmidt,
	linuxppc-dev, linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle

Am Freitag, den 05.09.2014, 18:10 +0800 schrieb Yijing Wang:
> Now we use struct msi_chip in all platforms to configure
> MSI/MSI-X. We can clean up the unused arch functions.
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
>  drivers/iommu/irq_remapping.c |    2 +-
>  drivers/pci/msi.c             |   99 ++++++++++++++++-------------------------
>  include/linux/msi.h           |   14 ------
>  3 files changed, 39 insertions(+), 76 deletions(-)
> 
> diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
> index 99b1c0f..6e645f0 100644
> --- a/drivers/iommu/irq_remapping.c
> +++ b/drivers/iommu/irq_remapping.c
> @@ -92,7 +92,7 @@ error:
>  
>  	/*
>  	 * Restore altered MSI descriptor fields and prevent just destroyed
> -	 * IRQs from tearing down again in default_teardown_msi_irqs()
> +	 * IRQs from tearing down again in teardown_msi_irqs()
>  	 */
>  	msidesc->irq = 0;
>  	msidesc->nvec_used = 0;
> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> index d78d637..e3e7f4f 100644
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -34,50 +34,31 @@ struct msi_chip * __weak arch_find_msi_chip(struct pci_dev *dev)
>  	return dev->bus->msi;
>  }
>  
> -int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
> -{
> -	struct msi_chip *chip = arch_find_msi_chip(dev);
> -	int err;
> -
> -	if (!chip || !chip->setup_irq)
> -		return -EINVAL;
> -
> -	err = chip->setup_irq(dev, desc);
> -	if (err < 0)
> -		return err;
> -
> -	return 0;
> -}
> -
> -void __weak arch_teardown_msi_irq(unsigned int irq)
> -{
> -	struct msi_chip *chip = irq_get_chip_data(irq);
> -
> -	if (!chip || !chip->teardown_irq)
> -		return;
> -
> -	chip->teardown_irq(irq);
> -}
> -
> -int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
> +int setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>  {
>  	struct msi_desc *entry;
>  	int ret;
>  	struct msi_chip *chip;
>  
>  	chip = arch_find_msi_chip(dev);
> -	if (chip && chip->setup_irqs)
> +	if (!chip)
> +		return -EINVAL;
> +
> +	if (chip->setup_irqs)
>  		return chip->setup_irqs(dev, nvec, type);
>  
>  	/*
>  	 * If an architecture wants to support multiple MSI, it needs to
> -	 * override arch_setup_msi_irqs()
> +	 * implement chip->setup_irqs().
>  	 */
>  	if (type == PCI_CAP_ID_MSI && nvec > 1)
>  		return 1;
>  
> +	if (!chip->setup_irq)
> +		return -EINVAL;
> +
>  	list_for_each_entry(entry, &dev->msi_list, list) {
> -		ret = arch_setup_msi_irq(dev, entry);
> +		ret = chip->setup_irq(dev, entry);
>  		if (ret < 0)
>  			return ret;
>  		if (ret > 0)
> @@ -87,13 +68,20 @@ int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>  	return 0;
>  }
>  
> -/*
> - * 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)
> +static void teardown_msi_irqs(struct pci_dev *dev)
>  {
>  	struct msi_desc *entry;
> +	struct msi_chip *chip;
> +
> +	chip = arch_find_msi_chip(dev);
> +	if (!chip)
> +		return;
> +
> +	if (chip->teardown_irqs)
> +		return chip->teardown_irqs(dev);
> +
> +	if (!chip->teardown_irq)
> +		return;
>  
>  	list_for_each_entry(entry, &dev->msi_list, list) {
>  		int i, nvec;
> @@ -104,20 +92,10 @@ void default_teardown_msi_irqs(struct pci_dev *dev)
>  		else
>  			nvec = 1 << entry->msi_attrib.multiple;
>  		for (i = 0; i < nvec; i++)
> -			arch_teardown_msi_irq(entry->irq + i);
> +			chip->teardown_irq(entry->irq + i);
>  	}
>  }
>  
> -void __weak arch_teardown_msi_irqs(struct pci_dev *dev)
> -{
> -	struct msi_chip *chip = arch_find_msi_chip(dev);
> -
> -	if (chip && chip->teardown_irqs)
> -		return chip->teardown_irqs(dev);
> -
> -	return default_teardown_msi_irqs(dev);
> -}
> -
>  static void default_restore_msi_irq(struct pci_dev *dev, int irq)
>  {
>  	struct msi_desc *entry;
> @@ -136,10 +114,18 @@ static void default_restore_msi_irq(struct pci_dev *dev, int irq)
>  		write_msi_msg(irq, &entry->msg);
>  }
>  
> -void __weak arch_restore_msi_irqs(struct pci_dev *dev)
> +static void default_restore_msi_irqs(struct pci_dev *dev)
>  {
> -	struct msi_chip *chip = arch_find_msi_chip(dev);
> +	struct msi_desc *entry = NULL;
> +
> +	list_for_each_entry(entry, &dev->msi_list, list) {
> +		default_restore_msi_irq(dev, entry->irq);
> +	}
> +}
>  
> +static void restore_msi_irqs(struct pci_dev *dev)
> +{
> +	struct msi_chip *chip = arch_find_msi_chip(dev);
>  	if (chip && chip->restore_irqs)
>  		return chip->restore_irqs(dev);
>  
> @@ -248,15 +234,6 @@ void unmask_msi_irq(struct irq_data *data)
>  	msi_set_mask_bit(data, 0);
>  }
>  
> -void default_restore_msi_irqs(struct pci_dev *dev)
> -{
> -	struct msi_desc *entry;
> -
> -	list_for_each_entry(entry, &dev->msi_list, list) {
> -		default_restore_msi_irq(dev, entry->irq);
> -	}
> -}
> -
>  void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
>  {
>  	BUG_ON(entry->dev->current_state != PCI_D0);
> @@ -360,7 +337,7 @@ static void free_msi_irqs(struct pci_dev *dev)
>  			BUG_ON(irq_has_action(entry->irq + i));
>  	}
>  
> -	arch_teardown_msi_irqs(dev);
> +	teardown_msi_irqs(dev);
>  
>  	list_for_each_entry_safe(entry, tmp, &dev->msi_list, list) {
>  		if (entry->msi_attrib.is_msix) {
> @@ -430,7 +407,7 @@ static void __pci_restore_msi_state(struct pci_dev *dev)
>  
>  	pci_intx_for_msi(dev, 0);
>  	msi_set_enable(dev, 0);
> -	arch_restore_msi_irqs(dev);
> +	restore_msi_irqs(dev);
>  
>  	pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control);
>  	msi_mask_irq(entry, msi_mask(entry->msi_attrib.multi_cap),
> @@ -453,7 +430,7 @@ static void __pci_restore_msix_state(struct pci_dev *dev)
>  	msix_clear_and_set_ctrl(dev, 0,
>  				PCI_MSIX_FLAGS_ENABLE | PCI_MSIX_FLAGS_MASKALL);
>  
> -	arch_restore_msi_irqs(dev);
> +	restore_msi_irqs(dev);
>  	list_for_each_entry(entry, &dev->msi_list, list) {
>  		msix_mask_irq(entry, entry->masked);
>  	}
> @@ -624,7 +601,7 @@ static int msi_capability_init(struct pci_dev *dev, int nvec)
>  	list_add_tail(&entry->list, &dev->msi_list);
>  
>  	/* Configure MSI capability structure */
> -	ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSI);
> +	ret = setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSI);
>  	if (ret) {
>  		msi_mask_irq(entry, mask, ~mask);
>  		free_msi_irqs(dev);
> @@ -740,7 +717,7 @@ static int msix_capability_init(struct pci_dev *dev,
>  	if (ret)
>  		return ret;
>  
> -	ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX);
> +	ret = setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX);
>  	if (ret)
>  		goto out_avail;
>  
> diff --git a/include/linux/msi.h b/include/linux/msi.h
> index 92a51e7..d6e1f7c 100644
> --- a/include/linux/msi.h
> +++ b/include/linux/msi.h
> @@ -51,20 +51,6 @@ struct msi_desc {
>  	struct kobject kobj;
>  };
>  
> -/*
> - * 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);
> -void arch_restore_msi_irqs(struct pci_dev *dev);
> -
> -void default_teardown_msi_irqs(struct pci_dev *dev);
> -void default_restore_msi_irqs(struct pci_dev *dev);
> -
>  struct msi_chip {
>  	struct module *owner;
>  	struct device *dev;

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |


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

* Re: [PATCH v1 03/21] MSI: Remove the redundant irq_set_chip_data()
  2014-09-15 14:00   ` Lucas Stach
@ 2014-09-16  1:30     ` Yijing Wang
  2014-09-16 10:29       ` Lucas Stach
  0 siblings, 1 reply; 52+ messages in thread
From: Yijing Wang @ 2014-09-16  1:30 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Bjorn Helgaas, Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel,
	Russell King, linux-arch, arnab.basu, Bharat.Bhushan, x86,
	Arnd Bergmann, Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel,
	Joerg Roedel, iommu, linux-mips, Benjamin Herrenschmidt,
	linuxppc-dev, linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle

On 2014/9/15 22:00, Lucas Stach wrote:
> Am Freitag, den 05.09.2014, 18:09 +0800 schrieb Yijing Wang:
>> Currently, pcie-designware, pcie-rcar, pci-tegra drivers
>> use irq chip_data to save the msi_chip pointer. They
>> already call irq_set_chip_data() in their own MSI irq map
>> functions. So irq_set_chip_data() in arch_setup_msi_irq()
>> is useless.
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
>> ---
>>  drivers/pci/msi.c |    2 --
>>  1 files changed, 0 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
>> index f6cb317..d547f7f 100644
>> --- a/drivers/pci/msi.c
>> +++ b/drivers/pci/msi.c
>> @@ -41,8 +41,6 @@ int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
>>  	if (err < 0)
>>  		return err;
>>  
>> -	irq_set_chip_data(desc->irq, chip);
>> -
>>  	return 0;
>>  }
>>  
> 
> arch_teardown_msi_irq() expects to find the msi_chip in the irq
> chip_data field. As this means drivers don't have any reasonable other
> possibility to stuff things into this field, I think it would make sense
> to do the cleanup the other way around: keep the irq_set_chip_data
> arch_setup_msi_irq() and rip it out of the individual drivers.

Hi Lucas, thanks for your review and comments!
irq_set_chip_data() should not be placed in MSI core functions, because other arch like x86,
use irq_data->chip_data to stores irq_cfg. So how to set the chip_data is arch dependent.
And this series is mainly to use MSI chip framework in all platforms.
Currently, only ARM platform MSI drivers use the chip_data to store msi_chip, and the drivers call
irq_set_chip_data() in their driver already. So I thought we should clean up it in MSI core code.

Thanks!
Yijing.


> 
> Regards,
> Lucas
> 


-- 
Thanks!
Yijing


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

* Re: [PATCH v1 05/21] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip
  2014-09-15 14:42   ` Lucas Stach
@ 2014-09-16  2:08     ` Yijing Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-16  2:08 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Bjorn Helgaas, Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel,
	Russell King, linux-arch, arnab.basu, Bharat.Bhushan, x86,
	Arnd Bergmann, Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel,
	Joerg Roedel, iommu, linux-mips, Benjamin Herrenschmidt,
	linuxppc-dev, linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle

On 2014/9/15 22:42, Lucas Stach wrote:
> Am Freitag, den 05.09.2014, 18:09 +0800 schrieb Yijing Wang:
>> Introduce weak arch_find_msi_chip() to find the match msi_chip.
>> Currently, MSI chip associates pci bus to msi_chip. Because in
>> ARM platform, there may be more than one MSI controller in system.
>> Associate pci bus to msi_chip help pci device to find the match
>> msi_chip and setup MSI/MSI-X irq correctly. But in other platform,
>> like in x86. we only need one MSI chip, because all device use
>> the same MSI address/data and irq etc. So it's no need to associate
>> pci bus to MSI chip, just use a arch function, arch_find_msi_chip()
>> to return the MSI chip for simplicity. The default weak
>> arch_find_msi_chip() used in ARM platform, find the MSI chip
>> by pci bus.
>>
> Hm, while one weak function sounds much better than the plethora we have
> now, I wonder how much work it would be to associate the msi_chip with
> the pci bus on other arches the same way as done on ARM. This way we
> could kill this calling into arch specific functions which would make
> things a bit clearer to follow I think.

That's a heavy work to associate msi_chip with the pci_bus in all platforms,
And only in ARM platform, there are two or more different msi_chips which maybe
associate pci hostbridge or irq chip. In other platforms, only one MSI chip
exists at the same time. Another reason is I don't think associate the msi_chip
with pci bus is a good idea to make PCI device find its own msi_chip.
All PCI devices under the same PCI hostbridge should have the same msi_chip,
and now a property "msi-parent" is defined to help pci hostbridge to find its matched
msi_chip. I like to associate the msi_chip with a pci hostbridge. So we don't need to
add a lot of pcibios_add_bus() to do that.

I inspected all MSI chip drivers, and found there are two different relations between msi_chip and PCI hostbridge
1. MSI chip is a irq chip, like irq_armada_370_xp, PCI hostbridge platform device use "msi-parent" to find msi_chip by of_node.
2. MSI chip is integrated into PCI hostbridge, so msi_chip->dev is the PCI hostbridge platform device.

So long as we use PCI hostbridge platform device as the parent of PCI hostbridge, every PCI device under the hostbridge
can find the msi_chip by it.

All MSI chip drivers now except pci-mvebu have been passed the hostbridge platform dev as the parent.
pci_common_init_dev(pcie->dev, &hw);
			^
Pseudo code like:

struct msi_chip *pcibios_find_msi_chip(struct pci_dev *dev)
 {
       struct pci_bus *root;
       struct pci_host_bridge *bridge;
       struct msi_chip *chip;
       struct device_node *node, *msi_node;

       /* First we find msi_chip by the phb of_node */    <-------- MSI chip is a irq chip
       root = pci_find_root_bus(dev->bus);
       node = pcibios_get_phb_of_node(root);
       if (node) {
               msi_node = of_parse_phandle(n, "msi-parent", 0);
               of_node_put(node);
               if (msi_node)
                       return of_pci_find_msi_chip_by_node(msi_node);
       }


       /* Some msi_chip are integrated into pci hostbridge,
        * we find it by phb device pointer.
        */
       if (bridge && bridge->dev.parent) {		<-----------MSI chip is integrated into PCI hostbridge
               down_read(&pci_msi_chip_sem);
               list_for_each_entry(chip, &pci_msi_chip_list, list) {
                       if (chip->dev == bridge->dev.parent) {
                               up_read(pci_msi_chip_sem);
                               return chip;
                       }
                }
               up_read(&pci_msi_chip_sem);
        }


        return NULL;
 }

Thanks!
Yijing.


> 
> Regards,
> Lucas
> 
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
>> ---
>>  drivers/pci/msi.c |    7 ++++++-
>>  1 files changed, 6 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
>> index a77e7f7..539c11d 100644
>> --- a/drivers/pci/msi.c
>> +++ b/drivers/pci/msi.c
>> @@ -29,9 +29,14 @@ static int pci_msi_enable = 1;
>>  
>>  /* Arch hooks */
>>  
>> +struct msi_chip * __weak arch_find_msi_chip(struct pci_dev *dev)
>> +{
>> +	return dev->bus->msi;
>> +}
>> +
>>  int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
>>  {
>> -	struct msi_chip *chip = dev->bus->msi;
>> +	struct msi_chip *chip = arch_find_msi_chip(dev);
>>  	int err;
>>  
>>  	if (!chip || !chip->setup_irq)
> 


-- 
Thanks!
Yijing


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

* Re: [PATCH v1 06/21] PCI/MSI: Refactor struct msi_chip to make it become more common
  2014-09-15 14:44   ` Lucas Stach
@ 2014-09-16  2:09     ` Yijing Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-16  2:09 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Bjorn Helgaas, Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel,
	Russell King, linux-arch, arnab.basu, Bharat.Bhushan, x86,
	Arnd Bergmann, Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel,
	Joerg Roedel, iommu, linux-mips, Benjamin Herrenschmidt,
	linuxppc-dev, linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle

On 2014/9/15 22:44, Lucas Stach wrote:
> Am Freitag, den 05.09.2014, 18:09 +0800 schrieb Yijing Wang:
>> Now there are a lot of __weak arch functions in MSI code.
>> These functions make MSI driver complex. Thierry Reding Introduced
>> a new MSI chip framework to configure MSI/MSI-X irq in ARM. Use
>> the new MSI chip framework to refactor all other platform MSI
>> arch code to eliminate weak arch MSI functions. This patch add
>> .restore_irq() and .setup_irqs() to make it become more common.
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> 
> This change looks good to me:
> Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

Thanks!

> 
>> ---
>>  drivers/pci/msi.c   |   15 +++++++++++++++
>>  include/linux/msi.h |    3 +++
>>  2 files changed, 18 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
>> index 539c11d..d78d637 100644
>> --- a/drivers/pci/msi.c
>> +++ b/drivers/pci/msi.c
>> @@ -63,6 +63,11 @@ int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>>  {
>>  	struct msi_desc *entry;
>>  	int ret;
>> +	struct msi_chip *chip;
>> +
>> +	chip = arch_find_msi_chip(dev);
>> +	if (chip && chip->setup_irqs)
>> +		return chip->setup_irqs(dev, nvec, type);
>>  
>>  	/*
>>  	 * If an architecture wants to support multiple MSI, it needs to
>> @@ -105,6 +110,11 @@ void default_teardown_msi_irqs(struct pci_dev *dev)
>>  
>>  void __weak arch_teardown_msi_irqs(struct pci_dev *dev)
>>  {
>> +	struct msi_chip *chip = arch_find_msi_chip(dev);
>> +
>> +	if (chip && chip->teardown_irqs)
>> +		return chip->teardown_irqs(dev);
>> +
>>  	return default_teardown_msi_irqs(dev);
>>  }
>>  
>> @@ -128,6 +138,11 @@ static void default_restore_msi_irq(struct pci_dev *dev, int irq)
>>  
>>  void __weak arch_restore_msi_irqs(struct pci_dev *dev)
>>  {
>> +	struct msi_chip *chip = arch_find_msi_chip(dev);
>> +
>> +	if (chip && chip->restore_irqs)
>> +		return chip->restore_irqs(dev);
>> +
>>  	return default_restore_msi_irqs(dev);
>>  }
>>  
>> diff --git a/include/linux/msi.h b/include/linux/msi.h
>> index 5650848..92a51e7 100644
>> --- a/include/linux/msi.h
>> +++ b/include/linux/msi.h
>> @@ -72,7 +72,10 @@ struct msi_chip {
>>  	struct list_head list;
>>  
>>  	int (*setup_irq)(struct pci_dev *dev, struct msi_desc *desc);
>> +	int (*setup_irqs)(struct pci_dev *dev, int nvec, int type);
>>  	void (*teardown_irq)(unsigned int irq);
>> +	void (*teardown_irqs)(struct pci_dev *dev);
>> +	void (*restore_irqs)(struct pci_dev *dev);
>>  };
>>  
>>  #endif /* LINUX_MSI_H */
> 


-- 
Thanks!
Yijing


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

* Re: [PATCH v1 21/21] PCI/MSI: Clean up unused MSI arch functions
  2014-09-15 14:47   ` Lucas Stach
@ 2014-09-16  2:09     ` Yijing Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-16  2:09 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Bjorn Helgaas, Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel,
	Russell King, linux-arch, arnab.basu, Bharat.Bhushan, x86,
	Arnd Bergmann, Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel,
	Joerg Roedel, iommu, linux-mips, Benjamin Herrenschmidt,
	linuxppc-dev, linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle

On 2014/9/15 22:47, Lucas Stach wrote:
> Am Freitag, den 05.09.2014, 18:10 +0800 schrieb Yijing Wang:
>> Now we use struct msi_chip in all platforms to configure
>> MSI/MSI-X. We can clean up the unused arch functions.
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> 
> Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

Thanks!

> 
>> ---
>>  drivers/iommu/irq_remapping.c |    2 +-
>>  drivers/pci/msi.c             |   99 ++++++++++++++++-------------------------
>>  include/linux/msi.h           |   14 ------
>>  3 files changed, 39 insertions(+), 76 deletions(-)
>>
>> diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
>> index 99b1c0f..6e645f0 100644
>> --- a/drivers/iommu/irq_remapping.c
>> +++ b/drivers/iommu/irq_remapping.c
>> @@ -92,7 +92,7 @@ error:
>>  
>>  	/*
>>  	 * Restore altered MSI descriptor fields and prevent just destroyed
>> -	 * IRQs from tearing down again in default_teardown_msi_irqs()
>> +	 * IRQs from tearing down again in teardown_msi_irqs()
>>  	 */
>>  	msidesc->irq = 0;
>>  	msidesc->nvec_used = 0;
>> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
>> index d78d637..e3e7f4f 100644
>> --- a/drivers/pci/msi.c
>> +++ b/drivers/pci/msi.c
>> @@ -34,50 +34,31 @@ struct msi_chip * __weak arch_find_msi_chip(struct pci_dev *dev)
>>  	return dev->bus->msi;
>>  }
>>  
>> -int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
>> -{
>> -	struct msi_chip *chip = arch_find_msi_chip(dev);
>> -	int err;
>> -
>> -	if (!chip || !chip->setup_irq)
>> -		return -EINVAL;
>> -
>> -	err = chip->setup_irq(dev, desc);
>> -	if (err < 0)
>> -		return err;
>> -
>> -	return 0;
>> -}
>> -
>> -void __weak arch_teardown_msi_irq(unsigned int irq)
>> -{
>> -	struct msi_chip *chip = irq_get_chip_data(irq);
>> -
>> -	if (!chip || !chip->teardown_irq)
>> -		return;
>> -
>> -	chip->teardown_irq(irq);
>> -}
>> -
>> -int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>> +int setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>>  {
>>  	struct msi_desc *entry;
>>  	int ret;
>>  	struct msi_chip *chip;
>>  
>>  	chip = arch_find_msi_chip(dev);
>> -	if (chip && chip->setup_irqs)
>> +	if (!chip)
>> +		return -EINVAL;
>> +
>> +	if (chip->setup_irqs)
>>  		return chip->setup_irqs(dev, nvec, type);
>>  
>>  	/*
>>  	 * If an architecture wants to support multiple MSI, it needs to
>> -	 * override arch_setup_msi_irqs()
>> +	 * implement chip->setup_irqs().
>>  	 */
>>  	if (type == PCI_CAP_ID_MSI && nvec > 1)
>>  		return 1;
>>  
>> +	if (!chip->setup_irq)
>> +		return -EINVAL;
>> +
>>  	list_for_each_entry(entry, &dev->msi_list, list) {
>> -		ret = arch_setup_msi_irq(dev, entry);
>> +		ret = chip->setup_irq(dev, entry);
>>  		if (ret < 0)
>>  			return ret;
>>  		if (ret > 0)
>> @@ -87,13 +68,20 @@ int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>>  	return 0;
>>  }
>>  
>> -/*
>> - * 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)
>> +static void teardown_msi_irqs(struct pci_dev *dev)
>>  {
>>  	struct msi_desc *entry;
>> +	struct msi_chip *chip;
>> +
>> +	chip = arch_find_msi_chip(dev);
>> +	if (!chip)
>> +		return;
>> +
>> +	if (chip->teardown_irqs)
>> +		return chip->teardown_irqs(dev);
>> +
>> +	if (!chip->teardown_irq)
>> +		return;
>>  
>>  	list_for_each_entry(entry, &dev->msi_list, list) {
>>  		int i, nvec;
>> @@ -104,20 +92,10 @@ void default_teardown_msi_irqs(struct pci_dev *dev)
>>  		else
>>  			nvec = 1 << entry->msi_attrib.multiple;
>>  		for (i = 0; i < nvec; i++)
>> -			arch_teardown_msi_irq(entry->irq + i);
>> +			chip->teardown_irq(entry->irq + i);
>>  	}
>>  }
>>  
>> -void __weak arch_teardown_msi_irqs(struct pci_dev *dev)
>> -{
>> -	struct msi_chip *chip = arch_find_msi_chip(dev);
>> -
>> -	if (chip && chip->teardown_irqs)
>> -		return chip->teardown_irqs(dev);
>> -
>> -	return default_teardown_msi_irqs(dev);
>> -}
>> -
>>  static void default_restore_msi_irq(struct pci_dev *dev, int irq)
>>  {
>>  	struct msi_desc *entry;
>> @@ -136,10 +114,18 @@ static void default_restore_msi_irq(struct pci_dev *dev, int irq)
>>  		write_msi_msg(irq, &entry->msg);
>>  }
>>  
>> -void __weak arch_restore_msi_irqs(struct pci_dev *dev)
>> +static void default_restore_msi_irqs(struct pci_dev *dev)
>>  {
>> -	struct msi_chip *chip = arch_find_msi_chip(dev);
>> +	struct msi_desc *entry = NULL;
>> +
>> +	list_for_each_entry(entry, &dev->msi_list, list) {
>> +		default_restore_msi_irq(dev, entry->irq);
>> +	}
>> +}
>>  
>> +static void restore_msi_irqs(struct pci_dev *dev)
>> +{
>> +	struct msi_chip *chip = arch_find_msi_chip(dev);
>>  	if (chip && chip->restore_irqs)
>>  		return chip->restore_irqs(dev);
>>  
>> @@ -248,15 +234,6 @@ void unmask_msi_irq(struct irq_data *data)
>>  	msi_set_mask_bit(data, 0);
>>  }
>>  
>> -void default_restore_msi_irqs(struct pci_dev *dev)
>> -{
>> -	struct msi_desc *entry;
>> -
>> -	list_for_each_entry(entry, &dev->msi_list, list) {
>> -		default_restore_msi_irq(dev, entry->irq);
>> -	}
>> -}
>> -
>>  void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
>>  {
>>  	BUG_ON(entry->dev->current_state != PCI_D0);
>> @@ -360,7 +337,7 @@ static void free_msi_irqs(struct pci_dev *dev)
>>  			BUG_ON(irq_has_action(entry->irq + i));
>>  	}
>>  
>> -	arch_teardown_msi_irqs(dev);
>> +	teardown_msi_irqs(dev);
>>  
>>  	list_for_each_entry_safe(entry, tmp, &dev->msi_list, list) {
>>  		if (entry->msi_attrib.is_msix) {
>> @@ -430,7 +407,7 @@ static void __pci_restore_msi_state(struct pci_dev *dev)
>>  
>>  	pci_intx_for_msi(dev, 0);
>>  	msi_set_enable(dev, 0);
>> -	arch_restore_msi_irqs(dev);
>> +	restore_msi_irqs(dev);
>>  
>>  	pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control);
>>  	msi_mask_irq(entry, msi_mask(entry->msi_attrib.multi_cap),
>> @@ -453,7 +430,7 @@ static void __pci_restore_msix_state(struct pci_dev *dev)
>>  	msix_clear_and_set_ctrl(dev, 0,
>>  				PCI_MSIX_FLAGS_ENABLE | PCI_MSIX_FLAGS_MASKALL);
>>  
>> -	arch_restore_msi_irqs(dev);
>> +	restore_msi_irqs(dev);
>>  	list_for_each_entry(entry, &dev->msi_list, list) {
>>  		msix_mask_irq(entry, entry->masked);
>>  	}
>> @@ -624,7 +601,7 @@ static int msi_capability_init(struct pci_dev *dev, int nvec)
>>  	list_add_tail(&entry->list, &dev->msi_list);
>>  
>>  	/* Configure MSI capability structure */
>> -	ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSI);
>> +	ret = setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSI);
>>  	if (ret) {
>>  		msi_mask_irq(entry, mask, ~mask);
>>  		free_msi_irqs(dev);
>> @@ -740,7 +717,7 @@ static int msix_capability_init(struct pci_dev *dev,
>>  	if (ret)
>>  		return ret;
>>  
>> -	ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX);
>> +	ret = setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX);
>>  	if (ret)
>>  		goto out_avail;
>>  
>> diff --git a/include/linux/msi.h b/include/linux/msi.h
>> index 92a51e7..d6e1f7c 100644
>> --- a/include/linux/msi.h
>> +++ b/include/linux/msi.h
>> @@ -51,20 +51,6 @@ struct msi_desc {
>>  	struct kobject kobj;
>>  };
>>  
>> -/*
>> - * 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);
>> -void arch_restore_msi_irqs(struct pci_dev *dev);
>> -
>> -void default_teardown_msi_irqs(struct pci_dev *dev);
>> -void default_restore_msi_irqs(struct pci_dev *dev);
>> -
>>  struct msi_chip {
>>  	struct module *owner;
>>  	struct device *dev;
> 


-- 
Thanks!
Yijing


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

* Re: [PATCH v1 15/21] Powerpc/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:10 ` [PATCH v1 15/21] Powerpc/MSI: " Yijing Wang
  2014-09-05 10:47   ` Sergei Shtylyov
@ 2014-09-16  5:28   ` Michael Ellerman
  2014-09-16  5:40     ` Yijing Wang
  1 sibling, 1 reply; 52+ messages in thread
From: Michael Ellerman @ 2014-09-16  5:28 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Bjorn Helgaas, linux-mips, linux-ia64, linux-pci, Bharat.Bhushan,
	sparclinux, linux-arch, linux-s390, Russell King, Joerg Roedel,
	x86, Sebastian Ott, xen-devel, arnab.basu, Arnd Bergmann,
	Konrad Rzeszutek Wilk, Chris Metcalf, Thomas Gleixner,
	linux-arm-kernel, Xinwei Hu, Tony Luck, Ralf Baechle, iommu,
	Wuyun, linuxppc-dev, David S. Miller

On Fri, 2014-09-05 at 18:10 +0800, Yijing Wang wrote:
> Use MSI chip framework instead of arch MSI functions to configure
> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>

This looks fine and seems to boot OK.

Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)

cheers



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

* Re: [PATCH v1 15/21] Powerpc/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-16  5:28   ` Michael Ellerman
@ 2014-09-16  5:40     ` Yijing Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-16  5:40 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Bjorn Helgaas, linux-mips, linux-ia64, linux-pci, Bharat.Bhushan,
	sparclinux, linux-arch, linux-s390, Russell King, Joerg Roedel,
	x86, Sebastian Ott, xen-devel, arnab.basu, Arnd Bergmann,
	Konrad Rzeszutek Wilk, Chris Metcalf, Thomas Gleixner,
	linux-arm-kernel, Xinwei Hu, Tony Luck, Ralf Baechle, iommu,
	Wuyun, linuxppc-dev, David S. Miller

On 2014/9/16 13:28, Michael Ellerman wrote:
> On Fri, 2014-09-05 at 18:10 +0800, Yijing Wang wrote:
>> Use MSI chip framework instead of arch MSI functions to configure
>> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> 
> This looks fine and seems to boot OK.
> 
> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)

Thanks very much!

> 
> cheers
> 
> 
> 
> .
> 


-- 
Thanks!
Yijing


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

* Re: [PATCH v1 03/21] MSI: Remove the redundant irq_set_chip_data()
  2014-09-16  1:30     ` Yijing Wang
@ 2014-09-16 10:29       ` Lucas Stach
  2014-09-16 10:37         ` Yijing Wang
  0 siblings, 1 reply; 52+ messages in thread
From: Lucas Stach @ 2014-09-16 10:29 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Bjorn Helgaas, Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel,
	Russell King, linux-arch, arnab.basu, Bharat.Bhushan, x86,
	Arnd Bergmann, Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel,
	Joerg Roedel, iommu, linux-mips, Benjamin Herrenschmidt,
	linuxppc-dev, linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle

Am Dienstag, den 16.09.2014, 09:30 +0800 schrieb Yijing Wang:
> On 2014/9/15 22:00, Lucas Stach wrote:
> > Am Freitag, den 05.09.2014, 18:09 +0800 schrieb Yijing Wang:
> >> Currently, pcie-designware, pcie-rcar, pci-tegra drivers
> >> use irq chip_data to save the msi_chip pointer. They
> >> already call irq_set_chip_data() in their own MSI irq map
> >> functions. So irq_set_chip_data() in arch_setup_msi_irq()
> >> is useless.
> >>
> >> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> >> ---
> >>  drivers/pci/msi.c |    2 --
> >>  1 files changed, 0 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> >> index f6cb317..d547f7f 100644
> >> --- a/drivers/pci/msi.c
> >> +++ b/drivers/pci/msi.c
> >> @@ -41,8 +41,6 @@ int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
> >>  	if (err < 0)
> >>  		return err;
> >>  
> >> -	irq_set_chip_data(desc->irq, chip);
> >> -
> >>  	return 0;
> >>  }
> >>  
> > 
> > arch_teardown_msi_irq() expects to find the msi_chip in the irq
> > chip_data field. As this means drivers don't have any reasonable other
> > possibility to stuff things into this field, I think it would make sense
> > to do the cleanup the other way around: keep the irq_set_chip_data
> > arch_setup_msi_irq() and rip it out of the individual drivers.
> 
> Hi Lucas, thanks for your review and comments!
> irq_set_chip_data() should not be placed in MSI core functions, because other arch like x86,
> use irq_data->chip_data to stores irq_cfg. So how to set the chip_data is arch dependent.
> And this series is mainly to use MSI chip framework in all platforms.
> Currently, only ARM platform MSI drivers use the chip_data to store msi_chip, and the drivers call
> irq_set_chip_data() in their driver already. So I thought we should clean up it in MSI core code.
> 
Okay I see your point, so the cleanup done this way is okay.

But then this still introduces a problem: arch_teardown_msi_irq()
expects to find the msi_chip in the chip_data field, which is okay for
all ARM PCI host drivers, but not for other arch MSI chips.

You fix this by completely removing arch_teardown_msi_irq() at the end
of the series, but this still has the potential to introduce issues for
other arches than ARM within the series. So this patch should include a
change to replace the line

struct msi_chip *chip = irq_get_chip_data(irq);

with something that doesn't rely on the msi_chip being in the irq
chip_data field.

Regards,
Lucas

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |


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

* Re: [PATCH v1 03/21] MSI: Remove the redundant irq_set_chip_data()
  2014-09-16 10:29       ` Lucas Stach
@ 2014-09-16 10:37         ` Yijing Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-16 10:37 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Bjorn Helgaas, Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel,
	Russell King, linux-arch, arnab.basu, Bharat.Bhushan, x86,
	Arnd Bergmann, Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel,
	Joerg Roedel, iommu, linux-mips, Benjamin Herrenschmidt,
	linuxppc-dev, linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle

>>> arch_teardown_msi_irq() expects to find the msi_chip in the irq
>>> chip_data field. As this means drivers don't have any reasonable other
>>> possibility to stuff things into this field, I think it would make sense
>>> to do the cleanup the other way around: keep the irq_set_chip_data
>>> arch_setup_msi_irq() and rip it out of the individual drivers.
>>
>> Hi Lucas, thanks for your review and comments!
>> irq_set_chip_data() should not be placed in MSI core functions, because other arch like x86,
>> use irq_data->chip_data to stores irq_cfg. So how to set the chip_data is arch dependent.
>> And this series is mainly to use MSI chip framework in all platforms.
>> Currently, only ARM platform MSI drivers use the chip_data to store msi_chip, and the drivers call
>> irq_set_chip_data() in their driver already. So I thought we should clean up it in MSI core code.
>>
> Okay I see your point, so the cleanup done this way is okay.
> 
> But then this still introduces a problem: arch_teardown_msi_irq()
> expects to find the msi_chip in the chip_data field, which is okay for
> all ARM PCI host drivers, but not for other arch MSI chips.
> 
> You fix this by completely removing arch_teardown_msi_irq() at the end
> of the series, but this still has the potential to introduce issues for
> other arches than ARM within the series. So this patch should include a
> change to replace the line
> 
> struct msi_chip *chip = irq_get_chip_data(irq);
> 
> with something that doesn't rely on the msi_chip being in the irq
> chip_data field.

OK, I will update arch_teardown_msi_irq() in this patch, thanks!

Thanks!
Yijing.

> 
> Regards,
> Lucas
> 


-- 
Thanks!
Yijing


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

* Re: [PATCH v1 16/21] s390/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-05 10:10 ` [PATCH v1 16/21] s390/MSI: " Yijing Wang
@ 2014-09-16 11:35   ` Sebastian Ott
  2014-09-17  1:24     ` Yijing Wang
  0 siblings, 1 reply; 52+ messages in thread
From: Sebastian Ott @ 2014-09-16 11:35 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Bjorn Helgaas, Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel,
	Russell King, linux-arch, arnab.basu, Bharat.Bhushan, x86,
	Arnd Bergmann, Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel,
	Joerg Roedel, iommu, linux-mips, Benjamin Herrenschmidt,
	linuxppc-dev, linux-s390, Tony Luck, linux-ia64, David S. Miller,
	sparclinux, Chris Metcalf, Ralf Baechle

Hello,

On Fri, 5 Sep 2014, Yijing Wang wrote:
> Use MSI chip framework instead of arch MSI functions to configure
> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> ---
>  arch/s390/pci/pci.c |   18 ++++++++++++++----
>  1 files changed, 14 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
> index 2fa7b14..da5316e 100644
> --- a/arch/s390/pci/pci.c
> +++ b/arch/s390/pci/pci.c
> @@ -358,7 +358,7 @@ static void zpci_irq_handler(struct airq_struct *airq)
>  	}
>  }
> 
> -int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
> +int zpci_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
>  {
>  	struct zpci_dev *zdev = get_zdev(pdev);
>  	unsigned int hwirq, msi_vecs;
> @@ -434,7 +434,7 @@ out:
>  	return rc;
>  }
> 
> -void arch_teardown_msi_irqs(struct pci_dev *pdev)
> +static void zpci_teardown_msi_irqs(struct pci_dev *pdev)
>  {
>  	struct zpci_dev *zdev = get_zdev(pdev);
>  	struct msi_desc *msi;
> @@ -448,9 +448,9 @@ void arch_teardown_msi_irqs(struct pci_dev *pdev)
>  	/* Release MSI interrupts */
>  	list_for_each_entry(msi, &pdev->msi_list, list) {
>  		if (msi->msi_attrib.is_msix)
> -			default_msix_mask_irq(msi, 1);
> +			__msix_mask_irq(msi, 1);
>  		else
> -			default_msi_mask_irq(msi, 1, 1);
> +			__msi_mask_irq(msi, 1, 1);

The default_msi_mask_irq to __msi_mask_irq renaming is hidden in your
patch "x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq()"

This means that between that patch and this one s390 will not compile.
Could you please move this hunk to the other patch or even make an extra
patch with the renaming. Other than that:

Acked-by: Sebastian Ott <sebott@linux.vnet.ibm.com>

Regards,
Sebastian

>  		irq_set_msi_desc(msi->irq, NULL);
>  		irq_free_desc(msi->irq);
>  		msi->msg.address_lo = 0;
> @@ -464,6 +464,16 @@ void arch_teardown_msi_irqs(struct pci_dev *pdev)
>  	airq_iv_free_bit(zpci_aisb_iv, zdev->aisb);
>  }
> 
> +static struct msi_chip zpci_msi_chip = {
> +	.setup_irqs = zpci_setup_msi_irqs,
> +	.teardown_irqs = zpci_teardown_msi_irqs,
> +};
> +
> +struct msi_chip *arch_find_msi_chip(struct pci_dev *dev)
> +{
> +	return &zpci_msi_chip;
> +}
> +
>  static void zpci_map_resources(struct zpci_dev *zdev)
>  {
>  	struct pci_dev *pdev = zdev->pdev;
> -- 
> 1.7.1
> 
> 


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

* Re: [PATCH v1 16/21] s390/MSI: Use MSI chip framework to configure MSI/MSI-X irq
  2014-09-16 11:35   ` Sebastian Ott
@ 2014-09-17  1:24     ` Yijing Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-17  1:24 UTC (permalink / raw)
  To: Sebastian Ott
  Cc: Bjorn Helgaas, Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel,
	Russell King, linux-arch, arnab.basu, Bharat.Bhushan, x86,
	Arnd Bergmann, Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel,
	Joerg Roedel, iommu, linux-mips, Benjamin Herrenschmidt,
	linuxppc-dev, linux-s390, Tony Luck, linux-ia64, David S. Miller,
	sparclinux, Chris Metcalf, Ralf Baechle

On 2014/9/16 19:35, Sebastian Ott wrote:
> Hello,
> 
> On Fri, 5 Sep 2014, Yijing Wang wrote:
>> Use MSI chip framework instead of arch MSI functions to configure
>> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
>> ---
>>  arch/s390/pci/pci.c |   18 ++++++++++++++----
>>  1 files changed, 14 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
>> index 2fa7b14..da5316e 100644
>> --- a/arch/s390/pci/pci.c
>> +++ b/arch/s390/pci/pci.c
>> @@ -358,7 +358,7 @@ static void zpci_irq_handler(struct airq_struct *airq)
>>  	}
>>  }
>>
>> -int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
>> +int zpci_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
>>  {
>>  	struct zpci_dev *zdev = get_zdev(pdev);
>>  	unsigned int hwirq, msi_vecs;
>> @@ -434,7 +434,7 @@ out:
>>  	return rc;
>>  }
>>
>> -void arch_teardown_msi_irqs(struct pci_dev *pdev)
>> +static void zpci_teardown_msi_irqs(struct pci_dev *pdev)
>>  {
>>  	struct zpci_dev *zdev = get_zdev(pdev);
>>  	struct msi_desc *msi;
>> @@ -448,9 +448,9 @@ void arch_teardown_msi_irqs(struct pci_dev *pdev)
>>  	/* Release MSI interrupts */
>>  	list_for_each_entry(msi, &pdev->msi_list, list) {
>>  		if (msi->msi_attrib.is_msix)
>> -			default_msix_mask_irq(msi, 1);
>> +			__msix_mask_irq(msi, 1);
>>  		else
>> -			default_msi_mask_irq(msi, 1, 1);
>> +			__msi_mask_irq(msi, 1, 1);
> 
> The default_msi_mask_irq to __msi_mask_irq renaming is hidden in your
> patch "x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq()"
> 
> This means that between that patch and this one s390 will not compile.
> Could you please move this hunk to the other patch or even make an extra
> patch with the renaming. Other than that:

Good catch. I will move this hunk into the patch "x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq()".

> 
> Acked-by: Sebastian Ott <sebott@linux.vnet.ibm.com>


Thanks!
Yijing.


> 
> Regards,
> Sebastian
> 
>>  		irq_set_msi_desc(msi->irq, NULL);
>>  		irq_free_desc(msi->irq);
>>  		msi->msg.address_lo = 0;
>> @@ -464,6 +464,16 @@ void arch_teardown_msi_irqs(struct pci_dev *pdev)
>>  	airq_iv_free_bit(zpci_aisb_iv, zdev->aisb);
>>  }
>>
>> +static struct msi_chip zpci_msi_chip = {
>> +	.setup_irqs = zpci_setup_msi_irqs,
>> +	.teardown_irqs = zpci_teardown_msi_irqs,
>> +};
>> +
>> +struct msi_chip *arch_find_msi_chip(struct pci_dev *dev)
>> +{
>> +	return &zpci_msi_chip;
>> +}
>> +
>>  static void zpci_map_resources(struct zpci_dev *zdev)
>>  {
>>  	struct pci_dev *pdev = zdev->pdev;
>> -- 
>> 1.7.1
>>
>>
> 
> 
> .
> 


-- 
Thanks!
Yijing


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

* Re: [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms
  2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
                   ` (20 preceding siblings ...)
  2014-09-05 10:10 ` [PATCH v1 21/21] PCI/MSI: Clean up unused MSI arch functions Yijing Wang
@ 2014-09-23 21:09 ` Bjorn Helgaas
  2014-09-24  3:52   ` Yijing Wang
  21 siblings, 1 reply; 52+ messages in thread
From: Bjorn Helgaas @ 2014-09-23 21:09 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle

On Fri, Sep 05, 2014 at 06:09:45PM +0800, Yijing Wang wrote:
> This series is based Bjorn's pci-next branch + Alexander Gordeev's two patches
> "Remove arch_msi_check_device()" link: https://lkml.org/lkml/2014/7/12/41
> 
> Currently, there are a lot of weak arch functions in MSI code.
> Thierry Reding Introduced MSI chip framework to configure MSI/MSI-X in arm.
> This series use MSI chip framework to refactor MSI code across all platforms
> to eliminate weak arch functions. It has been tested fine in x86(with or without
> irq remap).

I see you plan some updates, so I'll look for a v2 posting after v3.17 releases.
It will be great to get rid of some of those weak functions!

Bjorn

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

* Re: [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms
  2014-09-23 21:09 ` [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Bjorn Helgaas
@ 2014-09-24  3:52   ` Yijing Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Yijing Wang @ 2014-09-24  3:52 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Xinwei Hu, Wuyun, linux-pci, linux-arm-kernel, Russell King,
	linux-arch, arnab.basu, Bharat.Bhushan, x86, Arnd Bergmann,
	Thomas Gleixner, Konrad Rzeszutek Wilk, xen-devel, Joerg Roedel,
	iommu, linux-mips, Benjamin Herrenschmidt, linuxppc-dev,
	linux-s390, Sebastian Ott, Tony Luck, linux-ia64,
	David S. Miller, sparclinux, Chris Metcalf, Ralf Baechle

On 2014/9/24 5:09, Bjorn Helgaas wrote:
> On Fri, Sep 05, 2014 at 06:09:45PM +0800, Yijing Wang wrote:
>> This series is based Bjorn's pci-next branch + Alexander Gordeev's two patches
>> "Remove arch_msi_check_device()" link: https://lkml.org/lkml/2014/7/12/41
>>
>> Currently, there are a lot of weak arch functions in MSI code.
>> Thierry Reding Introduced MSI chip framework to configure MSI/MSI-X in arm.
>> This series use MSI chip framework to refactor MSI code across all platforms
>> to eliminate weak arch functions. It has been tested fine in x86(with or without
>> irq remap).
> 
> I see you plan some updates, so I'll look for a v2 posting after v3.17 releases.
> It will be great to get rid of some of those weak functions!

Thanks, I will send out the new version soon.

Thanks!
Yijing.

> 
> Bjorn
> 
> .
> 


-- 
Thanks!
Yijing


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

end of thread, other threads:[~2014-09-24  3:52 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-05 10:09 [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Yijing Wang
2014-09-05 10:09 ` [PATCH v1 01/21] PCI/MSI: Clean up struct msi_chip argument Yijing Wang
2014-09-05 10:09 ` [PATCH v1 02/21] PCI/MSI: Remove useless bus->msi assignment Yijing Wang
2014-09-05 10:09 ` [PATCH v1 03/21] MSI: Remove the redundant irq_set_chip_data() Yijing Wang
2014-09-15 14:00   ` Lucas Stach
2014-09-16  1:30     ` Yijing Wang
2014-09-16 10:29       ` Lucas Stach
2014-09-16 10:37         ` Yijing Wang
2014-09-05 10:09 ` [PATCH v1 04/21] x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq() Yijing Wang
2014-09-10 12:36   ` [Xen-devel] " David Vrabel
2014-09-11  1:22     ` Yijing Wang
2014-09-11 13:08       ` David Vrabel
2014-09-05 10:09 ` [PATCH v1 05/21] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip Yijing Wang
2014-09-15 14:42   ` Lucas Stach
2014-09-16  2:08     ` Yijing Wang
2014-09-05 10:09 ` [PATCH v1 06/21] PCI/MSI: Refactor struct msi_chip to make it become more common Yijing Wang
2014-09-15 14:44   ` Lucas Stach
2014-09-16  2:09     ` Yijing Wang
2014-09-05 10:09 ` [PATCH v1 07/21] x86/MSI: Use MSI chip framework to configure MSI/MSI-X irq Yijing Wang
2014-09-05 10:09 ` [PATCH v1 08/21] x86/xen/MSI: " Yijing Wang
2014-09-05 14:29   ` [Xen-devel] " David Vrabel
2014-09-09  2:06     ` Yijing Wang
2014-09-10 12:38       ` David Vrabel
2014-09-10 14:59         ` Konrad Rzeszutek Wilk
2014-09-11  1:28           ` Yijing Wang
2014-09-11  1:27         ` Yijing Wang
2014-09-05 10:09 ` [PATCH v1 09/21] Irq_remapping/MSI: " Yijing Wang
2014-09-05 10:42   ` Sergei Shtylyov
2014-09-05 11:30     ` wangyijing
2014-09-05 10:09 ` [PATCH v1 10/21] x86/MSI: Remove unused MSI weak arch functions Yijing Wang
2014-09-05 10:09 ` [PATCH v1 11/21] MIPS/Octeon/MSI: Use MSI chip framework to configure MSI/MSI-X irq Yijing Wang
2014-09-05 10:09 ` [PATCH v1 12/21] MIPS/Xlp: Remove the dead function destroy_irq() to fix build error Yijing Wang
2014-09-05 10:09 ` [PATCH v1 13/21] MIPS/Xlp/MSI: Use MSI chip framework to configure MSI/MSI-X irq Yijing Wang
2014-09-05 10:09 ` [PATCH v1 14/21] MIPS/Xlr/MSI: " Yijing Wang
2014-09-05 10:10 ` [PATCH v1 15/21] Powerpc/MSI: " Yijing Wang
2014-09-05 10:47   ` Sergei Shtylyov
2014-09-05 11:33     ` wangyijing
2014-09-05 11:41       ` Sergei Shtylyov
2014-09-16  5:28   ` Michael Ellerman
2014-09-16  5:40     ` Yijing Wang
2014-09-05 10:10 ` [PATCH v1 16/21] s390/MSI: " Yijing Wang
2014-09-16 11:35   ` Sebastian Ott
2014-09-17  1:24     ` Yijing Wang
2014-09-05 10:10 ` [PATCH v1 17/21] arm/iop13xx/MSI: " Yijing Wang
2014-09-05 10:10 ` [PATCH v1 18/21] IA64/MSI: " Yijing Wang
2014-09-05 10:10 ` [PATCH v1 19/21] Sparc/MSI: " Yijing Wang
2014-09-05 10:10 ` [PATCH v1 20/21] tile/MSI: " Yijing Wang
2014-09-05 10:10 ` [PATCH v1 21/21] PCI/MSI: Clean up unused MSI arch functions Yijing Wang
2014-09-15 14:47   ` Lucas Stach
2014-09-16  2:09     ` Yijing Wang
2014-09-23 21:09 ` [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms Bjorn Helgaas
2014-09-24  3:52   ` Yijing Wang

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