diff options
| author | Sasha Levin <sashal@kernel.org> | 2026-10-09 12:32:35 -0400 |
|---|---|---|
| committer | Catalin Marinas <catalin.marinas@arm.com> | 2026-10-12 12:25:06 +0100 |
| commit | 8ea457f746d915d55f78b43d33b1cd618f3d93ad (patch) | |
| tree | 81ce2c349c534b28e1418c27a959b47a189443cc /tools/perf/scripts/python/flamegraph.py | |
| parent | 197a7a41e6e006916fe68c952e96d768933104fe (diff) | |
arm_mpam: make the mon_sel guard conditional only
Building arm64 allmodconfig with clang fails:
drivers/resctrl/mpam_internal.h:207:7: error: ignoring return value
of function declared with 'warn_unused_result' attribute
[-Werror,-Wunused-result]
207 | mpam_mon_sel_lock(_T), mpam_mon_sel_unlock(_T));
mpam_mon_sel_lock() is __must_check and can fail: for an MSC accessed
through the MPAM-Fb firmware interface it returns false when called
from a context that cannot sleep. The mon_sel guard was defined with
DEFINE_GUARD(), which calls it unconditionally and discards the
result, so a guard(mon_sel) user would carry on without the lock and
release it on scope exit. The unconditional guard only exists as the
base for the conditional mon_sel_lock variant, which is the one
actually used.
Define mon_sel_lock directly as a conditional guard class instead, as
posix-timers does for lock_timer: the constructor returns NULL when
the lock cannot be taken, and the destructor only releases a lock
that was taken. ACQUIRE(mon_sel_lock, ...) works as before, including
ACQUIRE_ERR() returning -EBUSY on failure, and there is no
unconditional variant left to misuse.
Reported-by: kernelci.org bot <bot@kernelci.org>
Closes: https://d.kernelci.org/i/maestro:66f869ecbbb5b8592562ffd89f049c5ddf682547
Closes: https://d.kernelci.org/i/maestro:647269216758644837afcaac8e67d8dbe713a0e2
Fixes: 0db1715e4c9c ("arm_mpam: propagate MSC access errors for hw_probe functions")
Assisted-by: LLM
Signed-off-by: Sasha Levin <sashal@kernel.org>
Reviewed-by: Ben Horgan <ben.horgan@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions
