All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: linux-pci@vger.kernel.org, linux-arch@vger.kernel.org,
	Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	Russell King <rmk@arm.linux.org.uk>,
	Ralf Baechle <ralf@linux-mips.org>,
	Kyle McMartin <kyle@parisc-linux.org>,
	Matthew Wilcox <matthew@wil.cx>,
	Grant Grundler <grundler@parisc-linux.org>,
	Paul Mackerras <paulus@samba.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mundt <lethal@linux-sh.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	hpa@zytor.com
Subject: [PATCH 12/12] PCI: x86: use generic pci_swizzle_interrupt_pin()
Date: Tue, 09 Dec 2008 16:12:37 -0700	[thread overview]
Message-ID: <20081209231237.18153.72370.stgit@bob.kio> (raw)
In-Reply-To: <20081209231037.18153.86962.stgit@bob.kio>

Use the generic pci_swizzle_interrupt_pin() instead of arch-specific code.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
---
 arch/x86/pci/irq.c   |    4 ++--
 arch/x86/pci/visws.c |    7 +------
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
index 6547497..1d6469b 100644
--- a/arch/x86/pci/irq.c
+++ b/arch/x86/pci/irq.c
@@ -1069,7 +1069,7 @@ static void __init pcibios_fixup_irqs(void)
 				struct pci_dev *bridge = dev->bus->self;
 				int bus;
 
-				pin = (((pin - 1) + PCI_SLOT(dev->devfn)) % 4) + 1;
+				pin = pci_swizzle_interrupt_pin(dev, pin);
 				bus = bridge->bus->number;
 				irq = IO_APIC_get_PCI_irq_vector(bus,
 						PCI_SLOT(bridge->devfn), pin - 1);
@@ -1233,7 +1233,7 @@ static int pirq_enable_irq(struct pci_dev *dev)
 			while (irq < 0 && dev->bus->parent) { /* go back to the bridge */
 				struct pci_dev *bridge = dev->bus->self;
 
-				pin = (((pin - 1) + PCI_SLOT(dev->devfn)) % 4) + 1;
+				pin = pci_swizzle_interrupt_pin(dev, pin);
 				irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number,
 						PCI_SLOT(bridge->devfn), pin - 1);
 				if (irq >= 0)
diff --git a/arch/x86/pci/visws.c b/arch/x86/pci/visws.c
index 42f4cb1..6b5ed3d 100644
--- a/arch/x86/pci/visws.c
+++ b/arch/x86/pci/visws.c
@@ -25,17 +25,12 @@ static void pci_visws_disable_irq(struct pci_dev *dev) { }
 
 unsigned int pci_bus0, pci_bus1;
 
-static inline u8 bridge_swizzle(u8 pin, u8 slot) 
-{
-	return (((pin - 1) + slot) % 4) + 1;
-}
-
 static u8 __init visws_swizzle(struct pci_dev *dev, u8 *pinp)
 {
 	u8 pin = *pinp;
 
 	while (dev->bus->self) {	/* Move up the chain of bridges. */
-		pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));
+		pin = pci_swizzle_interrupt_pin(dev, pin);
 		dev = dev->bus->self;
 	}
 	*pinp = pin;

  parent reply	other threads:[~2008-12-09 23:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-09 23:11 [PATCH 00/12] PCI: unify P2P bridge INTx swizzling Bjorn Helgaas
2008-12-09 23:11 ` [PATCH 01/12] PCI Hotplug: cpqphp: use config space PCI interrupt pin encoding Bjorn Helgaas
2008-12-09 23:11 ` [PATCH 02/12] PCI: use config space encoding in pci_get_interrupt_pin() Bjorn Helgaas
2008-12-09 23:11 ` [PATCH 03/12] x86/PCI: use config space encoding for interrupt pins Bjorn Helgaas
2008-12-09 23:11 ` [PATCH 04/12] x86/PCI: minor logic simplications Bjorn Helgaas
2008-12-09 23:12 ` [PATCH 05/12] PCI: add pci_swizzle_interrupt_pin() Bjorn Helgaas
2008-12-11 15:00   ` David Howells
2008-12-11 16:48     ` Bjorn Helgaas
2008-12-11 17:34       ` David Howells
2008-12-11 18:03         ` Bjorn Helgaas
2008-12-11 18:14           ` David Howells
2008-12-11 18:24             ` Bjorn Helgaas
2008-12-09 23:12 ` [PATCH 06/12] PCI: alpha: use generic pci_swizzle_interrupt_pin() Bjorn Helgaas
2008-12-09 23:12 ` [PATCH 07/12] PCI: arm: " Bjorn Helgaas
2008-12-09 23:12 ` [PATCH 08/12] PCI: mips: " Bjorn Helgaas
2008-12-10 13:35   ` Ralf Baechle
2008-12-09 23:12 ` [PATCH 09/12] PCI: parisc: " Bjorn Helgaas
2008-12-09 23:26   ` Kyle McMartin
2008-12-09 23:12 ` [PATCH 10/12] PCI: powerpc: " Bjorn Helgaas
2008-12-12 20:03   ` Benjamin Herrenschmidt
2008-12-09 23:12 ` [PATCH 11/12] PCI: sh: " Bjorn Helgaas
2008-12-10  3:49   ` Paul Mundt
2008-12-09 23:12 ` Bjorn Helgaas [this message]
2008-12-16 20:20 ` [PATCH 00/12] PCI: unify P2P bridge INTx swizzling Jesse Barnes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081209231237.18153.72370.stgit@bob.kio \
    --to=bjorn.helgaas@hp.com \
    --cc=benh@kernel.crashing.org \
    --cc=grundler@parisc-linux.org \
    --cc=hpa@zytor.com \
    --cc=ink@jurassic.park.msu.ru \
    --cc=jbarnes@virtuousgeek.org \
    --cc=kyle@parisc-linux.org \
    --cc=lethal@linux-sh.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=ralf@linux-mips.org \
    --cc=rmk@arm.linux.org.uk \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.