From nobody Mon Feb 9 21:19:59 2026 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 1D2F532F74B for ; Thu, 13 Nov 2025 23:31:11 +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=1763076672; cv=none; b=cxpVXvPwGrMwyVdHg/WHZexHtJr+PXk5EWS+2OFfnRU8vj349XyA1z6xXRrNvtkETAiPTRCLPp49VBSIHOmw8rpDAPAdDtD1I9kewwkzGpiq07N+nDuBt1hJCaIIpuN+9iTgMOeMZV/BLy1hO5rwF0zrtmgcmukwfJnvEUGs0Fg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763076672; c=relaxed/simple; bh=6xiTxu+QK2g5DX1T1txHhYRR5FauCvoidVNtsUXBMYQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aBdTxZ6h3O2jA+5BeaLsJEt8K4YSF1faE1f1uALW5awSPEHwqqjypEPaxI+5r8Hij+SauXJofLexWaKnU4qAHKWaGNzH3yR+Eeej+Ag6e3YYwGgXuYe8HFEBBbY/9qnWSyKcyUIgnnMD/FOUv1jLGYiXVoMzMvEPWnnXNQgCe0A= 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=dcmpx793; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=jHPpvpTz; 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="dcmpx793"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="jHPpvpTz" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5ADMagE01477709 for ; Thu, 13 Nov 2025 23:31:10 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= ogd55nO2nJMubbd6drWs5Znn7Ejg1QAMnSKWLgnRFIU=; b=dcmpx79369qnBr4c +yDP0pXqwJYJZ3z8L+GDq616nmiqW8Qg2ScL+qoEIf2jnxoIUYZJZaHtOvT/9F72 12mzK9VsMrKe3e78AZ/opjEFYnwWS5brVEoy67HQwAoRcjk+fU1Ksg+nn2eD2IZR kwoKBY6zD3f3Qs7Zu9mEr1t2nlmVtnKiWxl6VjogbG62ykWpOl6CZzK7nOeb1vzo j+7COuUwy1YBGWT2lJGc7yNvu3M2yXzFzszpOo3NLQtL2maeheQhr8JAMgJOSfGZ xxtW7dwzoOgmeg0DXAkuGFdAvdprY0WOLiKs+Gy8mhs8wMzWS4LimAD/fyD+ivit xbHaLg== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4adr9dr45n-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 13 Nov 2025 23:31:10 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-3436e9e3569so3033746a91.2 for ; Thu, 13 Nov 2025 15:31:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1763076669; x=1763681469; 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=ogd55nO2nJMubbd6drWs5Znn7Ejg1QAMnSKWLgnRFIU=; b=jHPpvpTzoid8Mxk5WfQLJ/Um4FDL+wnJlsdSUQUzL5Or6OIwTfCVy8TO/B9yFelr5/ yuWoRupQ2qiLzK3qVEYzYrN5IiqeIC0E/+aQXUzZ/Ippd8M9KEZot3lYS3/hFroJfveB F57P//qI1CuiJWPOe10nKNNYmR7Q3xHHNnEDIPP2fd9dAXiJW6PDiJvB8/5scGerUDo3 j5VZcbie4jDuPB/jpQjzVcbc2CEmn72FPPDrM7LuUWuSTFC+9twKBkp5gLcKUcleaUm+ yrPpn09p5tlKm/S9eXezA93W24C8a21JOnv3E1NLuIj7yQmCWY/SdfQwqVS0vVmdLkTa RUug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763076669; x=1763681469; 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=ogd55nO2nJMubbd6drWs5Znn7Ejg1QAMnSKWLgnRFIU=; b=AL0DixzcudIR6L3LSFVOGXji8CdmQl8+hUcNFaUlpi51eujUFC51DBEY0mBJZPnFio Xdx6q3m4Da44g0xtSYBeb+MCZlZiy4D1rBBm10wgH9DE0uC1QKoJbbsPUwWy6Gawmw0T deHssivJqrtPKHV+zElgKpq7+3c93fFCQVJFG2GMBsn+Hp7zToe54nX2lfYcC+HM644X 1GAzZRrgk2Sp6Y414lVPfUkVPoOsS4DWxC2DIbNMGuNZ9fYsF0ngP/l4ZVCEtr/JwhSr sjRW7U3R3eGkLbbC/lFIJTTL68FN66fXYCGwVc3xo3cGg/QvbFbxmGStiWVi91bxh/R4 OwJg== X-Forwarded-Encrypted: i=1; AJvYcCXC/tZXV3KIfT9Cem3F3e1XmbHtqrdpZd09Gt3t9YmGG1CL5K74oGBfOdr3jP81ZBk8N3Vimmz3lsaDmVs=@vger.kernel.org X-Gm-Message-State: AOJu0YzSiGL+O+VSseCTSnIj24pdJ94lM27e4W47pT4BhaZ1UtR+J40l UjmmGgTm/AWf/wUngN3q9Kk3ao8KHVL2HTBdLx3D/2xJnb2veam5DCPZo32X2/OXCoFev3sqUtM WBUt3MknySIe9c6ZKCJ6yhpNYHOfO7tgo6Uqs3A6PfYwe+1GXHFPLqcU3/Sh4+WWvuPo= X-Gm-Gg: ASbGncun2S9BVkzeK21tRKPw0tk4/Yb1kvOY1PolufRF/Sb+oZ79KJuVbTzqeZRPawN 5Zz7fsBmOG2ZLqBKqIO4iWth/r/qHuNd3wSAKBuviNZWgPHs7l+g4MR5KdrOF9v9mB65GzS0OV2 yws1gA53Il0/NzhKTlgRutNNZaMIbfksKrsZ5fUYP1i6Rwt3gkwsD7DvWQc1VmB5jYQJvvfNMNc /tLB4Uce6y+mAy/2/YCP0eYp9TfSjDcKPTIbEFay6yuupGBC9PZQ92B2Q+iwi3lQJk+y6IiDgOC K05Hg3QG2e29207dMcX1Lps3OAjxHd5OeI1t9U/1BQBLgWkuZDDe2gJXTYf4m9N7x6Rizs84lYO bH3yj6Z9PSkoSowKvUr+qZmQ= X-Received: by 2002:a05:6a20:3d1a:b0:342:2a1b:86fa with SMTP id adf61e73a8af0-35ba1b90665mr1474117637.45.1763076669146; Thu, 13 Nov 2025 15:31:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IELj1AccU1iAtNlF/d1rwvp3D0O0GtJ2fmP978ebIYh6+n2bRYHdSZZAqBoSZaQIswf+5R01A== X-Received: by 2002:a05:6a20:3d1a:b0:342:2a1b:86fa with SMTP id adf61e73a8af0-35ba1b90665mr1474054637.45.1763076668465; Thu, 13 Nov 2025 15:31:08 -0800 (PST) Received: from hu-akhilpo-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-bc36ed72cd1sm3049486a12.11.2025.11.13.15.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Nov 2025 15:31:08 -0800 (PST) From: Akhil P Oommen Date: Fri, 14 Nov 2025 04:59:08 +0530 Subject: [PATCH v3 11/20] 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: <20251114-kaana-gpu-support-v3-11-92300c7ec8ff@oss.qualcomm.com> References: <20251114-kaana-gpu-support-v3-0-92300c7ec8ff@oss.qualcomm.com> In-Reply-To: <20251114-kaana-gpu-support-v3-0-92300c7ec8ff@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 X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1763076574; l=2950; i=akhilpo@oss.qualcomm.com; s=20240726; h=from:subject:message-id; bh=6xiTxu+QK2g5DX1T1txHhYRR5FauCvoidVNtsUXBMYQ=; b=IttmFcbenAkdyewwx77FnOo0XWIhoBfw7cDraxU2XeqU/3OiNFFUAG7R+9K8RedUjOJawDXlp Jb4HDun0pjmA42rV3ROB75c/jOtuhSsvRqvyUfDYw/rz2cgt1d0uQGa X-Developer-Key: i=akhilpo@oss.qualcomm.com; a=ed25519; pk=lmVtttSHmAUYFnJsQHX80IIRmYmXA4+CzpGcWOOsfKA= X-Authority-Analysis: v=2.4 cv=IaiKmGqa c=1 sm=1 tr=0 ts=69166a3e cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==: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=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-ORIG-GUID: Ygi1EXGTw4KVd6yR_EMTC37tygR82PRK X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTEzMDE4NSBTYWx0ZWRfX6oxHIBwV1qq8 OCBdZjcXmxEBxnMQEuxHNO4SDsjZMV2Msg2mDBz0HIEtftMZ/0a63D9p/KuGEdreC2IsJbIfLpL UkJ69uVquQudxzW2K2DlURxcL/CyGNoQAhZ1y+B7Drs2jAwToEJfaHDLJv89R3q54tNXRtKMNcO dpPJmKY+FmG84CUE0WnyHCFFc12VO2JFP2Oib0VdB0rrlNssatDL/a9A+pu57dVPrvA64aoX4gk p6BBui/v6r9ZsRxynjYJYBCTn2dEVmJ2Hf427if3UDxYr3anFZqoRPflaNC69TD9o8EEsIOMzi3 +EKof/eIeWsA2LheUm6FhD0vJUr6Y8kU3jk6ByPUuH1VjrvoMwS6v5ggJXN7kftV55cIu68/h7l 5wQPOaRH33b49Ai4TECMRr4tqjMJeQ== X-Proofpoint-GUID: Ygi1EXGTw4KVd6yR_EMTC37tygR82PRK 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-13_06,2025-11-13_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 adultscore=0 bulkscore=0 phishscore=0 clxscore=1015 spamscore=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511130185 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") Signed-off-by: Akhil P Oommen Reviewed-by: Konrad Dybcio --- 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 53461be14dc3..f32e1aba146b 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -1518,13 +1518,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); /* @@ -1535,13 +1536,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 @@ -1609,15 +1604,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