1
0
Fork 0

fix: check for EPERM when setting IRQ affinity

Kernel version v6.12 changed the return code of the
write_irq_affinity() function in case if affinity cannot
be set for the specified IRQ. Used to be EIO, now it's EPERM.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eb29369fa543e7d5557c19ebecf072244bb14815

Resolves: RHEL-153655
This commit is contained in:
Fothsid 2026-03-05 13:31:47 +01:00
parent 38d4414a85
commit 00592c2f0c

View file

@ -1317,12 +1317,13 @@ class SchedulerPlugin(base.Plugin):
f.write(affinity_hex)
return 0
except (OSError, IOError) as e:
# EIO is returned by
# EPERM is returned by
# kernel/irq/proc.c:write_irq_affinity() if changing
# the affinity is not supported
# (at least on kernels 3.10 and 4.18)
if hasattr(e, "errno") and e.errno == errno.EIO \
and not restoring:
# Before kernel v6.12, write_irq_affinity() returned EIO
# instead of EPERM, hence the check for both error codes.
if hasattr(e, "errno") and (e.errno == errno.EIO \
or e.errno == errno.EPERM) and not restoring:
log.debug("Setting SMP affinity of IRQ %s is not supported"
% irq)
return -2