Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp150851rwd; Wed, 14 Jun 2023 13:42:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ62x0HrS7yOrf/7fCMsYMlqy6cKmfetQBZAzvrnGAVg2K/8rqJ4pCvp6Gd3AF1AxokRWJzl X-Received: by 2002:a17:902:7588:b0:1b3:a667:45aa with SMTP id j8-20020a170902758800b001b3a66745aamr11586168pll.34.1686775375694; Wed, 14 Jun 2023 13:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686775375; cv=none; d=google.com; s=arc-20160816; b=A92Pn4d/fXvbV9/UC76Lp+wCYbP8bSaAMGT5ITsGPFSYX+LhbZ6fg/m//odALFxk3U oxINCdxNciBBqjIBk8cCbjxPvLWZwqBh0oQ2T4u/kQpvJpufFYWrSUyG70aTqiellPnb BEv/V+HYvCOEYB7kPG0TrbtAYFrXlr6vuUaKlSeIxaWTnUpoVxaViFOOcT95AGS/BGdT Xig0EOLglT0+nlsYq/DCIwQbg9l04tqemx+XMeMLrs6yypGWon0XRhBF88XmSzsYFJc1 GpTx9N+e0BnFVbHBk/xZzMOdXqzvLqdcOib6AqY61i+ForpmtVPlc4JlT87egnhChc7w eaoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0v0hiAtFb6JcdivZuJLRZlGtX7dJm82zMnQi6DelwmU=; b=AW+sG01D8JvvRqTPuQWge44p/yuqGHY8WnTqC6n5VWzQT400LxTUA5ZnRuUERjhjfu OJmX8981/jcHzpoSXgsRDnyIDy7NhF0RJcNxPRD2tEyaGgN2yYXjynoVI5a1iMH1Xrch Je08t8AV3JKANufvBmESC6ymoi+7zLg+HJ3ULvmuV8YOTUfr7SzTyWB5ulUkEVuee53F PyWt2m6RTkK0/7x2CJSeJV4eIAnWZkNj3zs7rilVXkIm0r7Y7YAo3mWsfdHa6OVPqNjN MKYfAc1uXuZsKv/qxcFHJf//ys20HKldQKxoFxxfHeV82UM/3uaAo0Q6FyxarcZ5tlm+ fJKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=jZCZHLrV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d18-20020a170902ced200b001b03d54354dsi6202710plg.189.2023.06.14.13.42.43; Wed, 14 Jun 2023 13:42:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=jZCZHLrV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236434AbjFNUQK (ORCPT + 99 others); Wed, 14 Jun 2023 16:16:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233833AbjFNUQH (ORCPT ); Wed, 14 Jun 2023 16:16:07 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CCECDC; Wed, 14 Jun 2023 13:16:06 -0700 (PDT) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35EJiksd025685; Wed, 14 Jun 2023 20:15:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=qcppdkim1; bh=0v0hiAtFb6JcdivZuJLRZlGtX7dJm82zMnQi6DelwmU=; b=jZCZHLrVoNlphs1oRXZ0n6daoOUAE6MrBY5AdAgMNlf7uCcAPqgsedqgsl7uDujwPKdk VK4LqO4ZwSMFYhCOLa9QBeZjTSTwgjkkFvegP3yiAqnZ81lE9NPG76U+dC2Hh4o0NX3u DF39CVGNy0yV52sLmtr+p6lOSREfyUCrAsNQbPB2Vh/QKS6PdAJD2lwf46IajmibJ6uW wxMLPuAbFAvg7N8zdfNu8Gi1/OEFHSWZEOFlxtMtyorRcRJn9L7sEy2aEuLUdwwXJdkD kDobr72f41MkirYZQibkAO/wI8tkG88BynFRYinagFeY0vDVtgJvoUn6qrkrGvMKgvHr Bg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3r79dfsnhw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Jun 2023 20:15:55 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 35EKFsTv005215 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Jun 2023 20:15:55 GMT Received: from akhilpo-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Wed, 14 Jun 2023 13:15:15 -0700 Date: Thu, 15 Jun 2023 01:45:11 +0530 From: Akhil P Oommen To: Konrad Dybcio CC: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Bjorn Andersson , Konrad Dybcio , Conor Dooley , , , , , , Rob Clark , Marijn Suijten Subject: Re: [PATCH v8 17/18] drm/msm/a6xx: Add A619_holi speedbin support Message-ID: References: <20230223-topic-gmuwrapper-v8-0-69c68206609e@linaro.org> <20230223-topic-gmuwrapper-v8-17-69c68206609e@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230223-topic-gmuwrapper-v8-17-69c68206609e@linaro.org> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: YWzesRBz_gypsA66rNMESuwnPURK3mPD X-Proofpoint-ORIG-GUID: YWzesRBz_gypsA66rNMESuwnPURK3mPD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-14_14,2023-06-14_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 lowpriorityscore=0 spamscore=0 bulkscore=0 impostorscore=0 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306140178 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 29, 2023 at 03:52:36PM +0200, Konrad Dybcio wrote: > > A619_holi is implemented on at least two SoCs: SM4350 (holi) and SM6375 > (blair). This is what seems to be a first occurrence of this happening, > but it's easy to overcome by guarding the SoC-specific fuse values with > of_machine_is_compatible(). Do just that to enable frequency limiting > on these SoCs. > > Reviewed-by: Dmitry Baryshkov > Signed-off-by: Konrad Dybcio Reviewed-by: Akhil P Oommen -Akhil > --- > drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 31 +++++++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > > diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > index ca4ffa44097e..d046af5f6de2 100644 > --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > @@ -2110,6 +2110,34 @@ static u32 a618_get_speed_bin(u32 fuse) > return UINT_MAX; > } > > +static u32 a619_holi_get_speed_bin(u32 fuse) > +{ > + /* > + * There are (at least) two SoCs implementing A619_holi: SM4350 (holi) > + * and SM6375 (blair). Limit the fuse matching to the corresponding > + * SoC to prevent bogus frequency setting (as improbable as it may be, > + * given unexpected fuse values are.. unexpected! But still possible.) > + */ > + > + if (fuse == 0) > + return 0; > + > + if (of_machine_is_compatible("qcom,sm4350")) { > + if (fuse == 138) > + return 1; > + else if (fuse == 92) > + return 2; > + } else if (of_machine_is_compatible("qcom,sm6375")) { > + if (fuse == 190) > + return 1; > + else if (fuse == 177) > + return 2; > + } else > + pr_warn("Unknown SoC implementing A619_holi!\n"); > + > + return UINT_MAX; > +} > + > static u32 a619_get_speed_bin(u32 fuse) > { > if (fuse == 0) > @@ -2170,6 +2198,9 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_gpu *adreno_gpu, u3 > if (adreno_is_a618(adreno_gpu)) > val = a618_get_speed_bin(fuse); > > + else if (adreno_is_a619_holi(adreno_gpu)) > + val = a619_holi_get_speed_bin(fuse); > + > else if (adreno_is_a619(adreno_gpu)) > val = a619_get_speed_bin(fuse); > > > -- > 2.40.1 >