Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Francisco Munoz Ruiz <francisco.ruiz@oss.qualcomm.com>
To: Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Francisco Munoz Ruiz <francisco.ruiz@oss.qualcomm.com>,
	Unnathi Chalicheemala <unnathi.chalicheemala@oss.qualcomm.com>,
	Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Subject: [PATCH 0/2] Fix slice accounting and simplify descriptor and locking logic
Date: Thu, 05 Mar 2026 19:12:04 -0800	[thread overview]
Message-ID: <20260305-external_llcc_changes1set-v1-0-6347e52e648e@oss.qualcomm.com> (raw)

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@oss.qualcomm.com>
---
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@oss.qualcomm.com>


             reply	other threads:[~2026-03-06  3:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06  3:12 Francisco Munoz Ruiz [this message]
2026-03-06  3:12 ` [PATCH 1/2] soc: qcom: llcc: Add per-slice counter and common llcc slice descriptor Francisco Munoz Ruiz
2026-03-06  3:12 ` [PATCH 2/2] soc: qcom: llcc: Use guards for mutex handling Francisco Munoz Ruiz
2026-03-16  2:02 ` [PATCH 0/2] Fix slice accounting and simplify descriptor and locking logic Bjorn Andersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260305-external_llcc_changes1set-v1-0-6347e52e648e@oss.qualcomm.com \
    --to=francisco.ruiz@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=unnathi.chalicheemala@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox