[PATCH 0/2] Fix slice accounting and simplify descriptor and locking logic
From: Francisco Munoz Ruiz
Date: Thu Mar 05 2026 - 22:20:20 EST
Hi all,
This series addresses correctness issues in the LLCC slice
activation logic and simplifies both descriptor management and
locking within the driver.
Patch 1 fixes incorrect slice activation and deactivation
accounting. The current bitmap-based scheme fails when multiple
client drivers vote for the same slice or when
llcc_slice_getd() is called multiple times. This can lead to
mismatched activation and deactivation pairs and incorrect slice
state.
To address this, the patch replaces the bitmap with per-slice
atomic reference counters. This ensures that activation and
deactivation always match, regardless of how many users share a
slice or how often a client requests it. The patch also removes
dynamic allocation from the slice descriptor path. Instead,
llcc_slice_getd() now returns a pointer to a preallocated
descriptor, ensuring consistent lifetime and eliminating repeated
allocation and free cycles.
Patch 2 replaces manual lock and unlock pairs with the guard()
pattern. This removes the need for explicit unlock handling and
ensures the lock is always released, even on early returns. The
control flow becomes simpler and less error-prone.
Together, these changes make LLCC slice management more robust,
simpler, and easier to maintain.
Thanks,
Francisco
Signed-off-by: Francisco Munoz Ruiz <francisco.ruiz@xxxxxxxxxxxxxxxx>
---
Unnathi Chalicheemala (2):
soc: qcom: llcc: Add per-slice counter and common llcc slice descriptor
soc: qcom: llcc: Use guards for mutex handling
drivers/soc/qcom/llcc-qcom.c | 81 ++++++++++++++++----------------------
include/linux/soc/qcom/llcc-qcom.h | 8 ++--
2 files changed, 38 insertions(+), 51 deletions(-)
---
base-commit: 3f9cd19e764b782706dbaacc69e502099cb014ba
change-id: 20260305-external_llcc_changes1set-bae0e71cd913
Best regards,
--
Francisco Munoz Ruiz <francisco.ruiz@xxxxxxxxxxxxxxxx>