A RISC-V irqchip driver fix.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmX2stURHG1pbmdvQGtl
 cm5lbC5vcmcACgkQEnMQ0APhK1jRaBAAh9ZKRYWq0lB5HPWTgjFRoMcdJszkqArj
 5j5gIjIPMSKXaZOwrYZmgaXN252Pv7QrbdUnBFz8b52H5Wh7AV99GdgrV2XSgjf3
 HtMq7QK98k0lJYIPRlY7mhGxVewYOEs+GoBtzGTQoidG+Cx+PVe6I1fgkvO/6Uki
 F9HXeJJYN/IFA2y9NGb+6XRTQeXYLjOjwDB/1M3lTCDFyyZcTCuhBGM0k4BCQ/dx
 p+4ibhkb17P+QCYgiv7uTL/FZEVF5tdzjDf5ZH+7+cblcaswLTTkV4ZE7t30S+Nt
 wWfpCY1Km+AP/ndImakgr/YgL/SoGa85X+bRLHAQNCvyP81Wbrlrf/hkTQqXxdKH
 oFqGlL7mWNBjtfszG0hrK5i6THXEHb+fVffj69OkvBD4O+f4tBVwznxysJ7i5lU0
 IPXoTce/CkYJ9Kx3ZihhkEt+lVVN3KhXsuhtZRqwweNHUtziGwy2eKMIggi0AM0x
 +Z90Y9r+G6wu0DxetLF0KICeOn8xjlXaaeGEqyT50jKbUpdwExHeDVADQ/PwtcLB
 G1TYSKoem/1h+ghDgltgNNk57j7M0j8soGeIC/91mfGW6ZuSGhvu8P8bFRPcYAt6
 3d2XAYQ30kwmEuDlFFHZSunu9lQDtp/K0qvoxoQx71qncrSF8G6KLPvSMRu2j5xU
 kIHwHdw/ILc=
 =Pvlh
 -----END PGP SIGNATURE-----

Merge tag 'irq-urgent-2024-03-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq fix from Ingo Molnar:
 "A RISC-V irqchip driver fix"

* tag 'irq-urgent-2024-03-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  irqchip/riscv-intc: Fix use of AIA interrupts 32-63 on riscv32
This commit is contained in:
Linus Torvalds 2024-03-18 09:10:44 -07:00
commit 4ae3dc83b0

View File

@ -149,8 +149,9 @@ static int riscv_intc_domain_alloc(struct irq_domain *domain,
* Only allow hwirq for which we have corresponding standard or
* custom interrupt enable register.
*/
if ((hwirq >= riscv_intc_nr_irqs && hwirq < riscv_intc_custom_base) ||
(hwirq >= riscv_intc_custom_base + riscv_intc_custom_nr_irqs))
if (hwirq >= riscv_intc_nr_irqs &&
(hwirq < riscv_intc_custom_base ||
hwirq >= riscv_intc_custom_base + riscv_intc_custom_nr_irqs))
return -EINVAL;
for (i = 0; i < nr_irqs; i++) {
@ -183,10 +184,12 @@ static int __init riscv_intc_init_common(struct fwnode_handle *fn, struct irq_ch
return -ENXIO;
}
if (riscv_isa_extension_available(NULL, SxAIA))
if (riscv_isa_extension_available(NULL, SxAIA)) {
riscv_intc_nr_irqs = 64;
rc = set_handle_irq(&riscv_intc_aia_irq);
else
} else {
rc = set_handle_irq(&riscv_intc_irq);
}
if (rc) {
pr_err("failed to set irq handler\n");
return rc;
@ -195,7 +198,7 @@ static int __init riscv_intc_init_common(struct fwnode_handle *fn, struct irq_ch
riscv_set_intc_hwnode_fn(riscv_intc_hwnode);
pr_info("%d local interrupts mapped%s\n",
riscv_isa_extension_available(NULL, SxAIA) ? 64 : riscv_intc_nr_irqs,
riscv_intc_nr_irqs,
riscv_isa_extension_available(NULL, SxAIA) ? " using AIA" : "");
if (riscv_intc_custom_nr_irqs)
pr_info("%d custom local interrupts mapped\n", riscv_intc_custom_nr_irqs);