Skip to content

Fix slice accounting and simplify descriptor and locking logic

Francisco Munoz Ruiz linux-arm-msm lkml 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am 20260305-external_llcc_changes1set-v1-0-6347e52e648e@oss.qualcomm.com change-id 20260305-external_llcc_changes1set-bae0e71cd913

Versions newest first

  1. v1 Latest2 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2soc: qcom: llcc: Add per-slice counter and common llcc slice descriptordrivers/soc/qcom/llcc-qcom.c include/linux/soc/qcom/llcc-qcom.h+32 -330 replies
2/2soc: qcom: llcc: Use guards for mutex handlingdrivers/soc/qcom/llcc-qcom.c+8 -200 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchKonrad Dybcio
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] Fix slice accounting and simplify descriptor and locking logic

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

---
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,

Signature · 1 line
Francisco Munoz Ruiz <[email protected]>