linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: linux-pci@vger.kernel.org
Cc: Mikael Starvik <starvik@axis.com>,
	Jesper Nilsson <jesper.nilsson@axis.com>,
	Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	David Howells <dhowells@redhat.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	linux-cris-kernel@axis.com, linux-kernel@vger.kernel.org,
	linux-ia64@vger.kernel.org, linux-am33-list@redhat.com
Subject: [PATCH] PCI/MSI: Don't set up INTx if MSI or MSI-X is enabled
Date: Tue, 13 Mar 2018 16:45:49 -0500	[thread overview]
Message-ID: <152097754955.241946.9551793957889760940.stgit@bhelgaas-glaptop.roam.corp.google.com> (raw)

From: Bjorn Helgaas <bhelgaas@google.com>

If a device already has MSI or MSI-X enabled, there's no need to set up its
legacy INTx interrupt.

bba6f6fc68e7 ("[PATCH] MSI-X: fix resume crash") changed the cris, frv,
x86, and ia64 arches to skip INTx setup when MSI is enabled.

16cf0ebc35dd ("x86/PCI: Do not use interrupt links for devices using
MSI-X") extended that by changing x86 to also skip INTx setup when MSI-X is
enabled.

Change the remaining arches (cris, frv, and ia64) to skip INTx setup when
either MSI or MSI-X is enabled.

Also update mn10300 (which didn't exist at the time of bba6f6fc68e7) to
follow the same pattern.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 arch/cris/arch-v32/drivers/pci/bios.c |    2 +-
 arch/frv/mb93090-mb00/pci-vdk.c       |    2 +-
 arch/ia64/pci/pci.c                   |    4 ++--
 arch/mn10300/unit-asb2305/pci.c       |    8 +++++---
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/arch/cris/arch-v32/drivers/pci/bios.c b/arch/cris/arch-v32/drivers/pci/bios.c
index 6b9e6cfaa29e..c2bed0cc060b 100644
--- a/arch/cris/arch-v32/drivers/pci/bios.c
+++ b/arch/cris/arch-v32/drivers/pci/bios.c
@@ -68,7 +68,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
 	if ((err = pcibios_enable_resources(dev, mask)) < 0)
 		return err;
 
-	if (!dev->msi_enabled)
+	if (!pci_dev_msi_enabled(dev))
 		pcibios_enable_irq(dev);
 	return 0;
 }
diff --git a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c
index f211839e2cae..4a55d1b82d21 100644
--- a/arch/frv/mb93090-mb00/pci-vdk.c
+++ b/arch/frv/mb93090-mb00/pci-vdk.c
@@ -413,7 +413,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
 
 	if ((err = pci_enable_resources(dev, mask)) < 0)
 		return err;
-	if (!dev->msi_enabled)
+	if (!pci_dev_msi_enabled(dev))
 		pcibios_enable_irq(dev);
 	return 0;
 }
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index f5ec736100ee..7ccc64d5fe3e 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -398,7 +398,7 @@ pcibios_enable_device (struct pci_dev *dev, int mask)
 	if (ret < 0)
 		return ret;
 
-	if (!dev->msi_enabled)
+	if (!pci_dev_msi_enabled(dev))
 		return acpi_pci_irq_enable(dev);
 	return 0;
 }
@@ -407,7 +407,7 @@ void
 pcibios_disable_device (struct pci_dev *dev)
 {
 	BUG_ON(atomic_read(&dev->enable_cnt));
-	if (!dev->msi_enabled)
+	if (!pci_dev_msi_enabled(dev))
 		acpi_pci_irq_disable(dev);
 }
 
diff --git a/arch/mn10300/unit-asb2305/pci.c b/arch/mn10300/unit-asb2305/pci.c
index 3dfe2d31c67b..4d36ea517679 100644
--- a/arch/mn10300/unit-asb2305/pci.c
+++ b/arch/mn10300/unit-asb2305/pci.c
@@ -399,10 +399,12 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
 {
 	int err;
 
-	err = pci_enable_resources(dev, mask);
-	if (err == 0)
+	if ((err = pci_enable_resources(dev, mask)) < 0)
+		return err;
+
+	if (!pci_dev_msi_enabled(dev))
 		pcibios_enable_irq(dev);
-	return err;
+	return 0;
 }
 
 /*

             reply	other threads:[~2018-03-13 21:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 21:45 Bjorn Helgaas [this message]
2018-03-13 22:41 ` [PATCH] PCI/MSI: Don't set up INTx if MSI or MSI-X is enabled Luck, Tony
2018-03-14  8:35 ` Christoph Hellwig
2018-03-14 17:12   ` Bjorn Helgaas
2018-03-14 10:27 ` Rafael J. Wysocki
2018-03-14 16:31 ` Andy Shevchenko
2018-03-14 17:49   ` Bjorn Helgaas
2018-03-14 18:17     ` Andy Shevchenko
2018-03-19 18:57 ` Bjorn Helgaas

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=152097754955.241946.9551793957889760940.stgit@bhelgaas-glaptop.roam.corp.google.com \
    --to=helgaas@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=fenghua.yu@intel.com \
    --cc=jesper.nilsson@axis.com \
    --cc=linux-am33-list@redhat.com \
    --cc=linux-cris-kernel@axis.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=starvik@axis.com \
    --cc=tony.luck@intel.com \
    /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 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).