From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15843229B32 for ; Fri, 6 Mar 2026 03:16:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772767014; cv=none; b=hID7YfpdID+D1B0deAwhu4Xx5h+J2MsbTMXjeEgsl9qoZvQEGgbpAmhKVieol9YCfq1f9uhN9OMTAxUf3ln8EnCVO51Tso5Ej12ZKGly9ZhAoggkOrphXj8xhrTiixTicYjtXHEpbrycQRulCQf9nEXlLK7vjAcoxljMfAr2mIM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772767014; c=relaxed/simple; bh=5yyPCjXeALENnru/vLLkjQAw8XJRXA6irB3WZpFENk8=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=Mrxe8JVEXw7FA6H3SIXsRpi4cqJi5Epz8Ou60eV/NrMqg6PXqG3I12FOgpgh7T5fF9z21JOnqGW1tsM8IPRhXfcpXMThoL6hFhkLqQKpcLppkzSYVkExMBOwNFEfGWX4cKzxN5Yo7hJmy7ujFEn1zmMCLObcfLP57GwEVx9Ifso= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=TC9qfCtL; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Ko5a8CTr; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="TC9qfCtL"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Ko5a8CTr" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 625KmZEH1809282 for ; Fri, 6 Mar 2026 03:16:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=EpiNNTXiiGQjKHvs+KNiTW jaystmsHApMEyELwmAA1Y=; b=TC9qfCtLGI5lv4FIwJR4jGXs7PSmgcQYVL+Ytu cMuIIdot338/cP7w5LyAatmDLS3dP3HUCaLi/nYCNGovB6MPGNDkbqaNYQ/MYED0 LGA19n9xEAkgK//26IVk9LXMPDqnmhm3Oj2JTaZI7VyY61sl2ONUIZxfn+qT7Lfb 2Ih7A/htvVJPfRACmSiKjFYSqFWcBfZVHPBZeBqX+ysax/9P1KQOpBUQWQ0xfrO6 jhlZbf+H4HrugrQ+mwEvOzUhO0yLGL2KaX3GVvHY4lVtBz0/+SOLx6FL+oGPN9PJ njQUqpIxTd1NNOb93cW+KieZwT/z7+honJv3MNrbOsfdJQag== Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cqgp411g2-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 06 Mar 2026 03:16:51 +0000 (GMT) Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-2ba9a744f7dso10156883eec.0 for ; Thu, 05 Mar 2026 19:16:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1772766855; x=1773371655; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=EpiNNTXiiGQjKHvs+KNiTWjaystmsHApMEyELwmAA1Y=; b=Ko5a8CTr9b0z9bufmgy8fIaurYyfTqQIgb47SO4toiO9trWHdiikj6nyX4dLl3vnSK GUhbdl7IpVzkJqWq/KKy/CfKiYddQeuEPmyza8XIEG/ShDvgWIF03mNyoXmxPwjOZ0G/ B3OxxryY2sLLmzbpTvHvk+fnhntiwzjkUx7TJQPWFMpXYIHhtWk3jt8DyLePItsSkeJY VohafdmlVl3KX2yG61S7XFLzQZbflJo3xZ4UFGF31u7BfSQFA78fxjorLvyK+2Ut/4iI 2enAv/ZpaHsODiDlS1N3Hy1daElrQkrJcR30TpNADbSJFdbMo7tZKD5VIDSs12igmL00 4cvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772766855; x=1773371655; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=EpiNNTXiiGQjKHvs+KNiTWjaystmsHApMEyELwmAA1Y=; b=v9O0rJ3p7KHP5BlhPS3eAiaN1GZTO7pHocsvaeqHql/JikCTBjJC442Y3m+uQPAPp4 BFjuE84pivYh332OFhGoDGW0bZHlijujknRFoInCmZU2zZh+I9vGjSwBSYwqkLDxi400 s7bX+x++xWRTAd9ZRRkaXraQHjISN7fKS2jxgQHBzaUttZSS9DJZXz9fWadJs7ZIc1eN XthFUCS8obQlIueRDbC6CdUcL2mHyMLWbDi+3gPyyGALtCrmhI4kAoeWL+h30Z5yUvw5 9B895wGom7zVlElEYe4oW+w5YV9tizab/r4ZVAlDrZAMk/wAnFzws5NnY3LFYrX+ZE/V 2Agg== X-Forwarded-Encrypted: i=1; AJvYcCUKCfrnU64MSfojZK55NvseiEq1QYSXaMbN5ZLLFlN163QfG0erjxrmrRThcWlTv4VADOKRKPGf2C+sY0E=@vger.kernel.org X-Gm-Message-State: AOJu0YzVMBu3RKHnDKpim4VrYRAzpnq3IorZDvZHFam2j3fn4C0/ZeEz 8eI9RIvDTABIWq7mWVzIN8WP5Tt8R8SVR0w5CO8ixCUah6gaaZpSZI/uPJoLHaOQ1h7eB7GwWI5 UqVSfc6zgWtwHDYE3wjbkd03L6NghfXlLovf369GfuezSS3e3f70kQQ/baNoZwHoIKED3YGHHxg == X-Gm-Gg: ATEYQzzlI5MeLOCh6PCk5m8nzyJbZEIZzlqy3oSE2ncqChst8Tp7nq8WFY82SjDiZuD BXweVgSgG5aMiy65gg8TjjLoSSb2nzXGqjvVvg7mN/o2Pvqwi1rynfiQ1+IvXZ2mq3F3y+u1ul1 vMy3kKzF9NxTGR2Ve5TRWFOAV7P3DbrzB7b+ozMBwyXJEFhHQhlFmrlouBs/XZUGqy0vXdT+22Q 7/lNWSDfRG0tctK+E118dEBXewQtMNkA7saYx8mw0S2iEAwqrX5ddSkLIUwf4HyRCT3gCIhbiDT tYMeFWUUoeQsFe+FwvxoHgXS8yCt3bw04q21GnqDeY+qJALiAwpI6k11P8f9VPfD0E2QffAaMhv 90Mn3s90MOiQmfElMqBS6YAJt14h0PXyaDobsx4E7JS85KGm+eHIagJbYBuMtM/vCgrnXHMfejA == X-Received: by 2002:a05:7300:80cb:b0:2bd:cbc7:16e2 with SMTP id 5a478bee46e88-2be4deaee17mr328257eec.13.1772766854875; Thu, 05 Mar 2026 19:14:14 -0800 (PST) X-Received: by 2002:a05:7300:80cb:b0:2bd:cbc7:16e2 with SMTP id 5a478bee46e88-2be4deaee17mr328243eec.13.1772766854082; Thu, 05 Mar 2026 19:14:14 -0800 (PST) Received: from hu-fruiz-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2be4f82b1d3sm197839eec.11.2026.03.05.19.14.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2026 19:14:13 -0800 (PST) From: Francisco Munoz Ruiz Subject: [PATCH 0/2] Fix slice accounting and simplify descriptor and locking logic Date: Thu, 05 Mar 2026 19:12:04 -0800 Message-Id: <20260305-external_llcc_changes1set-v1-0-6347e52e648e@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAARGqmkC/yWM0QoCIRQFf0Xuc4K6VLS/ssRieqoL4i5eCWHx3 5N6HJiZgwSFITSrgwo+LLzlAfakKLx9fkFzHEzOuIuZzFmjVZTs05pSCOvfESuo+uFhcLUh3ux Eo98Lntx+7+Xe+xfILtxWawAAAA== X-Change-ID: 20260305-external_llcc_changes1set-bae0e71cd913 To: Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Francisco Munoz Ruiz , Unnathi Chalicheemala , Konrad Dybcio X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772766853; l=1936; i=francisco.ruiz@oss.qualcomm.com; s=20260305; h=from:subject:message-id; bh=5yyPCjXeALENnru/vLLkjQAw8XJRXA6irB3WZpFENk8=; b=gCZId9Xaon7Rlsem7cGihiGL4kMdmTcKSdOUClpm2CXSIvYXOj8eIWTKdVi653uxKTJ/cJf2Q LJLH3Opz8UeAuAArWTlC7pssd5W6jqc+tRkSIiAAQI7D7KJr5MppGn8 X-Developer-Key: i=francisco.ruiz@oss.qualcomm.com; a=ed25519; pk=Gcv2CX7iHozjnQ4oK+9fINmBiQTmVC4SpaZzoM63CHE= X-Proofpoint-ORIG-GUID: -Qoe_flSzkh0Ky8YIlaKonLqXKgSac3Z X-Authority-Analysis: v=2.4 cv=LegxKzfi c=1 sm=1 tr=0 ts=69aa4723 cx=c_pps a=PfFC4Oe2JQzmKTvty2cRDw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=A5hwTvu5O6tIpGgoCuUA:9 a=QEXdDO2ut3YA:10 a=6Ab_bkdmUrQuMsNx7PHu:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzA2MDAyOSBTYWx0ZWRfX8bou6G5gQjAQ bU7tvBRpkMpPcqIQyme6vVSGq3No1DpOiAEzUYAF3wMxpjbj0CtoPtXxJIZGOS528LgjbKkR/V6 cZOVRC2DsrlikXzelRI4mB+BTbF/vp82sqsk4gT06rBWtR8tbc/83RIJtj4NnLOchxC2dlxb3iv 1cMpmGu2gBlDhsQ1Nq+uB5C1kflhrbXLkotgXwZoxC6KtvoFv3rdgKq7WVPjGf1iin5pC8V429O 15Rf5OzjQ2+nDQVDHVJaMlcZZ31CtjxEh6ccRebzCWasTyZkUhqxuztVg2ez594badGy5Ww42FV PJe/NNLSFYQq+8ul63V4xMiZSfFSxFO9Imidw8a6VsYsi9Z6Vr/EmEBFMehFF/+I45+stNbgFxT PGqlJP5rsZ5zH0qoGMtgQzQ3GH2POgtWlQxndUmDIH5BJdJxwZFaJQ1cibqTgS2NTGjwQDso9hR mSTz/5ib7dZ0EwDO4Og== X-Proofpoint-GUID: -Qoe_flSzkh0Ky8YIlaKonLqXKgSac3Z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-06_01,2026-03-04_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 bulkscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2603060029 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 --- 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