Skip to content

Commit 4834ba5

Browse files
committed
firmware: arm_ffa: Fix kernel warning about incorrect SRI/NPI
JIRA: https://issues.redhat.com/browse/RHEL-102691 commit 0370fb1 Author: Sudeep Holla <sudeep.holla@arm.com> Date: Thu, 18 Apr 2024 11:29:32 +0100 If the firmware returns incorrect SRI/NRI number, we fail to set it up in the kernel which is absolutely fine. However, we don't reset the stashed value of sched_recv or notif_pend IRQs. When we call ffa_notifications_cleanup() in case of failures to setup the notifications, we end up calling free_percpu_irq() from ffa_uninit_pcpu_irq() which results in the following warning: | genirq: Flags mismatch irq 6. 00004401 (ARM-FFA-NPI) vs. 00004400 (IPI) | ARM FF-A: Error registering percpu NPI nIRQ 6 : -16 | ARM FF-A: Notification setup failed -16, not enabled | ------------[ cut here ]------------ | Trying to free already-free IRQ 6 | WARNING: CPU: 2 PID: 1 at kernel/irq/manage.c:2476 __free_percpu_irq+0x6c/0x138 | Modules linked in: | CPU: 2 PID: 1 Comm: swapper/0 Not tainted 6.9.0-rc3 #211 | Hardware name: FVP Base RevC (DT) | pstate: 614000c9 (nZCv daIF +PAN -UAO -TCO +DIT -SSBS BTYPE=--) | pc : __free_percpu_irq+0x6c/0x138 | lr : __free_percpu_irq+0x6c/0x138 | Call trace: | __free_percpu_irq+0x6c/0x138 | free_percpu_irq+0x48/0x84 | ffa_notifications_cleanup+0x78/0x164 | ffa_notifications_setup+0x368/0x3c0 | ffa_init+0x2b4/0x36c | do_one_initcall+0xe0/0x258 | do_initcall_level+0x8c/0xac | do_initcalls+0x54/0x94 | do_basic_setup+0x1c/0x28 | kernel_init_freeable+0x108/0x174 | kernel_init+0x20/0x1a4 | ret_from_fork+0x10/0x20 Fix the same by resetting the stashed copy of IRQ values to 0 in case of any failure to set them up properly. Cc: Jens Wiklander <jens.wiklander@linaro.org> Link: https://lore.kernel.org/r/20240418102932.3093576-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
1 parent 4e84092 commit 4834ba5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/firmware/arm_ffa/driver.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,7 @@ static int ffa_init_pcpu_irq(void)
14351435
if (ret) {
14361436
pr_err("Error registering percpu SRI nIRQ %d : %d\n",
14371437
drv_info->sched_recv_irq, ret);
1438+
drv_info->sched_recv_irq = 0;
14381439
return ret;
14391440
}
14401441
}
@@ -1446,6 +1447,7 @@ static int ffa_init_pcpu_irq(void)
14461447
if (ret) {
14471448
pr_err("Error registering percpu NPI nIRQ %d : %d\n",
14481449
drv_info->notif_pend_irq, ret);
1450+
drv_info->notif_pend_irq = 0;
14491451
return ret;
14501452
}
14511453
}

0 commit comments

Comments
 (0)