Skip to content

Commit cdb2387

Browse files
committed
irqchip/mvebu-gicp: Switch to MSI parent
All platform MSI users and the PCI/MSI code handle per device MSI domains when the irqdomain associated to the device provides MSI parent functionality. Remove the "global" platform domain related code and provide the MSI parent functionality by filling in msi_parent_ops. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Anna-Maria Behnsen <[email protected]> Signed-off-by: Shivamurthy Shastri <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d929e4d commit cdb2387

File tree

2 files changed

+20
-25
lines changed

2 files changed

+20
-25
lines changed

drivers/irqchip/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ config MSCC_OCELOT_IRQ
371371
select GENERIC_IRQ_CHIP
372372

373373
config MVEBU_GICP
374+
select IRQ_MSI_LIB
374375
bool
375376

376377
config MVEBU_ICU

drivers/irqchip/irq-mvebu-gicp.c

+19-25
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include <linux/of_platform.h>
1818
#include <linux/platform_device.h>
1919

20+
#include "irq-msi-lib.h"
21+
2022
#include <dt-bindings/interrupt-controller/arm-gic.h>
2123

2224
#define GICP_SETSPI_NSR_OFFSET 0x0
@@ -145,32 +147,32 @@ static void gicp_irq_domain_free(struct irq_domain *domain,
145147
}
146148

147149
static const struct irq_domain_ops gicp_domain_ops = {
150+
.select = msi_lib_irq_domain_select,
148151
.alloc = gicp_irq_domain_alloc,
149152
.free = gicp_irq_domain_free,
150153
};
151154

152-
static struct irq_chip gicp_msi_irq_chip = {
153-
.name = "GICP",
154-
.irq_set_type = irq_chip_set_type_parent,
155-
.flags = IRQCHIP_SUPPORTS_LEVEL_MSI,
156-
};
155+
#define GICP_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS | \
156+
MSI_FLAG_USE_DEF_CHIP_OPS)
157157

158-
static struct msi_domain_ops gicp_msi_ops = {
159-
};
158+
#define GICP_MSI_FLAGS_SUPPORTED (MSI_GENERIC_FLAGS_MASK | \
159+
MSI_FLAG_LEVEL_CAPABLE)
160160

161-
static struct msi_domain_info gicp_msi_domain_info = {
162-
.flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
163-
MSI_FLAG_LEVEL_CAPABLE),
164-
.ops = &gicp_msi_ops,
165-
.chip = &gicp_msi_irq_chip,
161+
static const struct msi_parent_ops gicp_msi_parent_ops = {
162+
.supported_flags = GICP_MSI_FLAGS_SUPPORTED,
163+
.required_flags = GICP_MSI_FLAGS_REQUIRED,
164+
.bus_select_token = DOMAIN_BUS_GENERIC_MSI,
165+
.bus_select_mask = MATCH_PLATFORM_MSI,
166+
.prefix = "GICP-",
167+
.init_dev_msi_info = msi_lib_init_dev_msi_info,
166168
};
167169

168170
static int mvebu_gicp_probe(struct platform_device *pdev)
169171
{
170-
struct mvebu_gicp *gicp;
171-
struct irq_domain *inner_domain, *plat_domain, *parent_domain;
172+
struct irq_domain *inner_domain, *parent_domain;
172173
struct device_node *node = pdev->dev.of_node;
173174
struct device_node *irq_parent_dn;
175+
struct mvebu_gicp *gicp;
174176
int ret, i;
175177

176178
gicp = devm_kzalloc(&pdev->dev, sizeof(*gicp), GFP_KERNEL);
@@ -234,17 +236,9 @@ static int mvebu_gicp_probe(struct platform_device *pdev)
234236
if (!inner_domain)
235237
return -ENOMEM;
236238

237-
238-
plat_domain = platform_msi_create_irq_domain(of_node_to_fwnode(node),
239-
&gicp_msi_domain_info,
240-
inner_domain);
241-
if (!plat_domain) {
242-
irq_domain_remove(inner_domain);
243-
return -ENOMEM;
244-
}
245-
246-
platform_set_drvdata(pdev, gicp);
247-
239+
irq_domain_update_bus_token(inner_domain, DOMAIN_BUS_GENERIC_MSI);
240+
inner_domain->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT;
241+
inner_domain->msi_parent_ops = &gicp_msi_parent_ops;
248242
return 0;
249243
}
250244

0 commit comments

Comments
 (0)