[PATCH v2 0/6] powerpc: use lock guards for mutex Set 1

From: Shrikanth Hegde
Date: Fri Mar 14 2025 - 07:45:46 EST


This is an effort to make the code simpler by making use of lock
guards which were introduced in [1], which works by using __cleanup
attributes. More details in v1 cover letter

This series aims mainly at simplifying code around mutex with goto
statements. If it makes sense, there are more code simplification which
can done for preempt, rcu, spinlock as well. Even for mutex, there is
more which could be done. Even there are usecases for kfree which could
use the new __free infra.

Please review. Code is compile/boot tested except for powernv.
Have kept the patches separate for easier bisect. Let me if they should
be combined into one. Commit message is same for all.

[1]: https://lkml.kernel.org/r/20230612093537.614161713%40infradead.org
v1: https://lore.kernel.org/all/20250314054544.1998928-1-sshegde@xxxxxxxxxxxxx/#t

v1->v2:
- Fix changelog of powernv (Andrew Donnellan)
- use scoped_guard in couple of places to avoid holding mutex
un-necessarily (Peter Zijlstra)

Shrikanth Hegde (6):
powerpc: eeh: use lock guard for mutex
powerpc: rtas: use lock guard for mutex
powerpc: fadump: use lock guard for mutex
powerpc: book3s: vas: use lock guard for mutex
powerpc: powernv: ocxl: use lock guard for mutex
powerpc: sysdev: use lock guard for mutex

arch/powerpc/kernel/eeh.c | 20 +++----
arch/powerpc/kernel/fadump.c | 11 ++--
arch/powerpc/kernel/rtas_flash.c | 64 +++++++--------------
arch/powerpc/platforms/book3s/vas-api.c | 32 +++++------
arch/powerpc/platforms/powernv/ocxl.c | 12 +---
arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c | 8 +--
6 files changed, 48 insertions(+), 99 deletions(-)

--
2.39.3