Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1222441 > unrolled thread
| Started by | jakeo@microsoft.com |
|---|---|
| First post | 2015-09-11 02:20 +0200 |
| Last post | 2015-09-21 17:50 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 04/12] drivers:pci: Add IRQ domain lookup by PCI domain jakeo@microsoft.com - 2015-09-11 02:20 +0200
Re: [PATCH v2 04/12] drivers:pci: Add IRQ domain lookup by PCI domain Bjorn Helgaas <bhelgaas@google.com> - 2015-09-21 17:50 +0200
| From | jakeo@microsoft.com |
|---|---|
| Date | 2015-09-11 02:20 +0200 |
| Subject | [PATCH v2 04/12] drivers:pci: Add IRQ domain lookup by PCI domain |
| Message-ID | <q7kel-QN-1@gated-at.bofh.it> |
From: Jake Oshins <jakeo@microsoft.com>
The PCI driver currently looks up IRQ domains for root PCI buses by walking
up the Open Firmware tree looking for any that cover this particular PCI root.
Since x86 PCs don't implement Open Firmware, this patch offers an alternative
lookup by the PCI domain ID (known as "segment" in the PCI and ACPI specs.)
I could have tried to build a (fake) Open Firmware tree and leverage the old
code, but I rejected that possibility both because it would have required
changes in lots of other places and because most distributions don't even
compile in the OF infrastructure when targeting PCs.
Signed-off-by: Jake Oshins <jakeo@microsoft.com>
---
drivers/pci/probe.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 0b2be17..e7e5ff3 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -12,6 +12,7 @@
#include <linux/module.h>
#include <linux/cpumask.h>
#include <linux/pci-aspm.h>
+#include <linux/irqdomain.h>
#include <asm-generic/pci-bridge.h>
#include "pci.h"
@@ -663,12 +664,22 @@ static void pci_set_bus_speed(struct pci_bus *bus)
static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus)
{
struct irq_domain *d;
+ int pci_domain;
/*
* Any firmware interface that can resolve the msi_domain
* should be called from here.
*/
d = pci_host_bridge_of_msi_domain(bus);
+ if (d)
+ return d;
+
+ /*
+ * If firmware couldn't help find, it try looking it up by PCI
+ * domain/segment.
+ */
+ pci_domain = pci_domain_nr(bus);
+ d = irq_find_matching_host(NULL, DOMAIN_BUS_PCI_MSI, &pci_domain);
return d;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Bjorn Helgaas <bhelgaas@google.com> |
|---|---|
| Date | 2015-09-21 17:50 +0200 |
| Message-ID | <qbbvQ-2wt-17@gated-at.bofh.it> |
| In reply to | #1222441 |
Hi Jake,
I don't know how this will be morphed after Marc's comments, but when you
repost this series, please take a look at the existing change history,
e.g., with "git log --oneline drivers/pci/probe.c", and make your subject
lines follow the existing conventions. In this case, they look like:
PCI: Make pci_msi_setup_pci_dev() non-static for use by arch code
PCI: Set MPS to match upstream bridge
PCI: Move MPS configuration check to pci_configure_device()
PCI: Add pci_scan_root_bus_msi()
PCI: Tolerate hierarchies with no Root Port
...
Bjorn
On Fri, Sep 11, 2015 at 12:01:03AM +0000, jakeo@microsoft.com wrote:
> From: Jake Oshins <jakeo@microsoft.com>
>
> The PCI driver currently looks up IRQ domains for root PCI buses by walking
> up the Open Firmware tree looking for any that cover this particular PCI root.
> Since x86 PCs don't implement Open Firmware, this patch offers an alternative
> lookup by the PCI domain ID (known as "segment" in the PCI and ACPI specs.)
>
> I could have tried to build a (fake) Open Firmware tree and leverage the old
> code, but I rejected that possibility both because it would have required
> changes in lots of other places and because most distributions don't even
> compile in the OF infrastructure when targeting PCs.
>
> Signed-off-by: Jake Oshins <jakeo@microsoft.com>
> ---
> drivers/pci/probe.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 0b2be17..e7e5ff3 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -12,6 +12,7 @@
> #include <linux/module.h>
> #include <linux/cpumask.h>
> #include <linux/pci-aspm.h>
> +#include <linux/irqdomain.h>
> #include <asm-generic/pci-bridge.h>
> #include "pci.h"
>
> @@ -663,12 +664,22 @@ static void pci_set_bus_speed(struct pci_bus *bus)
> static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus)
> {
> struct irq_domain *d;
> + int pci_domain;
>
> /*
> * Any firmware interface that can resolve the msi_domain
> * should be called from here.
> */
> d = pci_host_bridge_of_msi_domain(bus);
> + if (d)
> + return d;
> +
> + /*
> + * If firmware couldn't help find, it try looking it up by PCI
> + * domain/segment.
> + */
> + pci_domain = pci_domain_nr(bus);
> + d = irq_find_matching_host(NULL, DOMAIN_BUS_PCI_MSI, &pci_domain);
>
> return d;
> }
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web