Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1286822 > unrolled thread
| Started by | Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> |
|---|---|
| First post | 2015-12-08 21:20 +0100 |
| Last post | 2015-12-08 21:30 +0100 |
| Articles | 5 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v4 0/5] gicv2m: acpi: Add ACPI support for GICv2m MSI Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2015-12-08 21:20 +0100
[PATCH v4 3/5] irqdomain: Introduce irq_domain_get_irqchip_fwnode_name helper function Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2015-12-08 21:30 +0100
[PATCH v4 1/5] acpi: pci: Setup MSI domain for ACPI based pci devices Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2015-12-08 21:30 +0100
Re: [PATCH v4 1/5] acpi: pci: Setup MSI domain for ACPI based pci devices kbuild test robot <lkp@intel.com> - 2015-12-08 22:10 +0100
[PATCH v4 2/5] irqdomain: introduce is_fwnode_irqchip helper Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2015-12-08 21:30 +0100
| From | Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> |
|---|---|
| Date | 2015-12-08 21:20 +0100 |
| Subject | [PATCH v4 0/5] gicv2m: acpi: Add ACPI support for GICv2m MSI |
| Message-ID | <qDwTT-6Yp-7@gated-at.bofh.it> |
This patch series has been forked from the following patch series since
it no longer depends on the rest of the patches.
[PATCH v4 00/10] ACPI GIC Self-probing, GICv2m and GICv3 support
https://lkml.org/lkml/2015/7/29/234
It has been ported to use the newly introduced device fwnode_handle
for ACPI irqdmain introduced by Marc in the following patch series:
[PATCH v2 00/17] Divorcing irqdomain and device_node
http://git.kernel.org/cgit/linux/kernel/git/maz/arm-platforms.git irq/irq-domain-fwnode-v2
The following git branch contains the submitted patches along with
the pre-requsite patches (mainly for ARM64 PCI support for ACPI).
https://github.com/ssuthiku/linux.git v2m-multiframe-v4
This has been tested on AMD Seattle (Overdrive) RevB system.
NOTE: I have not tested ACPI GICv2m multiframe support since
I don't have access to such system. Any helps are appreciated.
Thanks,
Suravee
Changes from V3: (https://lkml.org/lkml/2015/10/21/691)
- Merged patch 2 into 1, and got rid off pci_msi_get_fwnode()
since only ACPI will likely use this. (per Marc suggestion)
- Rebased to 4.4.0-rc4
Changes from V2: (https://lkml.org/lkml/2015/10/14/1010)
- Minor clean up from Tomasz review comment in patch 6/6.
Changes from V1: (https://lkml.org/lkml/2015/10/13/859)
- Rebase on top of Marc's patch to addng support for multiple MSI frames
(https://lkml.org/lkml/2015/10/14/271)
- Adding fwnode convenient functions (patch 3 and 4)
Suravee Suthikulpanit (5):
acpi: pci: Setup MSI domain for ACPI based pci devices
irqdomain: introduce is_fwnode_irqchip helper
irqdomain: Introduce irq_domain_get_irqchip_fwnode_name helper
function
gicv2m: Refactor to prepare for ACPI support
gicv2m: acpi: Introducing GICv2m ACPI support
drivers/irqchip/irq-gic-v2m.c | 152 ++++++++++++++++++++++++++++++++++------
drivers/irqchip/irq-gic.c | 5 +-
drivers/pci/pci-acpi.c | 32 +++++++++
drivers/pci/probe.c | 2 +
include/linux/irqchip/arm-gic.h | 4 ++
include/linux/irqdomain.h | 6 ++
include/linux/pci.h | 10 +++
kernel/irq/irqdomain.c | 20 +++++-
8 files changed, 208 insertions(+), 23 deletions(-)
--
2.1.0
--
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 | Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> |
|---|---|
| Date | 2015-12-08 21:30 +0100 |
| Subject | [PATCH v4 3/5] irqdomain: Introduce irq_domain_get_irqchip_fwnode_name helper function |
| Message-ID | <qDx3A-728-7@gated-at.bofh.it> |
| In reply to | #1286822 |
This patch adds an accessor function to retrieve struct irqchip_fwid.name.
Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
include/linux/irqdomain.h | 1 +
kernel/irq/irqdomain.c | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 4950a71..006633d 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -187,6 +187,7 @@ static inline struct device_node *irq_domain_get_of_node(struct irq_domain *d)
#ifdef CONFIG_IRQ_DOMAIN
struct fwnode_handle *irq_domain_alloc_fwnode(void *data);
void irq_domain_free_fwnode(struct fwnode_handle *fwnode);
+const char *irq_domain_get_irqchip_fwnode_name(struct fwnode_handle *fwnode);
struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,
irq_hw_number_t hwirq_max, int direct_max,
const struct irq_domain_ops *ops,
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 7f34d98..a8c1cf6 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -79,6 +79,24 @@ void irq_domain_free_fwnode(struct fwnode_handle *fwnode)
}
/**
+ * irq_domain_get_irqchip_fwnode_name - Retrieve associated name of
+ * specified irqchip fwnode
+ * @fwnode: Specified fwnode_handle
+ *
+ * Returns associated name of the specified fwnode, or NULL on failure.
+ */
+const char *irq_domain_get_irqchip_fwnode_name(struct fwnode_handle *fwnode)
+{
+ struct irqchip_fwid *fwid;
+
+ if (!is_fwnode_irqchip(fwnode))
+ return NULL;
+
+ fwid = container_of(fwnode, struct irqchip_fwid, fwnode);
+ return fwid->name;
+}
+
+/**
* __irq_domain_add() - Allocate a new irq_domain data structure
* @of_node: optional device-tree node of the interrupt controller
* @size: Size of linear map; 0 for radix mapping only
--
2.1.0
--
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 | Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> |
|---|---|
| Date | 2015-12-08 21:30 +0100 |
| Subject | [PATCH v4 1/5] acpi: pci: Setup MSI domain for ACPI based pci devices |
| Message-ID | <qDx3A-728-17@gated-at.bofh.it> |
| In reply to | #1286822 |
This patch introduces an interface for irqchip to register a callback,
to provide a way to determine appropriate MSI domain for a pci device.
It also introduces pci_host_bridge_acpi_msi_domain(), which returns
the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI
bus token. Then, it is assigned to pci device.
Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
drivers/pci/pci-acpi.c | 32 ++++++++++++++++++++++++++++++++
drivers/pci/probe.c | 2 ++
include/linux/pci.h | 10 ++++++++++
3 files changed, 44 insertions(+)
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index a32ba75..a555d7e 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -9,7 +9,9 @@
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/irqdomain.h>
#include <linux/pci.h>
+#include <linux/msi.h>
#include <linux/pci_hotplug.h>
#include <linux/module.h>
#include <linux/pci-aspm.h>
@@ -689,6 +691,36 @@ static struct acpi_bus_type acpi_pci_bus = {
.cleanup = pci_acpi_cleanup,
};
+
+static struct fwnode_handle *(*pci_msi_get_fwnode_cb)(struct device *dev);
+
+/**
+ * pci_msi_register_fwnode_provider - Register callback to retrieve fwnode
+ * @fn: The interrupt domain to retrieve
+ *
+ * This should be called by irqchip driver, which is the parent of
+ * the MSI domain to provide callback interface to query fwnode.
+ */
+void
+pci_msi_register_fwnode_provider(struct fwnode_handle *(*fn)(struct device *))
+{
+ pci_msi_get_fwnode_cb = fn;
+}
+
+struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
+{
+ struct irq_domain *dom = NULL;
+ struct fwnode_handle *fwnode = NULL;
+
+ if (pci_msi_get_fwnode_cb)
+ fwnode = pci_msi_get_fwnode_cb(&bus->dev);
+
+ if (fwnode)
+ dom = irq_find_matching_fwnode(fwnode,
+ DOMAIN_BUS_PCI_MSI);
+ return dom;
+}
+
static int __init acpi_pci_init(void)
{
int ret;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index edb1984..553a029 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -672,6 +672,8 @@ static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus)
* should be called from here.
*/
d = pci_host_bridge_of_msi_domain(bus);
+ if (!d)
+ d = pci_host_bridge_acpi_msi_domain(bus);
return d;
}
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 6ae25aa..d86378c 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1946,6 +1946,16 @@ static inline struct irq_domain *
pci_host_bridge_of_msi_domain(struct pci_bus *bus) { return NULL; }
#endif /* CONFIG_OF */
+#ifdef CONFIG_ACPI
+struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus);
+
+void
+pci_msi_register_fwnode_provider(struct fwnode_handle *(*fn)(struct device *));
+#else
+static inline struct irq_domain *
+pci_host_bridge_acpi_msi_domain(struct pci_bus *bus) { return NULL; }
+#endif
+
#ifdef CONFIG_EEH
static inline struct eeh_dev *pci_dev_to_eeh_dev(struct pci_dev *pdev)
{
--
2.1.0
--
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 | kbuild test robot <lkp@intel.com> |
|---|---|
| Date | 2015-12-08 22:10 +0100 |
| Subject | Re: [PATCH v4 1/5] acpi: pci: Setup MSI domain for ACPI based pci devices |
| Message-ID | <qDxGh-7up-1@gated-at.bofh.it> |
| In reply to | #1286828 |
[Multipart message — attachments visible in raw view] — view raw
Hi Suravee,
[auto build test ERROR on tip/irq/core]
[also build test ERROR on v4.4-rc4 next-20151208]
url: https://github.com/0day-ci/linux/commits/Suravee-Suthikulpanit/gicv2m-acpi-Add-ACPI-support-for-GICv2m-MSI/20151209-042217
config: i386-alldefconfig (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All error/warnings (new ones prefixed by >>):
drivers/pci/pci-acpi.c: In function 'pci_host_bridge_acpi_msi_domain':
>> drivers/pci/pci-acpi.c:719:9: error: implicit declaration of function 'irq_find_matching_fwnode' [-Werror=implicit-function-declaration]
dom = irq_find_matching_fwnode(fwnode,
^
>> drivers/pci/pci-acpi.c:719:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
dom = irq_find_matching_fwnode(fwnode,
^
cc1: some warnings being treated as errors
vim +/irq_find_matching_fwnode +719 drivers/pci/pci-acpi.c
713 struct fwnode_handle *fwnode = NULL;
714
715 if (pci_msi_get_fwnode_cb)
716 fwnode = pci_msi_get_fwnode_cb(&bus->dev);
717
718 if (fwnode)
> 719 dom = irq_find_matching_fwnode(fwnode,
720 DOMAIN_BUS_PCI_MSI);
721 return dom;
722 }
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[toc] | [prev] | [next] | [standalone]
| From | Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> |
|---|---|
| Date | 2015-12-08 21:30 +0100 |
| Subject | [PATCH v4 2/5] irqdomain: introduce is_fwnode_irqchip helper |
| Message-ID | <qDx3B-728-25@gated-at.bofh.it> |
| In reply to | #1286822 |
Since there will be several places checking if fwnode.type
is equal FWNODE_IRQCHIP, this patch adds a convenient function
for this purpose.
Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
drivers/irqchip/irq-gic.c | 2 +-
include/linux/irqdomain.h | 5 +++++
kernel/irq/irqdomain.c | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index abf2ffa..fcd327f 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -972,7 +972,7 @@ static int gic_irq_domain_translate(struct irq_domain *d,
return 0;
}
- if (fwspec->fwnode->type == FWNODE_IRQCHIP) {
+ if (is_fwnode_irqchip(fwspec->fwnode)) {
if(fwspec->param_count != 2)
return -EINVAL;
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index d5e5c5b..4950a71 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -211,6 +211,11 @@ static inline struct fwnode_handle *of_node_to_fwnode(struct device_node *node)
return node ? &node->fwnode : NULL;
}
+static inline bool is_fwnode_irqchip(struct fwnode_handle *fwnode)
+{
+ return fwnode && fwnode->type == FWNODE_IRQCHIP;
+}
+
static inline struct irq_domain *irq_find_matching_host(struct device_node *node,
enum irq_domain_bus_token bus_token)
{
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 22aa961..7f34d98 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -70,7 +70,7 @@ void irq_domain_free_fwnode(struct fwnode_handle *fwnode)
{
struct irqchip_fwid *fwid;
- if (WARN_ON(fwnode->type != FWNODE_IRQCHIP))
+ if (WARN_ON(!is_fwnode_irqchip(fwnode)))
return;
fwid = container_of(fwnode, struct irqchip_fwid, fwnode);
--
2.1.0
--
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