Skip to content

Commit e0b99c4

Browse files
committed
irqchip/mvebu-odmi: Switch to parent MSI
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 cdb2387 commit e0b99c4

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

drivers/irqchip/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ config MVEBU_ICU
379379

380380
config MVEBU_ODMI
381381
bool
382+
select IRQ_MSI_LIB
382383
select GENERIC_MSI_IRQ
383384

384385
config MVEBU_PIC

drivers/irqchip/irq-mvebu-odmi.c

+18-19
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
#include <linux/msi.h>
1818
#include <linux/of_address.h>
1919
#include <linux/slab.h>
20+
21+
#include "irq-msi-lib.h"
22+
2023
#include <dt-bindings/interrupt-controller/arm-gic.h>
2124

2225
#define GICP_ODMIN_SET 0x40
@@ -141,27 +144,29 @@ static void odmi_irq_domain_free(struct irq_domain *domain,
141144
}
142145

143146
static const struct irq_domain_ops odmi_domain_ops = {
147+
.select = msi_lib_irq_domain_select,
144148
.alloc = odmi_irq_domain_alloc,
145149
.free = odmi_irq_domain_free,
146150
};
147151

148-
static struct irq_chip odmi_msi_irq_chip = {
149-
.name = "ODMI",
150-
};
152+
#define ODMI_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS | \
153+
MSI_FLAG_USE_DEF_CHIP_OPS)
151154

152-
static struct msi_domain_ops odmi_msi_ops = {
153-
};
155+
#define ODMI_MSI_FLAGS_SUPPORTED (MSI_GENERIC_FLAGS_MASK)
154156

155-
static struct msi_domain_info odmi_msi_domain_info = {
156-
.flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS),
157-
.ops = &odmi_msi_ops,
158-
.chip = &odmi_msi_irq_chip,
157+
static const struct msi_parent_ops odmi_msi_parent_ops = {
158+
.supported_flags = ODMI_MSI_FLAGS_SUPPORTED,
159+
.required_flags = ODMI_MSI_FLAGS_REQUIRED,
160+
.bus_select_token = DOMAIN_BUS_GENERIC_MSI,
161+
.bus_select_mask = MATCH_PLATFORM_MSI,
162+
.prefix = "ODMI-",
163+
.init_dev_msi_info = msi_lib_init_dev_msi_info,
159164
};
160165

161166
static int __init mvebu_odmi_init(struct device_node *node,
162167
struct device_node *parent)
163168
{
164-
struct irq_domain *parent_domain, *inner_domain, *plat_domain;
169+
struct irq_domain *parent_domain, *inner_domain;
165170
int ret, i;
166171

167172
if (of_property_read_u32(node, "marvell,odmi-frames", &odmis_count))
@@ -208,18 +213,12 @@ static int __init mvebu_odmi_init(struct device_node *node,
208213
goto err_unmap;
209214
}
210215

211-
plat_domain = platform_msi_create_irq_domain(of_node_to_fwnode(node),
212-
&odmi_msi_domain_info,
213-
inner_domain);
214-
if (!plat_domain) {
215-
ret = -ENOMEM;
216-
goto err_remove_inner;
217-
}
216+
irq_domain_update_bus_token(inner_domain, DOMAIN_BUS_GENERIC_MSI);
217+
inner_domain->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT;
218+
inner_domain->msi_parent_ops = &odmi_msi_parent_ops;
218219

219220
return 0;
220221

221-
err_remove_inner:
222-
irq_domain_remove(inner_domain);
223222
err_unmap:
224223
for (i = 0; i < odmis_count; i++) {
225224
struct odmi_data *odmi = &odmis[i];

0 commit comments

Comments
 (0)