Merge tag 'irq-urgent-2021-12-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq fixes from Thomas Gleixner:
"A set of interrupt chip driver fixes:

- Fix the multi vector MSI allocation on Armada 370XP

- Do interrupt acknowledgement correctly in the aspeed-scu driver

- Make the IPR register offset correct in the NVIC driver

- Make redistribution table flushing correct by issueing a SYNC
command to ensure that the invalidation command has been executed

- Plug a device tree node reference leak in the bcm7210-l2 driver

- Trivial fixes in the MIPS GIC and the Apple AIC drivers"

* tag 'irq-urgent-2021-12-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
irqchip/irq-bcm7120-l2: Add put_device() after of_find_device_by_node()
irqchip/irq-gic-v3-its.c: Force synchronisation when issuing INVALL
irqchip/apple-aic: Mark aic_init_smp() as __init
irqchip: nvic: Fix offset for Interrupt Priority Offsets
irqchip/mips-gic: Use bitfield helpers
irqchip/aspeed-scu: Replace update_bits with write_bits.
irqchip/armada-370-xp: Fix support for Multi-MSI interrupts
irqchip/armada-370-xp: Fix return value of armada_370_xp_msi_alloc()

+1 -1
drivers/irqchip/irq-apple-aic.c
··· 707 707 .free = aic_ipi_free, 708 708 }; 709 709 710 - static int aic_init_smp(struct aic_irq_chip *irqc, struct device_node *node) 710 + static int __init aic_init_smp(struct aic_irq_chip *irqc, struct device_node *node) 711 711 { 712 712 struct irq_domain *ipi_domain; 713 713 int base_ipi;
+7 -11
drivers/irqchip/irq-armada-370-xp.c
··· 232 232 int hwirq, i; 233 233 234 234 mutex_lock(&msi_used_lock); 235 - 236 - hwirq = bitmap_find_next_zero_area(msi_used, PCI_MSI_DOORBELL_NR, 237 - 0, nr_irqs, 0); 238 - if (hwirq >= PCI_MSI_DOORBELL_NR) { 239 - mutex_unlock(&msi_used_lock); 240 - return -ENOSPC; 241 - } 242 - 243 - bitmap_set(msi_used, hwirq, nr_irqs); 235 + hwirq = bitmap_find_free_region(msi_used, PCI_MSI_DOORBELL_NR, 236 + order_base_2(nr_irqs)); 244 237 mutex_unlock(&msi_used_lock); 238 + 239 + if (hwirq < 0) 240 + return -ENOSPC; 245 241 246 242 for (i = 0; i < nr_irqs; i++) { 247 243 irq_domain_set_info(domain, virq + i, hwirq + i, ··· 246 250 NULL, NULL); 247 251 } 248 252 249 - return hwirq; 253 + return 0; 250 254 } 251 255 252 256 static void armada_370_xp_msi_free(struct irq_domain *domain, ··· 255 259 struct irq_data *d = irq_domain_get_irq_data(domain, virq); 256 260 257 261 mutex_lock(&msi_used_lock); 258 - bitmap_clear(msi_used, d->hwirq, nr_irqs); 262 + bitmap_release_region(msi_used, d->hwirq, order_base_2(nr_irqs)); 259 263 mutex_unlock(&msi_used_lock); 260 264 } 261 265
+2 -2
drivers/irqchip/irq-aspeed-scu-ic.c
··· 76 76 generic_handle_domain_irq(scu_ic->irq_domain, 77 77 bit - scu_ic->irq_shift); 78 78 79 - regmap_update_bits(scu_ic->scu, scu_ic->reg, mask, 80 - BIT(bit + ASPEED_SCU_IC_STATUS_SHIFT)); 79 + regmap_write_bits(scu_ic->scu, scu_ic->reg, mask, 80 + BIT(bit + ASPEED_SCU_IC_STATUS_SHIFT)); 81 81 } 82 82 83 83 chained_irq_exit(chip, desc);
+1
drivers/irqchip/irq-bcm7120-l2.c
··· 238 238 } 239 239 240 240 data->num_parent_irqs = platform_irq_count(pdev); 241 + put_device(&pdev->dev); 241 242 if (data->num_parent_irqs <= 0) { 242 243 pr_err("invalid number of parent interrupts\n"); 243 244 ret = -ENOMEM;
+1 -1
drivers/irqchip/irq-gic-v3-its.c
··· 742 742 743 743 its_fixup_cmd(cmd); 744 744 745 - return NULL; 745 + return desc->its_invall_cmd.col; 746 746 } 747 747 748 748 static struct its_vpe *its_build_vinvall_cmd(struct its_node *its,
+2 -2
drivers/irqchip/irq-mips-gic.c
··· 9 9 10 10 #define pr_fmt(fmt) "irq-mips-gic: " fmt 11 11 12 + #include <linux/bitfield.h> 12 13 #include <linux/bitmap.h> 13 14 #include <linux/clocksource.h> 14 15 #include <linux/cpuhotplug.h> ··· 736 735 mips_gic_base = ioremap(gic_base, gic_len); 737 736 738 737 gicconfig = read_gic_config(); 739 - gic_shared_intrs = gicconfig & GIC_CONFIG_NUMINTERRUPTS; 740 - gic_shared_intrs >>= __ffs(GIC_CONFIG_NUMINTERRUPTS); 738 + gic_shared_intrs = FIELD_GET(GIC_CONFIG_NUMINTERRUPTS, gicconfig); 741 739 gic_shared_intrs = (gic_shared_intrs + 1) * 8; 742 740 743 741 if (cpu_has_veic) {
+1 -1
drivers/irqchip/irq-nvic.c
··· 26 26 27 27 #define NVIC_ISER 0x000 28 28 #define NVIC_ICER 0x080 29 - #define NVIC_IPR 0x300 29 + #define NVIC_IPR 0x400 30 30 31 31 #define NVIC_MAX_BANKS 16 32 32 /*