diff options
author | Jonathan Corbet <corbet@lwn.net> | 2024-09-05 14:01:38 -0600 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2024-09-05 14:01:38 -0600 |
commit | d224338aa105bf3c4c4aa8b2ccdbd675c71ffbfe (patch) | |
tree | b7b6b8c98595c89f7ad5307120cb3156708991bc /drivers/irqchip/irq-riscv-aplic-msi.c | |
parent | eb5ed2fae19745fcb7dd0dcfbfbcd8b2847bc5c1 (diff) | |
parent | 431c1646e1f86b949fa3685efc50b660a364c2b6 (diff) | |
download | lwn-d224338aa105bf3c4c4aa8b2ccdbd675c71ffbfe.tar.gz lwn-d224338aa105bf3c4c4aa8b2ccdbd675c71ffbfe.zip |
Merge tag 'v6.11-rc6' into docs-mw
This is done primarily to get a docs build fix merged via another tree so
that "make htmldocs" stops failing.
Diffstat (limited to 'drivers/irqchip/irq-riscv-aplic-msi.c')
-rw-r--r-- | drivers/irqchip/irq-riscv-aplic-msi.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/drivers/irqchip/irq-riscv-aplic-msi.c b/drivers/irqchip/irq-riscv-aplic-msi.c index 028444af48bd..d7773f76e5d0 100644 --- a/drivers/irqchip/irq-riscv-aplic-msi.c +++ b/drivers/irqchip/irq-riscv-aplic-msi.c @@ -32,15 +32,10 @@ static void aplic_msi_irq_unmask(struct irq_data *d) aplic_irq_unmask(d); } -static void aplic_msi_irq_eoi(struct irq_data *d) +static void aplic_msi_irq_retrigger_level(struct irq_data *d) { struct aplic_priv *priv = irq_data_get_irq_chip_data(d); - /* - * EOI handling is required only for level-triggered interrupts - * when APLIC is in MSI mode. - */ - switch (irqd_get_trigger_type(d)) { case IRQ_TYPE_LEVEL_LOW: case IRQ_TYPE_LEVEL_HIGH: @@ -59,6 +54,29 @@ static void aplic_msi_irq_eoi(struct irq_data *d) } } +static void aplic_msi_irq_eoi(struct irq_data *d) +{ + /* + * EOI handling is required only for level-triggered interrupts + * when APLIC is in MSI mode. + */ + aplic_msi_irq_retrigger_level(d); +} + +static int aplic_msi_irq_set_type(struct irq_data *d, unsigned int type) +{ + int rc = aplic_irq_set_type(d, type); + + if (rc) + return rc; + /* + * Updating sourcecfg register for level-triggered interrupts + * requires interrupt retriggering when APLIC is in MSI mode. + */ + aplic_msi_irq_retrigger_level(d); + return 0; +} + static void aplic_msi_write_msg(struct irq_data *d, struct msi_msg *msg) { unsigned int group_index, hart_index, guest_index, val; @@ -130,7 +148,7 @@ static const struct msi_domain_template aplic_msi_template = { .name = "APLIC-MSI", .irq_mask = aplic_msi_irq_mask, .irq_unmask = aplic_msi_irq_unmask, - .irq_set_type = aplic_irq_set_type, + .irq_set_type = aplic_msi_irq_set_type, .irq_eoi = aplic_msi_irq_eoi, #ifdef CONFIG_SMP .irq_set_affinity = irq_chip_set_affinity_parent, |