Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1288751 > unrolled thread
| Started by | jakeo@microsoft.com |
|---|---|
| First post | 2015-12-10 19:00 +0100 |
| Last post | 2015-12-10 19:20 +0100 |
| Articles | 8 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v10 0/7] PCI: hv: New paravirtual PCI front-end for Hyper-V VMs jakeo@microsoft.com - 2015-12-10 19:00 +0100
[PATCH v10 3/7] PCI: Make it possible to implement a PCI MSI IRQ Domain in a module. jakeo@microsoft.com - 2015-12-10 19:00 +0100
Re: [PATCH v10 3/7] PCI: Make it possible to implement a PCI MSI IRQ Domain in a module. Marc Zyngier <marc.zyngier@arm.com> - 2015-12-10 19:20 +0100
[PATCH v10 4/7] PCI: Add fwnode_handle to pci_sysdata jakeo@microsoft.com - 2015-12-10 19:00 +0100
Re: [PATCH v10 4/7] PCI: Add fwnode_handle to pci_sysdata Marc Zyngier <marc.zyngier@arm.com> - 2015-12-10 19:20 +0100
[PATCH v10 1/7] drivers:hv: Export a function that maps Linux CPU num onto Hyper-V proc num jakeo@microsoft.com - 2015-12-10 19:00 +0100
[PATCH v10 5/7] PCI: irqdomain: Look up IRQ domain by fwnode_handle jakeo@microsoft.com - 2015-12-10 19:00 +0100
Re: [PATCH v10 5/7] PCI: irqdomain: Look up IRQ domain by fwnode_handle Marc Zyngier <marc.zyngier@arm.com> - 2015-12-10 19:20 +0100
| From | jakeo@microsoft.com |
|---|---|
| Date | 2015-12-10 19:00 +0100 |
| Subject | [PATCH v10 0/7] PCI: hv: New paravirtual PCI front-end for Hyper-V VMs |
| Message-ID | <qEdFw-VS-3@gated-at.bofh.it> |
From: Jake Oshins <jakeo@microsoft.com>
This version of the patch series removes warning when compiling x86
32-bit while still making it build cleanly for x64.
First, export functions that allow correlating Hyper-V virtual processors
and Linux cpus, along with the means for invoking a hypercall that targets
interrupts at chosen vectors on specific cpus.
Second, mark various parts of IRQ domain related code as exported, so that
this PCI front-end can implement an IRQ domain as part of a module. (The
alternative would be to pull all tyhis into the kernel, which would pull
in a lot of other Hyper-V related code, as this IRQ domain depends on
vmbus.ko.)
Third, modify PCI so that new root PCI buses can be marked with an associated
fwnode_handle, and so that root PCI buses can look up their associated IRQ
domain by that handle.
Fourth, introduce a new driver, hv_pcifront, which exposes root PCI buses in
a Hyper-V VM. These root PCI buses expose real PCIe device, or PCI Virtual
Functions.
Jake Oshins (7):
drivers:hv: Export a function that maps Linux CPU num onto Hyper-V
proc num
drivers:hv: Export hv_do_hypercall()
PCI: Make it possible to implement a PCI MSI IRQ Domain in a module.
PCI: Add fwnode_handle to pci_sysdata
PCI: irqdomain: Look up IRQ domain by fwnode_handle
drivers:hv: Define the channel type of Hyper-V PCI Express
pass-through
PCI: hv: New paravirtual PCI front-end for Hyper-V VMs
MAINTAINERS | 1 +
arch/x86/include/asm/msi.h | 6 +
arch/x86/include/asm/pci.h | 15 +
arch/x86/kernel/apic/msi.c | 8 +-
arch/x86/kernel/apic/vector.c | 2 +
drivers/hv/hv.c | 20 +-
drivers/hv/hyperv_vmbus.h | 2 +-
drivers/hv/vmbus_drv.c | 17 +
drivers/pci/Kconfig | 7 +
drivers/pci/host/Makefile | 1 +
drivers/pci/host/hv_pcifront.c | 2249 ++++++++++++++++++++++++++++++++++++++++
drivers/pci/msi.c | 4 +
drivers/pci/probe.c | 15 +
include/linux/hyperv.h | 14 +
include/linux/pci.h | 4 +
kernel/irq/chip.c | 1 +
kernel/irq/irqdomain.c | 4 +
17 files changed, 2356 insertions(+), 14 deletions(-)
create mode 100644 drivers/pci/host/hv_pcifront.c
--
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 | jakeo@microsoft.com |
|---|---|
| Date | 2015-12-10 19:00 +0100 |
| Subject | [PATCH v10 3/7] PCI: Make it possible to implement a PCI MSI IRQ Domain in a module. |
| Message-ID | <qEdFx-VS-13@gated-at.bofh.it> |
| In reply to | #1288751 |
From: Jake Oshins <jakeo@microsoft.com>
The Linux kernel already has the concpet of IRQ domain, wherein a
component can expose a set of IRQs which are managed by a particular
interrupt controller chip or other subsystem. The PCI driver exposes
the notion of an IRQ domain for Message-Signaled Interrupts (MSI) from
PCI Express devices. This patch exposes the functions which are
necessary for making an MSI IRQ domain within a module.
Signed-off-by: Jake Oshins <jakeo@microsoft.com>
---
arch/x86/include/asm/msi.h | 6 ++++++
arch/x86/kernel/apic/msi.c | 8 +++++---
arch/x86/kernel/apic/vector.c | 2 ++
drivers/pci/msi.c | 4 ++++
kernel/irq/chip.c | 1 +
kernel/irq/irqdomain.c | 4 ++++
6 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/msi.h b/arch/x86/include/asm/msi.h
index 93724cc..eb4b09b 100644
--- a/arch/x86/include/asm/msi.h
+++ b/arch/x86/include/asm/msi.h
@@ -1,7 +1,13 @@
#ifndef _ASM_X86_MSI_H
#define _ASM_X86_MSI_H
#include <asm/hw_irq.h>
+#include <asm/irqdomain.h>
typedef struct irq_alloc_info msi_alloc_info_t;
+int pci_msi_prepare(struct irq_domain *domain, struct device *dev, int nvec,
+ msi_alloc_info_t *arg);
+
+void pci_msi_set_desc(msi_alloc_info_t *arg, struct msi_desc *desc);
+
#endif /* _ASM_X86_MSI_H */
diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c
index 5f1feb6..ade2532 100644
--- a/arch/x86/kernel/apic/msi.c
+++ b/arch/x86/kernel/apic/msi.c
@@ -96,8 +96,8 @@ static irq_hw_number_t pci_msi_get_hwirq(struct msi_domain_info *info,
return arg->msi_hwirq;
}
-static int pci_msi_prepare(struct irq_domain *domain, struct device *dev,
- int nvec, msi_alloc_info_t *arg)
+int pci_msi_prepare(struct irq_domain *domain, struct device *dev, int nvec,
+ msi_alloc_info_t *arg)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct msi_desc *desc = first_pci_msi_entry(pdev);
@@ -113,11 +113,13 @@ static int pci_msi_prepare(struct irq_domain *domain, struct device *dev,
return 0;
}
+EXPORT_SYMBOL_GPL(pci_msi_prepare);
-static void pci_msi_set_desc(msi_alloc_info_t *arg, struct msi_desc *desc)
+void pci_msi_set_desc(msi_alloc_info_t *arg, struct msi_desc *desc)
{
arg->msi_hwirq = pci_msi_domain_calc_hwirq(arg->msi_dev, desc);
}
+EXPORT_SYMBOL_GPL(pci_msi_set_desc);
static struct msi_domain_ops pci_msi_domain_ops = {
.get_hwirq = pci_msi_get_hwirq,
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index 861bc59..908cb37 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -29,6 +29,7 @@ struct apic_chip_data {
};
struct irq_domain *x86_vector_domain;
+EXPORT_SYMBOL_GPL(x86_vector_domain);
static DEFINE_RAW_SPINLOCK(vector_lock);
static cpumask_var_t vector_cpumask;
static struct irq_chip lapic_controller;
@@ -66,6 +67,7 @@ struct irq_cfg *irqd_cfg(struct irq_data *irq_data)
return data ? &data->cfg : NULL;
}
+EXPORT_SYMBOL_GPL(irqd_cfg);
struct irq_cfg *irq_cfg(unsigned int irq)
{
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 7eaa4c8..7a0df3f 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -257,6 +257,7 @@ void pci_msi_mask_irq(struct irq_data *data)
{
msi_set_mask_bit(data, 1);
}
+EXPORT_SYMBOL_GPL(pci_msi_mask_irq);
/**
* pci_msi_unmask_irq - Generic irq chip callback to unmask PCI/MSI interrupts
@@ -266,6 +267,7 @@ void pci_msi_unmask_irq(struct irq_data *data)
{
msi_set_mask_bit(data, 0);
}
+EXPORT_SYMBOL_GPL(pci_msi_unmask_irq);
void default_restore_msi_irqs(struct pci_dev *dev)
{
@@ -1126,6 +1128,7 @@ struct pci_dev *msi_desc_to_pci_dev(struct msi_desc *desc)
{
return to_pci_dev(desc->dev);
}
+EXPORT_SYMBOL(msi_desc_to_pci_dev);
void *msi_desc_to_pci_sysdata(struct msi_desc *desc)
{
@@ -1285,6 +1288,7 @@ struct irq_domain *pci_msi_create_irq_domain(struct fwnode_handle *fwnode,
domain->bus_token = DOMAIN_BUS_PCI_MSI;
return domain;
}
+EXPORT_SYMBOL_GPL(pci_msi_create_irq_domain);
/**
* pci_msi_domain_alloc_irqs - Allocate interrupts for @dev in @domain
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 05e29de..5797909 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -950,6 +950,7 @@ void irq_chip_ack_parent(struct irq_data *data)
data = data->parent_data;
data->chip->irq_ack(data);
}
+EXPORT_SYMBOL_GPL(irq_chip_ack_parent);
/**
* irq_chip_mask_parent - Mask the parent interrupt
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 22aa961..aa6ac44 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -60,6 +60,7 @@ struct fwnode_handle *irq_domain_alloc_fwnode(void *data)
fwid->fwnode.type = FWNODE_IRQCHIP;
return &fwid->fwnode;
}
+EXPORT_SYMBOL_GPL(irq_domain_alloc_fwnode);
/**
* irq_domain_free_fwnode - Free a non-OF-backed fwnode_handle
@@ -77,6 +78,7 @@ void irq_domain_free_fwnode(struct fwnode_handle *fwnode)
kfree(fwid->name);
kfree(fwid);
}
+EXPORT_SYMBOL_GPL(irq_domain_free_fwnode);
/**
* __irq_domain_add() - Allocate a new irq_domain data structure
@@ -1013,6 +1015,7 @@ struct irq_data *irq_domain_get_irq_data(struct irq_domain *domain,
return NULL;
}
+EXPORT_SYMBOL_GPL(irq_domain_get_irq_data);
/**
* irq_domain_set_hwirq_and_chip - Set hwirq and irqchip of @virq at @domain
@@ -1343,6 +1346,7 @@ struct irq_data *irq_domain_get_irq_data(struct irq_domain *domain,
return (irq_data && irq_data->domain == domain) ? irq_data : NULL;
}
+EXPORT_SYMBOL_GPL(irq_domain_get_irq_data);
/**
* irq_domain_set_info - Set the complete data for a @virq in @domain
--
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] | [next] | [standalone]
| From | Marc Zyngier <marc.zyngier@arm.com> |
|---|---|
| Date | 2015-12-10 19:20 +0100 |
| Subject | Re: [PATCH v10 3/7] PCI: Make it possible to implement a PCI MSI IRQ Domain in a module. |
| Message-ID | <qEdYT-1hY-35@gated-at.bofh.it> |
| In reply to | #1288752 |
On 10/12/15 17:52, jakeo@microsoft.com wrote: > From: Jake Oshins <jakeo@microsoft.com> > > The Linux kernel already has the concpet of IRQ domain, wherein a > component can expose a set of IRQs which are managed by a particular > interrupt controller chip or other subsystem. The PCI driver exposes > the notion of an IRQ domain for Message-Signaled Interrupts (MSI) from > PCI Express devices. This patch exposes the functions which are > necessary for making an MSI IRQ domain within a module. > > Signed-off-by: Jake Oshins <jakeo@microsoft.com> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> M. -- Jazz is not dead. It just smells funny... -- 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] | [next] | [standalone]
| From | jakeo@microsoft.com |
|---|---|
| Date | 2015-12-10 19:00 +0100 |
| Subject | [PATCH v10 4/7] PCI: Add fwnode_handle to pci_sysdata |
| Message-ID | <qEdFx-VS-35@gated-at.bofh.it> |
| In reply to | #1288751 |
From: Jake Oshins <jakeo@microsoft.com>
This patch adds an fwnode_handle to struct pci_sysdata, which is
used by the next patch in the series when trying to locate an
IRQ domain associated with a root PCI bus.
Signed-off-by: Jake Oshins <jakeo@microsoft.com>
---
arch/x86/include/asm/pci.h | 15 +++++++++++++++
drivers/pci/probe.c | 1 +
include/linux/pci.h | 4 ++++
3 files changed, 20 insertions(+)
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 4625943..6fc3c7c 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -20,6 +20,9 @@ struct pci_sysdata {
#ifdef CONFIG_X86_64
void *iommu; /* IOMMU private data */
#endif
+#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
+ void *fwnode; /* IRQ domain for MSI assignment */
+#endif
};
extern int pci_routeirq;
@@ -32,6 +35,7 @@ extern int noioapicreroute;
static inline int pci_domain_nr(struct pci_bus *bus)
{
struct pci_sysdata *sd = bus->sysdata;
+
return sd->domain;
}
@@ -41,6 +45,17 @@ static inline int pci_proc_domain(struct pci_bus *bus)
}
#endif
+#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
+static inline void *_pci_root_bus_fwnode(struct pci_bus *bus)
+{
+ struct pci_sysdata *sd = bus->sysdata;
+
+ return sd->fwnode;
+}
+
+#define pci_root_bus_fwnode _pci_root_bus_fwnode
+#endif
+
/* Can be used to override the logic in pci_scan_bus for skipping
already-configured bus numbers - to be used for buggy BIOSes
or architectures with incomplete PCI setup by the loader */
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index edb1984..750f907 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -15,6 +15,7 @@
#include <linux/pci-aspm.h>
#include <linux/aer.h>
#include <linux/acpi.h>
+#include <linux/irqdomain.h>
#include <asm-generic/pci-bridge.h>
#include "pci.h"
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 6ae25aa..b414422 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1517,6 +1517,10 @@ static inline int pci_get_new_domain_nr(void) { return -ENOSYS; }
#include <asm/pci.h>
+#ifndef pci_root_bus_fwnode
+#define pci_root_bus_fwnode(bus) ((void)(bus), NULL)
+#endif
+
/* these helpers provide future and backwards compatibility
* for accessing popular PCI BAR info */
#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
--
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] | [next] | [standalone]
| From | Marc Zyngier <marc.zyngier@arm.com> |
|---|---|
| Date | 2015-12-10 19:20 +0100 |
| Subject | Re: [PATCH v10 4/7] PCI: Add fwnode_handle to pci_sysdata |
| Message-ID | <qEdYS-1hY-5@gated-at.bofh.it> |
| In reply to | #1288754 |
On 10/12/15 17:53, jakeo@microsoft.com wrote:
> From: Jake Oshins <jakeo@microsoft.com>
>
> This patch adds an fwnode_handle to struct pci_sysdata, which is
> used by the next patch in the series when trying to locate an
> IRQ domain associated with a root PCI bus.
>
> Signed-off-by: Jake Oshins <jakeo@microsoft.com>
> ---
> arch/x86/include/asm/pci.h | 15 +++++++++++++++
> drivers/pci/probe.c | 1 +
> include/linux/pci.h | 4 ++++
> 3 files changed, 20 insertions(+)
>
> diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
> index 4625943..6fc3c7c 100644
> --- a/arch/x86/include/asm/pci.h
> +++ b/arch/x86/include/asm/pci.h
> @@ -20,6 +20,9 @@ struct pci_sysdata {
> #ifdef CONFIG_X86_64
> void *iommu; /* IOMMU private data */
> #endif
> +#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
> + void *fwnode; /* IRQ domain for MSI assignment */
> +#endif
> };
>
> extern int pci_routeirq;
> @@ -32,6 +35,7 @@ extern int noioapicreroute;
> static inline int pci_domain_nr(struct pci_bus *bus)
> {
> struct pci_sysdata *sd = bus->sysdata;
> +
> return sd->domain;
> }
>
> @@ -41,6 +45,17 @@ static inline int pci_proc_domain(struct pci_bus *bus)
> }
> #endif
>
> +#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
> +static inline void *_pci_root_bus_fwnode(struct pci_bus *bus)
> +{
> + struct pci_sysdata *sd = bus->sysdata;
> +
> + return sd->fwnode;
> +}
> +
> +#define pci_root_bus_fwnode _pci_root_bus_fwnode
> +#endif
> +
> /* Can be used to override the logic in pci_scan_bus for skipping
> already-configured bus numbers - to be used for buggy BIOSes
> or architectures with incomplete PCI setup by the loader */
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index edb1984..750f907 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -15,6 +15,7 @@
> #include <linux/pci-aspm.h>
> #include <linux/aer.h>
> #include <linux/acpi.h>
> +#include <linux/irqdomain.h>
Nit: this should be with patch 5, but that doesn't hurt. I don't think
you need to respin the series for this.
> #include <asm-generic/pci-bridge.h>
> #include "pci.h"
>
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 6ae25aa..b414422 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1517,6 +1517,10 @@ static inline int pci_get_new_domain_nr(void) { return -ENOSYS; }
>
> #include <asm/pci.h>
>
> +#ifndef pci_root_bus_fwnode
> +#define pci_root_bus_fwnode(bus) ((void)(bus), NULL)
> +#endif
> +
> /* these helpers provide future and backwards compatibility
> * for accessing popular PCI BAR info */
> #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
M.
--
Jazz is not dead. It just smells funny...
--
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] | [next] | [standalone]
| From | jakeo@microsoft.com |
|---|---|
| Date | 2015-12-10 19:00 +0100 |
| Subject | [PATCH v10 1/7] drivers:hv: Export a function that maps Linux CPU num onto Hyper-V proc num |
| Message-ID | <qEdFy-VS-43@gated-at.bofh.it> |
| In reply to | #1288751 |
From: Jake Oshins <jakeo@microsoft.com>
This patch exposes the mapping between Linux CPU number and Hyper-V
virtual processor number. This is necessary because the hypervisor needs
to know which virtual processor to target when making a mapping in the
Interrupt Redirection Table in the I/O MMU.
Signed-off-by: Jake Oshins <jakeo@microsoft.com>
---
drivers/hv/vmbus_drv.c | 17 +++++++++++++++++
include/linux/hyperv.h | 2 ++
2 files changed, 19 insertions(+)
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index f19b6f7..c89d0e5 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1191,6 +1191,23 @@ int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj,
}
EXPORT_SYMBOL_GPL(vmbus_allocate_mmio);
+/**
+ * vmbus_cpu_number_to_vp_number() - Map CPU to VP.
+ * @cpu_number: CPU number in Linux terms
+ *
+ * This function returns the mapping between the Linux processor
+ * number and the hypervisor's virtual processor number, useful
+ * in making hypercalls and such that talk about specific
+ * processors.
+ *
+ * Return: Virtual processor number in Hyper-V terms
+ */
+int vmbus_cpu_number_to_vp_number(int cpu_number)
+{
+ return hv_context.vp_index[cpu_number];
+}
+EXPORT_SYMBOL_GPL(vmbus_cpu_number_to_vp_number);
+
static int vmbus_acpi_add(struct acpi_device *device)
{
acpi_status result;
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 8fdc17b..fddb3e0 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -983,6 +983,8 @@ int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj,
resource_size_t size, resource_size_t align,
bool fb_overlap_ok);
+int vmbus_cpu_number_to_vp_number(int cpu_number);
+
/**
* VMBUS_DEVICE - macro used to describe a specific hyperv vmbus device
*
--
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] | [next] | [standalone]
| From | jakeo@microsoft.com |
|---|---|
| Date | 2015-12-10 19:00 +0100 |
| Subject | [PATCH v10 5/7] PCI: irqdomain: Look up IRQ domain by fwnode_handle |
| Message-ID | <qEdFy-VS-45@gated-at.bofh.it> |
| In reply to | #1288751 |
From: Jake Oshins <jakeo@microsoft.com>
This patch adds a second way of finding an IRQ domain associated with
a root PCI bus. After looking to see if one can be found through
the OF tree, it attempts to look up the IRQ domain through an
fwnode_handle stored in the pci_sysdata struct.
Signed-off-by: Jake Oshins <jakeo@microsoft.com>
---
drivers/pci/probe.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 750f907..c6369dd 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -674,6 +674,20 @@ static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus)
*/
d = pci_host_bridge_of_msi_domain(bus);
+#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
+ /*
+ * If no IRQ domain was found via the OF tree, try looking it up
+ * directly through the fwnode_handle.
+ */
+ if (!d) {
+ struct fwnode_handle *fwnode = pci_root_bus_fwnode(bus);
+
+ if (fwnode)
+ d = irq_find_matching_fwnode(fwnode,
+ DOMAIN_BUS_PCI_MSI);
+ }
+#endif
+
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] | [next] | [standalone]
| From | Marc Zyngier <marc.zyngier@arm.com> |
|---|---|
| Date | 2015-12-10 19:20 +0100 |
| Subject | Re: [PATCH v10 5/7] PCI: irqdomain: Look up IRQ domain by fwnode_handle |
| Message-ID | <qEdYS-1hY-11@gated-at.bofh.it> |
| In reply to | #1288759 |
On 10/12/15 17:53, jakeo@microsoft.com wrote:
> From: Jake Oshins <jakeo@microsoft.com>
>
> This patch adds a second way of finding an IRQ domain associated with
> a root PCI bus. After looking to see if one can be found through
> the OF tree, it attempts to look up the IRQ domain through an
> fwnode_handle stored in the pci_sysdata struct.
>
> Signed-off-by: Jake Oshins <jakeo@microsoft.com>
> ---
> drivers/pci/probe.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 750f907..c6369dd 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -674,6 +674,20 @@ static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus)
> */
> d = pci_host_bridge_of_msi_domain(bus);
>
> +#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
> + /*
> + * If no IRQ domain was found via the OF tree, try looking it up
> + * directly through the fwnode_handle.
> + */
> + if (!d) {
> + struct fwnode_handle *fwnode = pci_root_bus_fwnode(bus);
> +
> + if (fwnode)
> + d = irq_find_matching_fwnode(fwnode,
> + DOMAIN_BUS_PCI_MSI);
> + }
> +#endif
> +
> return d;
> }
>
>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
M.
--
Jazz is not dead. It just smells funny...
--
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