Seems that the error is not actually about the meson side (although also that might need attention, as we are still using your meson 1.9.0 build file, instead of the 1.9.3)
The error is due to thinking some errors as transient and not disabling them at the (first) failure.
We are specifically in some 23.05 device suffering from EINVAL error.
this is from my R7800, log and strace for one interrupt (48):
Sat Dec 9 10:17:27 2023 daemon.warn irqbalance: Cannot change IRQ 53 affinity: Invalid argument
Sat Dec 9 10:17:27 2023 daemon.warn irqbalance: Cannot change IRQ 24 affinity: I/O error
Sat Dec 9 10:17:27 2023 daemon.warn irqbalance: IRQ 24 affinity is now unmanaged
Sat Dec 9 10:17:27 2023 daemon.warn irqbalance: Cannot change IRQ 48 affinity: Invalid argument
open("/proc/irq/48/smp_affinity", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 6
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ed9000
ioctl(6, TIOCGWINSZ, 0xbeb134e8) = -1 ENOTTY (Not a tty)
writev(6, [{iov_base="00000001", iov_len=8}, {iov_base=NULL, iov_len=0}], 2) = -1 EINVAL (Invalid argument)
close(6) = 0
munmap(0xb6ed9000, 4096) = 0
clock_gettime64(CLOCK_REALTIME, {tv_sec=1702109847, tv_nsec=340549081}) = 0
sendto(5, "<28>Dec 9 08:17:27 irqbalance: "..., 80, 0, NULL, 0) = 80
writev(1, [{iov_base="Cannot change IRQ 48 affinity: I"..., iov_len=47}, {iov_base="\n", iov_len=1}], 2Cannot change IRQ 48 affinity: Invalid argument
) = 48
Changing EINVAL to be a permanent error fixes it, and reverts to the earlier behaviour:
--- a/activate.c
+++ b/activate.c
@@ -98,11 +98,11 @@ error:
case ENOSPC: /* Specified CPU APIC is full. */
case EAGAIN: /* Interrupted by signal. */
case EBUSY: /* Affinity change already in progress. */
- case EINVAL: /* IRQ would be bound to no CPU. */
case ERANGE: /* CPU in mask is offline. */
case ENOMEM: /* Kernel cannot allocate CPU mask. */
/* Do not blacklist the IRQ on transient errors. */
break;
+ case EINVAL: /* IRQ would be bound to no CPU. */
default:
/* Any other error is considered permanent. */
info->flags |= IRQ_FLAG_AFFINITY_UNMANAGED;
I will probably add that as a quick fix for 23.05, but I wonder why the unpatched 1.9.3 seemed to work in main/master build for R7800.
EDIT: