From nobody Tue Dec 2 02:52:38 2025 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 73CFF3043B9 for ; Tue, 18 Nov 2025 08:52:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763455974; cv=none; b=oqz9ilZk2Ay9W5isAfsOMAPY6oY1WvqafBHIAJkhyl5fgaXQ03RRUhZ1mc04NcTOH5Mthv9LVJxYz/QC10W6VUJd/cwM70f8t+1/sJJBqwEh4kLQvYiNk2exqPGDGz2vQ+/K//geTRcZDNKmBL5uFYm7cOs9XJ++OXFFwGaeMpw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763455974; c=relaxed/simple; bh=vKTta3TyeGhxCas1ssgEN2kljhDiG+toGTM3SStGt9c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GeMQhDXSE1CxTAXXI3ABMTw9IB6V6nkc4tZmclJTAFPjPUeSdzXZL2Ugb3ZG5a/rChUENyzhvdz+i1Ba/KMKwobJNu/Prk75GKb7L0NpM/YiPL0i1AJCuQBDJp6cgjku3Uyc7zWKx5OKsxXqnVAVLrrXqJqB+y/LYpSpnV+zD+k= 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=C6Wl2jGT; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Dxo0DoYn; arc=none smtp.client-ip=205.220.168.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="C6Wl2jGT"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Dxo0DoYn" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AI2jpoB027447 for ; Tue, 18 Nov 2025 08:52:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= J/LS6JB3TR9Jq5PNnoArY9FVy6stZEsKrBfA/VJEO2c=; b=C6Wl2jGTF83SghDw cjpCfqtoBfgYeZlVvyVZyJymt5wmM6PXfDeqK/2pFfV7Tva0gu8TScDTvoOTH2Ya kIxiqmrzfD31BQHCiKybYdtfDmBxY4vPcc1wZnXyi/U6X6R+uNHsCTKu9/QVycOv 2LchNttPmewBb5164oDXNA1jBU8emZyAGb/CorvOhTPd1XPUccfU8R24ulOHW0fR DRRYC6kZo3hrxloK9K1+RMccykIHzZq/XPVrvBmKYqjD8nahfqJsMlXnh3+lLzkz C31R3yIyWDNs6pAByqT5gTBxTmfmuMBqHLdcAgLutby8n7FBSOZXTdfI5hckgz+b P/Zovg== Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ag77t2ejf-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 18 Nov 2025 08:52:51 +0000 (GMT) Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-b630753cc38so11399553a12.1 for ; Tue, 18 Nov 2025 00:52:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1763455971; x=1764060771; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=J/LS6JB3TR9Jq5PNnoArY9FVy6stZEsKrBfA/VJEO2c=; b=Dxo0DoYn0kSaWprAu5MRDkaxsedtwhE623kh8G3BGmh7TZvutfQxMNAvX692AukJeT 6WaInrUUtaL4vLYs95jxOBuxvMA6K8IA/LEVBwhYYPOsQ17J4VnrM7/YQD9LmYMsArK4 +CsfMjTM926Xf77S/hK9KJzdyvEiD6tv76Ml8wq1EKDwPsCrL8j3kQzRRc8Csg790aAr HlSThMJx/A1ajMG0kzX1B9okMesVal0nEMjvj7vnD+95xfqZoEWOGJ26w8KE/a6nY9q1 p0lmdEes5Zwn3XTYMDGVamQ665xqrTBGxWncKZG3OGwAK1hnBLYH+szGUVwEVLT8yX+q FTKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763455971; x=1764060771; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=J/LS6JB3TR9Jq5PNnoArY9FVy6stZEsKrBfA/VJEO2c=; b=p1r6ic0FTsC734kRizwT92RcTrcGRbuN1az09KoUCStJsMNsmyysssWngUMHmMS+XJ vXbL4clMpqYCm7sJJuZUy0MEsrvs8DraP5vwJDaR900NJIlZlPCMA5bDgrVDMroteVkc suBHl6b37Ccaiw/EQuA3RONAd8Ppx2k6M07CLaWsOcGwObI4052Ru3SzX13Q06ZoHm9c xB2vZ1ziTHaFAVzec1ou8a/Vd2p20mnYAsFMG6fthq95ZV8iyV5xDIKjW7LdgT76jvTw 4IcY7lFxZYj/nl5fGhprZCCEQai+pf0w8uPGJ0s70RO9VNZmgtgjqEJvVJvt4KAWPhBt IKSQ== X-Forwarded-Encrypted: i=1; AJvYcCVhPPZu/sute8voo+uWjmilqIX4TbFLpXqQvlfNqu97XSPd4CeUfev+dqt2gAic+2Gr+o5AxQRDY9pvoSM=@vger.kernel.org X-Gm-Message-State: AOJu0Yzd7Ba2hLbkE8mM2+Jy6Zd5eNR3PUH1autLIyj/fnkEW5+ZMBtX TCNSFblPX2DBK4ivRDI+ViuAmOn8ridx/Gk7chw15XFGbXPLqKcaxQs4uoGLZWbBxeww+rNFc7w yGfElMd+emmFdBjF4iDwoSjMPh4WeovjkJYQto9UDG6EbqpoJz8TdL7uGWeT/m9VJhzY= X-Gm-Gg: ASbGncv1giNO1W9B3iueE5WnNHyJCOvtAD1dOMZbcKUniHnVwDZb9UOzdWaPwYlN7nI EIQ2k/HV1m2VU4Xqj/1Ma1dzcyFmaS3khEi9HKHpUQ6Boc4yuRHV64L4V79OsJogHmYlHdIs+0H cERPP1yUZUD75c5WxftB5rt1MMg7t+mIYDuVPgdG5GWfizpPFybyripLlVpTTI9OZvi6hLC0Njz 4OYL26dlILtvm/EUYf9RBw183otccz1qPsx0/ME4cDKLQvzw5vHbIyOd/6koi2FGDaCj11KlJZT Box1vr1dxvvEryGKRGrMeVf7rS3hnyqKBRIpZDxCkxObIgOzk+oTcc2L3QRYw4qPAyHWBRWlxj5 fv5ighsUgOgK8Iyq4071C8L8= X-Received: by 2002:a17:903:2b07:b0:295:2cb6:f4a8 with SMTP id d9443c01a7336-2986a76a1edmr156640675ad.51.1763455971200; Tue, 18 Nov 2025 00:52:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHd2hB7SzLzqaWuYwjQZyt6QMGhA+S+3S+Uo1umciwE5IFO5bu8yrxyvQu4iby3vFSrcek1bA== X-Received: by 2002:a17:903:2b07:b0:295:2cb6:f4a8 with SMTP id d9443c01a7336-2986a76a1edmr156640325ad.51.1763455970710; Tue, 18 Nov 2025 00:52:50 -0800 (PST) Received: from hu-akhilpo-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2985c2568c1sm162910695ad.47.2025.11.18.00.52.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Nov 2025 00:52:50 -0800 (PST) From: Akhil P Oommen Date: Tue, 18 Nov 2025 14:20:39 +0530 Subject: [PATCH v4 12/22] drm/msm/a6xx: Improve MX rail fallback in RPMH vote init 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: quoted-printable Message-Id: <20251118-kaana-gpu-support-v4-12-86eeb8e93fb6@oss.qualcomm.com> References: <20251118-kaana-gpu-support-v4-0-86eeb8e93fb6@oss.qualcomm.com> In-Reply-To: <20251118-kaana-gpu-support-v4-0-86eeb8e93fb6@oss.qualcomm.com> To: Rob Clark , Bjorn Andersson , Konrad Dybcio , Sean Paul , Dmitry Baryshkov , Abhinav Kumar , Jessica Zhang , Marijn Suijten , David Airlie , Simona Vetter , Jonathan Marek , Jordan Crouse , Will Deacon , Robin Murphy , Joerg Roedel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Connor Abbott Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Akhil P Oommen , Konrad Dybcio X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1763455868; l=3011; i=akhilpo@oss.qualcomm.com; s=20240726; h=from:subject:message-id; bh=vKTta3TyeGhxCas1ssgEN2kljhDiG+toGTM3SStGt9c=; b=RTi8VnHIWT8h3mjbCRZH3IO6SGjoieTo5yBHNHvoxtwhuGebkSTBl9jpJvKg+l0B9GXKeOno1 bZ6HLGu4TV+AIaAEzsslZ9XMqZdc5d/c7TXsVihukbzwTQYTIb92Dha X-Developer-Key: i=akhilpo@oss.qualcomm.com; a=ed25519; pk=lmVtttSHmAUYFnJsQHX80IIRmYmXA4+CzpGcWOOsfKA= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTE4MDA2OSBTYWx0ZWRfX+Q1ymVTfsMIJ 0Ex3dIS5gHAkwwIHiVcSAs5FPXl01ara6sPpCAMWh9dyrKzTu0aa/LUcXxya+xCuoRaP7tFvGY6 AeEfgt576P073NGh1q4KWIwicnbStEf5qaimpX43vY7IUb6g81SyyL9z9WfQnnSj6CavLtxZxp2 FrsFunLFYZe4IPhIjaD68BcyGjbDMTV4QuTFUQ3AfglV5svNRGCRweFByrPx2aT1/uWIIVXOU/e E4z3hygtYN4TG44buy0YSR1YApllwDEQp56gIOkDoTi0gB264OyJVel9/zQuT0iisTjlrlrCSYg r4zqEqikkiPYQWfoQlTW4wvVb2aJ/xvGMe9MuqIkLcZtdTPndY6L/c5eYPjy3EXX8aZ5zzX14zU YoR3xvPiNspFR/O/T33Yt3Al8SqisA== X-Authority-Analysis: v=2.4 cv=EPoLElZC c=1 sm=1 tr=0 ts=691c33e3 cx=c_pps a=Qgeoaf8Lrialg5Z894R3/Q==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=feIks7WodE12ze-Om1wA:9 a=QEXdDO2ut3YA:10 a=x9snwWr2DeNwDh03kgHS:22 X-Proofpoint-ORIG-GUID: hp0KVzyOfZio4cxg2iAVr5z2M1fpEEdH X-Proofpoint-GUID: hp0KVzyOfZio4cxg2iAVr5z2M1fpEEdH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-17_04,2025-11-13_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 spamscore=0 clxscore=1015 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511180069 Current logic assumes that the voltage corners in both MxG and MxA are always same. This is not true for recent targets. So, rework the rpmh init sequence to probe and calculate the votes with the respective rails, ie, GX rails should use MxG as secondary rail and Cx rail should use MxA as the secondary rail. Fixes: d6225e0cd096 ("drm/msm/adreno: Add support for X185 GPU") Reviewed-by: Konrad Dybcio Signed-off-by: Akhil P Oommen --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/ad= reno/a6xx_gmu.c index e566f3b7eab4..b76960c6d444 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -1544,13 +1544,14 @@ static unsigned int a6xx_gmu_get_arc_level(struct d= evice *dev, } =20 static int a6xx_gmu_rpmh_arc_votes_init(struct device *dev, u32 *votes, - unsigned long *freqs, int freqs_count, const char *id) + unsigned long *freqs, int freqs_count, + const char *pri_id, const char *sec_id) { int i, j; const u16 *pri, *sec; size_t pri_count, sec_count; =20 - pri =3D cmd_db_read_aux_data(id, &pri_count); + pri =3D cmd_db_read_aux_data(pri_id, &pri_count); if (IS_ERR(pri)) return PTR_ERR(pri); /* @@ -1561,13 +1562,7 @@ static int a6xx_gmu_rpmh_arc_votes_init(struct devic= e *dev, u32 *votes, if (!pri_count) return -EINVAL; =20 - /* - * Some targets have a separate gfx mxc rail. So try to read that first a= nd then fall back - * to regular mx rail if it is missing - */ - sec =3D cmd_db_read_aux_data("gmxc.lvl", &sec_count); - if (IS_ERR(sec) && sec !=3D ERR_PTR(-EPROBE_DEFER)) - sec =3D cmd_db_read_aux_data("mx.lvl", &sec_count); + sec =3D cmd_db_read_aux_data(sec_id, &sec_count); if (IS_ERR(sec)) return PTR_ERR(sec); =20 @@ -1635,15 +1630,24 @@ static int a6xx_gmu_rpmh_votes_init(struct a6xx_gmu= *gmu) struct adreno_gpu *adreno_gpu =3D &a6xx_gpu->base; const struct a6xx_info *info =3D adreno_gpu->info->a6xx; struct msm_gpu *gpu =3D &adreno_gpu->base; + const char *sec_id; + const u16 *gmxc; int ret; =20 + gmxc =3D cmd_db_read_aux_data("gmxc.lvl", NULL); + if (gmxc =3D=3D ERR_PTR(-EPROBE_DEFER)) + return -EPROBE_DEFER; + + /* If GMxC is present, prefer that as secondary rail for GX votes */ + sec_id =3D IS_ERR_OR_NULL(gmxc) ? "mx.lvl" : "gmxc.lvl"; + /* Build the GX votes */ ret =3D a6xx_gmu_rpmh_arc_votes_init(&gpu->pdev->dev, gmu->gx_arc_votes, - gmu->gpu_freqs, gmu->nr_gpu_freqs, "gfx.lvl"); + gmu->gpu_freqs, gmu->nr_gpu_freqs, "gfx.lvl", sec_id); =20 /* Build the CX votes */ ret |=3D a6xx_gmu_rpmh_arc_votes_init(gmu->dev, gmu->cx_arc_votes, - gmu->gmu_freqs, gmu->nr_gmu_freqs, "cx.lvl"); + gmu->gmu_freqs, gmu->nr_gmu_freqs, "cx.lvl", "mx.lvl"); =20 /* Build the interconnect votes */ if (info->bcms && gmu->nr_gpu_bws > 1) --=20 2.51.0