All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/pasemi: Only the build the pasemi MSI code for PASEMI=y
@ 2015-04-10  1:52 Michael Ellerman
  2015-04-10  4:24 ` Stephen Rothwell
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2015-04-10  1:52 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Olof Johannsson

The pasemi MSI code is currently always built when MPIC=y && PCI_MSI=y.
It should not have any effect on other platforms, because it immediately
checks the MPIC's compatible property for "pasemi,pwrficient-openpic".

However it's odd that it's still built even when PASEMI=n. It also
needn't be in sysdev, as it's only used by pasemi. So move it into
platforms/pasemi, whereby it will only be built for PASEMI=y.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/platforms/pasemi/Makefile |   1 +
 arch/powerpc/platforms/pasemi/msi.c    | 165 ++++++++++++++++++++++++++++++++
 arch/powerpc/sysdev/Makefile           |   2 +-
 arch/powerpc/sysdev/mpic.h             |  10 +-
 arch/powerpc/sysdev/mpic_pasemi_msi.c  | 167 ---------------------------------
 5 files changed, 172 insertions(+), 173 deletions(-)
 create mode 100644 arch/powerpc/platforms/pasemi/msi.c
 delete mode 100644 arch/powerpc/sysdev/mpic_pasemi_msi.c

diff --git a/arch/powerpc/platforms/pasemi/Makefile b/arch/powerpc/platforms/pasemi/Makefile
index 8e8d4cae5ebe..60b4e0fd9808 100644
--- a/arch/powerpc/platforms/pasemi/Makefile
+++ b/arch/powerpc/platforms/pasemi/Makefile
@@ -1,2 +1,3 @@
 obj-y	+= setup.o pci.o time.o idle.o powersave.o iommu.o dma_lib.o misc.o
 obj-$(CONFIG_PPC_PASEMI_MDIO)	+= gpio_mdio.o
+obj-$(CONFIG_PCI_MSI)		+= msi.o
diff --git a/arch/powerpc/platforms/pasemi/msi.c b/arch/powerpc/platforms/pasemi/msi.c
new file mode 100644
index 000000000000..0b3706604543
--- /dev/null
+++ b/arch/powerpc/platforms/pasemi/msi.c
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2007, Olof Johansson, PA Semi
+ *
+ * Based on arch/powerpc/sysdev/mpic_u3msi.c:
+ *
+ * Copyright 2006, Segher Boessenkool, IBM Corporation.
+ * Copyright 2006-2007, Michael Ellerman, IBM Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; version 2 of the
+ * License.
+ *
+ */
+
+#include <linux/irq.h>
+#include <linux/msi.h>
+#include <asm/mpic.h>
+#include <asm/prom.h>
+#include <asm/hw_irq.h>
+#include <asm/ppc-pci.h>
+#include <asm/msi_bitmap.h>
+
+#include <sysdev/mpic.h>
+
+/* Allocate 16 interrupts per device, to give an alignment of 16,
+ * since that's the size of the grouping w.r.t. affinity. If someone
+ * needs more than 32 MSI's down the road we'll have to rethink this,
+ * but it should be OK for now.
+ */
+#define ALLOC_CHUNK 16
+
+#define PASEMI_MSI_ADDR 0xfc080000
+
+/* A bit ugly, can we get this from the pci_dev somehow? */
+static struct mpic *msi_mpic;
+
+
+static void mpic_pasemi_msi_mask_irq(struct irq_data *data)
+{
+	pr_debug("mpic_pasemi_msi_mask_irq %d\n", data->irq);
+	pci_msi_mask_irq(data);
+	mpic_mask_irq(data);
+}
+
+static void mpic_pasemi_msi_unmask_irq(struct irq_data *data)
+{
+	pr_debug("mpic_pasemi_msi_unmask_irq %d\n", data->irq);
+	mpic_unmask_irq(data);
+	pci_msi_unmask_irq(data);
+}
+
+static struct irq_chip mpic_pasemi_msi_chip = {
+	.irq_shutdown		= mpic_pasemi_msi_mask_irq,
+	.irq_mask		= mpic_pasemi_msi_mask_irq,
+	.irq_unmask		= mpic_pasemi_msi_unmask_irq,
+	.irq_eoi		= mpic_end_irq,
+	.irq_set_type		= mpic_set_irq_type,
+	.irq_set_affinity	= mpic_set_affinity,
+	.name			= "PASEMI-MSI",
+};
+
+static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev)
+{
+	struct msi_desc *entry;
+
+	pr_debug("pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev);
+
+	list_for_each_entry(entry, &pdev->msi_list, list) {
+		if (entry->irq == NO_IRQ)
+			continue;
+
+		irq_set_msi_desc(entry->irq, NULL);
+		msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap,
+				       virq_to_hw(entry->irq), ALLOC_CHUNK);
+		irq_dispose_mapping(entry->irq);
+	}
+
+	return;
+}
+
+static int pasemi_msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
+{
+	unsigned int virq;
+	struct msi_desc *entry;
+	struct msi_msg msg;
+	int hwirq;
+
+	if (type == PCI_CAP_ID_MSIX)
+		pr_debug("pasemi_msi: MSI-X untested, trying anyway\n");
+	pr_debug("pasemi_msi_setup_msi_irqs, pdev %p nvec %d type %d\n",
+		 pdev, nvec, type);
+
+	msg.address_hi = 0;
+	msg.address_lo = PASEMI_MSI_ADDR;
+
+	list_for_each_entry(entry, &pdev->msi_list, list) {
+		/* Allocate 16 interrupts for now, since that's the grouping for
+		 * affinity. This can be changed later if it turns out 32 is too
+		 * few MSIs for someone, but restrictions will apply to how the
+		 * sources can be changed independently.
+		 */
+		hwirq = msi_bitmap_alloc_hwirqs(&msi_mpic->msi_bitmap,
+						ALLOC_CHUNK);
+		if (hwirq < 0) {
+			pr_debug("pasemi_msi: failed allocating hwirq\n");
+			return hwirq;
+		}
+
+		virq = irq_create_mapping(msi_mpic->irqhost, hwirq);
+		if (virq == NO_IRQ) {
+			pr_debug("pasemi_msi: failed mapping hwirq 0x%x\n",
+				  hwirq);
+			msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq,
+					       ALLOC_CHUNK);
+			return -ENOSPC;
+		}
+
+		/* Vector on MSI is really an offset, the hardware adds
+		 * it to the value written at the magic address. So set
+		 * it to 0 to remain sane.
+		 */
+		mpic_set_vector(virq, 0);
+
+		irq_set_msi_desc(virq, entry);
+		irq_set_chip(virq, &mpic_pasemi_msi_chip);
+		irq_set_irq_type(virq, IRQ_TYPE_EDGE_RISING);
+
+		pr_debug("pasemi_msi: allocated virq 0x%x (hw 0x%x) " \
+			 "addr 0x%x\n", virq, hwirq, msg.address_lo);
+
+		/* Likewise, the device writes [0...511] into the target
+		 * register to generate MSI [512...1023]
+		 */
+		msg.data = hwirq-0x200;
+		pci_write_msi_msg(virq, &msg);
+	}
+
+	return 0;
+}
+
+int mpic_pasemi_msi_init(struct mpic *mpic)
+{
+	int rc;
+
+	if (!mpic->irqhost->of_node ||
+	    !of_device_is_compatible(mpic->irqhost->of_node,
+				     "pasemi,pwrficient-openpic"))
+		return -ENODEV;
+
+	rc = mpic_msi_init_allocator(mpic);
+	if (rc) {
+		pr_debug("pasemi_msi: Error allocating bitmap!\n");
+		return rc;
+	}
+
+	pr_debug("pasemi_msi: Registering PA Semi MPIC MSI callbacks\n");
+
+	msi_mpic = mpic;
+	WARN_ON(ppc_md.setup_msi_irqs);
+	ppc_md.setup_msi_irqs = pasemi_msi_setup_msi_irqs;
+	ppc_md.teardown_msi_irqs = pasemi_msi_teardown_msi_irqs;
+
+	return 0;
+}
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index f7cb2a1b01fa..5b492a6438ff 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -2,7 +2,7 @@ subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
 
 ccflags-$(CONFIG_PPC64)		:= $(NO_MINIMAL_TOC)
 
-mpic-msi-obj-$(CONFIG_PCI_MSI)	+= mpic_msi.o mpic_u3msi.o mpic_pasemi_msi.o
+mpic-msi-obj-$(CONFIG_PCI_MSI)	+= mpic_msi.o mpic_u3msi.o
 obj-$(CONFIG_MPIC)		+= mpic.o $(mpic-msi-obj-y)
 obj-$(CONFIG_MPIC_TIMER)        += mpic_timer.o
 obj-$(CONFIG_FSL_MPIC_TIMER_WAKEUP)	+= fsl_mpic_timer_wakeup.o
diff --git a/arch/powerpc/sysdev/mpic.h b/arch/powerpc/sysdev/mpic.h
index 24bf07a63924..32971a41853b 100644
--- a/arch/powerpc/sysdev/mpic.h
+++ b/arch/powerpc/sysdev/mpic.h
@@ -15,7 +15,6 @@
 extern void mpic_msi_reserve_hwirq(struct mpic *mpic, irq_hw_number_t hwirq);
 extern int mpic_msi_init_allocator(struct mpic *mpic);
 extern int mpic_u3msi_init(struct mpic *mpic);
-extern int mpic_pasemi_msi_init(struct mpic *mpic);
 #else
 static inline void mpic_msi_reserve_hwirq(struct mpic *mpic,
 					  irq_hw_number_t hwirq)
@@ -27,11 +26,12 @@ static inline int mpic_u3msi_init(struct mpic *mpic)
 {
 	return -1;
 }
+#endif
 
-static inline int mpic_pasemi_msi_init(struct mpic *mpic)
-{
-	return -1;
-}
+#if defined(CONFIG_PCI_MSI) && defined(CONFIG_PPC_PASEMI)
+int mpic_pasemi_msi_init(struct mpic *mpic);
+#else
+static inline int mpic_pasemi_msi_init(struct mpic *mpic) { return -1; }
 #endif
 
 extern int mpic_set_irq_type(struct irq_data *d, unsigned int flow_type);
diff --git a/arch/powerpc/sysdev/mpic_pasemi_msi.c b/arch/powerpc/sysdev/mpic_pasemi_msi.c
deleted file mode 100644
index a3f660eed6de..000000000000
--- a/arch/powerpc/sysdev/mpic_pasemi_msi.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright 2007, Olof Johansson, PA Semi
- *
- * Based on arch/powerpc/sysdev/mpic_u3msi.c:
- *
- * Copyright 2006, Segher Boessenkool, IBM Corporation.
- * Copyright 2006-2007, Michael Ellerman, IBM Corporation.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; version 2 of the
- * License.
- *
- */
-
-#undef DEBUG
-
-#include <linux/irq.h>
-#include <linux/msi.h>
-#include <asm/mpic.h>
-#include <asm/prom.h>
-#include <asm/hw_irq.h>
-#include <asm/ppc-pci.h>
-#include <asm/msi_bitmap.h>
-
-#include "mpic.h"
-
-/* Allocate 16 interrupts per device, to give an alignment of 16,
- * since that's the size of the grouping w.r.t. affinity. If someone
- * needs more than 32 MSI's down the road we'll have to rethink this,
- * but it should be OK for now.
- */
-#define ALLOC_CHUNK 16
-
-#define PASEMI_MSI_ADDR 0xfc080000
-
-/* A bit ugly, can we get this from the pci_dev somehow? */
-static struct mpic *msi_mpic;
-
-
-static void mpic_pasemi_msi_mask_irq(struct irq_data *data)
-{
-	pr_debug("mpic_pasemi_msi_mask_irq %d\n", data->irq);
-	pci_msi_mask_irq(data);
-	mpic_mask_irq(data);
-}
-
-static void mpic_pasemi_msi_unmask_irq(struct irq_data *data)
-{
-	pr_debug("mpic_pasemi_msi_unmask_irq %d\n", data->irq);
-	mpic_unmask_irq(data);
-	pci_msi_unmask_irq(data);
-}
-
-static struct irq_chip mpic_pasemi_msi_chip = {
-	.irq_shutdown		= mpic_pasemi_msi_mask_irq,
-	.irq_mask		= mpic_pasemi_msi_mask_irq,
-	.irq_unmask		= mpic_pasemi_msi_unmask_irq,
-	.irq_eoi		= mpic_end_irq,
-	.irq_set_type		= mpic_set_irq_type,
-	.irq_set_affinity	= mpic_set_affinity,
-	.name			= "PASEMI-MSI",
-};
-
-static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev)
-{
-	struct msi_desc *entry;
-
-	pr_debug("pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev);
-
-	list_for_each_entry(entry, &pdev->msi_list, list) {
-		if (entry->irq == NO_IRQ)
-			continue;
-
-		irq_set_msi_desc(entry->irq, NULL);
-		msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap,
-				       virq_to_hw(entry->irq), ALLOC_CHUNK);
-		irq_dispose_mapping(entry->irq);
-	}
-
-	return;
-}
-
-static int pasemi_msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
-{
-	unsigned int virq;
-	struct msi_desc *entry;
-	struct msi_msg msg;
-	int hwirq;
-
-	if (type == PCI_CAP_ID_MSIX)
-		pr_debug("pasemi_msi: MSI-X untested, trying anyway\n");
-	pr_debug("pasemi_msi_setup_msi_irqs, pdev %p nvec %d type %d\n",
-		 pdev, nvec, type);
-
-	msg.address_hi = 0;
-	msg.address_lo = PASEMI_MSI_ADDR;
-
-	list_for_each_entry(entry, &pdev->msi_list, list) {
-		/* Allocate 16 interrupts for now, since that's the grouping for
-		 * affinity. This can be changed later if it turns out 32 is too
-		 * few MSIs for someone, but restrictions will apply to how the
-		 * sources can be changed independently.
-		 */
-		hwirq = msi_bitmap_alloc_hwirqs(&msi_mpic->msi_bitmap,
-						ALLOC_CHUNK);
-		if (hwirq < 0) {
-			pr_debug("pasemi_msi: failed allocating hwirq\n");
-			return hwirq;
-		}
-
-		virq = irq_create_mapping(msi_mpic->irqhost, hwirq);
-		if (virq == NO_IRQ) {
-			pr_debug("pasemi_msi: failed mapping hwirq 0x%x\n",
-				  hwirq);
-			msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq,
-					       ALLOC_CHUNK);
-			return -ENOSPC;
-		}
-
-		/* Vector on MSI is really an offset, the hardware adds
-		 * it to the value written at the magic address. So set
-		 * it to 0 to remain sane.
-		 */
-		mpic_set_vector(virq, 0);
-
-		irq_set_msi_desc(virq, entry);
-		irq_set_chip(virq, &mpic_pasemi_msi_chip);
-		irq_set_irq_type(virq, IRQ_TYPE_EDGE_RISING);
-
-		pr_debug("pasemi_msi: allocated virq 0x%x (hw 0x%x) " \
-			 "addr 0x%x\n", virq, hwirq, msg.address_lo);
-
-		/* Likewise, the device writes [0...511] into the target
-		 * register to generate MSI [512...1023]
-		 */
-		msg.data = hwirq-0x200;
-		pci_write_msi_msg(virq, &msg);
-	}
-
-	return 0;
-}
-
-int mpic_pasemi_msi_init(struct mpic *mpic)
-{
-	int rc;
-
-	if (!mpic->irqhost->of_node ||
-	    !of_device_is_compatible(mpic->irqhost->of_node,
-				     "pasemi,pwrficient-openpic"))
-		return -ENODEV;
-
-	rc = mpic_msi_init_allocator(mpic);
-	if (rc) {
-		pr_debug("pasemi_msi: Error allocating bitmap!\n");
-		return rc;
-	}
-
-	pr_debug("pasemi_msi: Registering PA Semi MPIC MSI callbacks\n");
-
-	msi_mpic = mpic;
-	WARN_ON(ppc_md.setup_msi_irqs);
-	ppc_md.setup_msi_irqs = pasemi_msi_setup_msi_irqs;
-	ppc_md.teardown_msi_irqs = pasemi_msi_teardown_msi_irqs;
-
-	return 0;
-}
-- 
2.1.0

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

* Re: [PATCH] powerpc/pasemi: Only the build the pasemi MSI code for PASEMI=y
  2015-04-10  1:52 [PATCH] powerpc/pasemi: Only the build the pasemi MSI code for PASEMI=y Michael Ellerman
@ 2015-04-10  4:24 ` Stephen Rothwell
  2015-04-10  5:28   ` Michael Ellerman
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Rothwell @ 2015-04-10  4:24 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: Olof Johannsson, linuxppc-dev

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

Hi Michael,

On Fri, 10 Apr 2015 11:52:06 +1000 Michael Ellerman <mpe@ellerman.id.au> wrote:
>
>  arch/powerpc/platforms/pasemi/Makefile |   1 +
>  arch/powerpc/platforms/pasemi/msi.c    | 165 ++++++++++++++++++++++++++++++++
>  arch/powerpc/sysdev/Makefile           |   2 +-
>  arch/powerpc/sysdev/mpic.h             |  10 +-
>  arch/powerpc/sysdev/mpic_pasemi_msi.c  | 167 ---------------------------------
>  5 files changed, 172 insertions(+), 173 deletions(-)
>  create mode 100644 arch/powerpc/platforms/pasemi/msi.c
>  delete mode 100644 arch/powerpc/sysdev/mpic_pasemi_msi.c

What does this look like if you do "git diff --stat -M" and "git diff -M"?

This is very useful in cases where files are moved so that people can
see what changed when the file moved.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] powerpc/pasemi: Only the build the pasemi MSI code for PASEMI=y
  2015-04-10  4:24 ` Stephen Rothwell
@ 2015-04-10  5:28   ` Michael Ellerman
  2015-04-10  6:42     ` Stephen Rothwell
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2015-04-10  5:28 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Olof Johannsson, linuxppc-dev

On Fri, 2015-04-10 at 14:24 +1000, Stephen Rothwell wrote:
> Hi Michael,
> 
> On Fri, 10 Apr 2015 11:52:06 +1000 Michael Ellerman <mpe@ellerman.id.au> wrote:
> >
> >  arch/powerpc/platforms/pasemi/Makefile |   1 +
> >  arch/powerpc/platforms/pasemi/msi.c    | 165 ++++++++++++++++++++++++++++++++
> >  arch/powerpc/sysdev/Makefile           |   2 +-
> >  arch/powerpc/sysdev/mpic.h             |  10 +-
> >  arch/powerpc/sysdev/mpic_pasemi_msi.c  | 167 ---------------------------------
> >  5 files changed, 172 insertions(+), 173 deletions(-)
> >  create mode 100644 arch/powerpc/platforms/pasemi/msi.c
> >  delete mode 100644 arch/powerpc/sysdev/mpic_pasemi_msi.c
> 
> What does this look like if you do "git diff --stat -M" and "git diff -M"?
> 
> This is very useful in cases where files are moved so that people can
> see what changed when the file moved.

Like this?

$ git diff --stat -M HEAD^
 arch/powerpc/platforms/pasemi/Makefile                            |  1 +
 arch/powerpc/{sysdev/mpic_pasemi_msi.c => platforms/pasemi/msi.c} |  4 +---
 arch/powerpc/sysdev/Makefile                                      |  2 +-
 arch/powerpc/sysdev/mpic.h                                        | 10 +++++-----
 4 files changed, 8 insertions(+), 9 deletions(-)


diff --git a/arch/powerpc/platforms/pasemi/Makefile b/arch/powerpc/platforms/pasemi/Makefile
index 8e8d4cae5ebe..60b4e0fd9808 100644
--- a/arch/powerpc/platforms/pasemi/Makefile
+++ b/arch/powerpc/platforms/pasemi/Makefile
@@ -1,2 +1,3 @@
 obj-y  += setup.o pci.o time.o idle.o powersave.o iommu.o dma_lib.o misc.o
 obj-$(CONFIG_PPC_PASEMI_MDIO)  += gpio_mdio.o
+obj-$(CONFIG_PCI_MSI)          += msi.o
diff --git a/arch/powerpc/sysdev/mpic_pasemi_msi.c b/arch/powerpc/platforms/pasemi/msi.c
similarity index 99%
rename from arch/powerpc/sysdev/mpic_pasemi_msi.c
rename to arch/powerpc/platforms/pasemi/msi.c
index a3f660eed6de..0b3706604543 100644
--- a/arch/powerpc/sysdev/mpic_pasemi_msi.c
+++ b/arch/powerpc/platforms/pasemi/msi.c
@@ -13,8 +13,6 @@
  *
  */
 
-#undef DEBUG
-
 #include <linux/irq.h>
 #include <linux/msi.h>
 #include <asm/mpic.h>
@@ -23,7 +21,7 @@
 #include <asm/ppc-pci.h>
 #include <asm/msi_bitmap.h>
 
-#include "mpic.h"
+#include <sysdev/mpic.h>
 
 /* Allocate 16 interrupts per device, to give an alignment of 16,
  * since that's the size of the grouping w.r.t. affinity. If someone
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index f7cb2a1b01fa..5b492a6438ff 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -2,7 +2,7 @@ subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
 
 ccflags-$(CONFIG_PPC64)                := $(NO_MINIMAL_TOC)
 
-mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o mpic_pasemi_msi.o
+mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o
 obj-$(CONFIG_MPIC)             += mpic.o $(mpic-msi-obj-y)
 obj-$(CONFIG_MPIC_TIMER)        += mpic_timer.o
 obj-$(CONFIG_FSL_MPIC_TIMER_WAKEUP)    += fsl_mpic_timer_wakeup.o
diff --git a/arch/powerpc/sysdev/mpic.h b/arch/powerpc/sysdev/mpic.h
index 24bf07a63924..32971a41853b 100644
--- a/arch/powerpc/sysdev/mpic.h
+++ b/arch/powerpc/sysdev/mpic.h
@@ -15,7 +15,6 @@
 extern void mpic_msi_reserve_hwirq(struct mpic *mpic, irq_hw_number_t hwirq);
 extern int mpic_msi_init_allocator(struct mpic *mpic);
 extern int mpic_u3msi_init(struct mpic *mpic);
-extern int mpic_pasemi_msi_init(struct mpic *mpic);
 #else
 static inline void mpic_msi_reserve_hwirq(struct mpic *mpic,
                                          irq_hw_number_t hwirq)
@@ -27,11 +26,12 @@ static inline int mpic_u3msi_init(struct mpic *mpic)
 {
        return -1;
 }
+#endif
 
-static inline int mpic_pasemi_msi_init(struct mpic *mpic)
-{
-       return -1;
-}
+#if defined(CONFIG_PCI_MSI) && defined(CONFIG_PPC_PASEMI)
+int mpic_pasemi_msi_init(struct mpic *mpic);
+#else
+static inline int mpic_pasemi_msi_init(struct mpic *mpic) { return -1; }
 #endif
 
 extern int mpic_set_irq_type(struct irq_data *d, unsigned int flow_type);


cheers

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

* Re: [PATCH] powerpc/pasemi: Only the build the pasemi MSI code for PASEMI=y
  2015-04-10  5:28   ` Michael Ellerman
@ 2015-04-10  6:42     ` Stephen Rothwell
  2015-04-10 10:38       ` Michael Ellerman
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Rothwell @ 2015-04-10  6:42 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: Olof Johannsson, linuxppc-dev

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

Hi Michael,

On Fri, 10 Apr 2015 15:28:34 +1000 Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> Like this?
> 
> $ git diff --stat -M HEAD^
>  arch/powerpc/platforms/pasemi/Makefile                            |  1 +
>  arch/powerpc/{sysdev/mpic_pasemi_msi.c => platforms/pasemi/msi.c} |  4 +---
>  arch/powerpc/sysdev/Makefile                                      |  2 +-
>  arch/powerpc/sysdev/mpic.h                                        | 10 +++++-----
>  4 files changed, 8 insertions(+), 9 deletions(-)

Yeah, much easier to see what is going on.  And (I think) the diff
should work as long as it is only given to "git am" (et al) and not
"patch".

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] powerpc/pasemi: Only the build the pasemi MSI code for PASEMI=y
  2015-04-10  6:42     ` Stephen Rothwell
@ 2015-04-10 10:38       ` Michael Ellerman
  2015-04-12 19:04         ` Segher Boessenkool
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2015-04-10 10:38 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Olof Johannsson, linuxppc-dev

On Fri, 2015-04-10 at 16:42 +1000, Stephen Rothwell wrote:
> Hi Michael,
> 
> On Fri, 10 Apr 2015 15:28:34 +1000 Michael Ellerman <mpe@ellerman.id.au> wrote:
> >
> > Like this?
> > 
> > $ git diff --stat -M HEAD^
> >  arch/powerpc/platforms/pasemi/Makefile                            |  1 +
> >  arch/powerpc/{sysdev/mpic_pasemi_msi.c => platforms/pasemi/msi.c} |  4 +---
> >  arch/powerpc/sysdev/Makefile                                      |  2 +-
> >  arch/powerpc/sysdev/mpic.h                                        | 10 +++++-----
> >  4 files changed, 8 insertions(+), 9 deletions(-)
> 
> Yeah, much easier to see what is going on.  And (I think) the diff
> should work as long as it is only given to "git am" (et al) and not
> "patch".

Yep, which is fine by me.

I've worked out I can pass -M to git-send-email and it will pass it along to
git-format-patch and DTRT.

BUT, I can't work out how to tell git-send-email I *always* want to pass -M, so
I'll probably forget next time :)

cheers

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

* Re: [PATCH] powerpc/pasemi: Only the build the pasemi MSI code for PASEMI=y
  2015-04-10 10:38       ` Michael Ellerman
@ 2015-04-12 19:04         ` Segher Boessenkool
  2015-04-13  1:03           ` Michael Ellerman
  0 siblings, 1 reply; 7+ messages in thread
From: Segher Boessenkool @ 2015-04-12 19:04 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: Olof Johannsson, Stephen Rothwell, linuxppc-dev

On Fri, Apr 10, 2015 at 08:38:55PM +1000, Michael Ellerman wrote:
> BUT, I can't work out how to tell git-send-email I *always* want to pass -M, so
> I'll probably forget next time :)

In your config:

--
[diff]
	renames = true
--

but this will do it for all diffs, not just for format-patch.


Segher

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

* Re: [PATCH] powerpc/pasemi: Only the build the pasemi MSI code for PASEMI=y
  2015-04-12 19:04         ` Segher Boessenkool
@ 2015-04-13  1:03           ` Michael Ellerman
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2015-04-13  1:03 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: Olof Johannsson, Stephen Rothwell, linuxppc-dev

On Sun, 2015-04-12 at 14:04 -0500, Segher Boessenkool wrote:
> On Fri, Apr 10, 2015 at 08:38:55PM +1000, Michael Ellerman wrote:
> > BUT, I can't work out how to tell git-send-email I *always* want to pass -M, so
> > I'll probably forget next time :)
> 
> In your config:
> 
> --
> [diff]
> 	renames = true
> --
> 
> but this will do it for all diffs, not just for format-patch.

Ah thanks. That's probably good enough for me. If folks need a patch(1) diff
they can ask for it.

cheers

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

end of thread, other threads:[~2015-04-13  1:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-10  1:52 [PATCH] powerpc/pasemi: Only the build the pasemi MSI code for PASEMI=y Michael Ellerman
2015-04-10  4:24 ` Stephen Rothwell
2015-04-10  5:28   ` Michael Ellerman
2015-04-10  6:42     ` Stephen Rothwell
2015-04-10 10:38       ` Michael Ellerman
2015-04-12 19:04         ` Segher Boessenkool
2015-04-13  1:03           ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.