Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3376782rdg; Tue, 17 Oct 2023 12:43:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/uj3taMKmzg2khz3NbrHybitw8z/tkKyZR7jyw9NO8GX8DS7FGmfq/AncPbuKAfG3XKDL X-Received: by 2002:a05:6358:6156:b0:166:e469:9076 with SMTP id 22-20020a056358615600b00166e4699076mr1575970rwt.13.1697571824077; Tue, 17 Oct 2023 12:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697571824; cv=none; d=google.com; s=arc-20160816; b=sposiTxsLIZObTNyrSyXcQGYWOogjc4QaRt9F9Wbmj1UPyFIpeEVUfxtYxFecYzqCD oDwCCzr1UPMtZGJ2B5Rm6JzPJI3sqna3Op7SkT9DtRSBb7i0jkN7PTxNqeOQwc/SFQtm yXxwBWBk2qEoWOee0fXBfo/cgKjnYRaAIP0IpHJfvNKzWmj9XFSXJYiFHfHo9XsfR09n /dRUUw4XKuaqKIyARS0oBAee2NJc5/rlbu6FgxUsAC+v7/Nu4ZS7obBXtiAT56/rY/L4 L2k93PEHZhW5QLY18QvSWTfp7rrtl2eQyOUhdXEIa8W+qkwdasbIdzWlqxYbprkWAN3D O1ag== 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=KZ86qm2Odn6qaH8UjSDuQnMrT/mDzTTCaaJv/fM0SLI=; fh=QbPz6uKkTzbkeJQ4fJxgadM52hmDeeq1JxNMn8lmwec=; b=yHbBv/qDTve6pftZaJsjeWy/wC/+4axWAlG0BEywwVY83DXYBCh3+DaMuBOR9lbBxm oLhOeEjzbvjAKO6DCjrI4yd2Ihz610lyCvdgewlqXBztTkWlnQEgSMnJtFHaVcXdGlYi ByJVr86euwQHqSiIcoVrW/Z8YcCubNXodB1lbSzXYFykMXPOnnFEpCV1ujwf94EqVqkQ swpVaBd9NTs0OlatRwAlEJL8DmZhYo8ENt9i3S0MtlmdL0FWX84aS1XEv2YOCGSmaTii HtCkeiQhHLV7yY7itDSACUgqDlWrCAnovkppYAJOKckD1OGQz3MToZ/2d7FJRRHmNPfE WOeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=RqKYroHG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id n3-20020a6546c3000000b005aafda9855asi427346pgr.475.2023.10.17.12.43.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 12:43:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=RqKYroHG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id C16A3801B903; Tue, 17 Oct 2023 12:43:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235060AbjJQTnU (ORCPT + 99 others); Tue, 17 Oct 2023 15:43:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234635AbjJQTnT (ORCPT ); Tue, 17 Oct 2023 15:43:19 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C89698; Tue, 17 Oct 2023 12:43:17 -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 39HEPN89008517; Tue, 17 Oct 2023 19:43:04 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=KZ86qm2Odn6qaH8UjSDuQnMrT/mDzTTCaaJv/fM0SLI=; b=RqKYroHGPl2bNn/wwNHMW8AAnON1yPuHytJlcBRG6Jgy17UB5LR00qJrpWUIqZ7AnoyT AeqkG+/EIVqu72k258Vo+Viv18ztYrUvAXOhrkVrdk0Gcj0iqsUYGRJKqICgeyWnk75X 76Syo1k7fsTpoEz9yWNOLYE8lEKe0THmMwhY9LKLiIv5swy5WsOneCeUE3L8GJ0E5N6X fpLtIGVXNAzOp2Zz1A/JXEvAXKIhkUsObxfAcV0b8bab68XDfnlkhPhJpvTa9N//QE3S /8wjSPMTOiY+XkcHPbjbRSg3YqqpaxYBbK+QLTe0qUEtI8aKfkGa+ml2TvMO+w9utDiD dw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tsv0v0uk8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Oct 2023 19:43:03 +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 39HJh2GV015529 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Oct 2023 19:43:02 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.1118.39; Tue, 17 Oct 2023 12:42:56 -0700 Date: Wed, 18 Oct 2023 01:12:53 +0530 From: Akhil P Oommen To: Konrad Dybcio CC: Rob Clark , , Conor Dooley , , Krzysztof Kozlowski , , Sean Paul , Bjorn Andersson , Abhinav Kumar , "Rob Herring" , Stephen Boyd , Rob Clark , Andy Gross , , Daniel Vetter , , Dmitry Baryshkov , Marijn Suijten , Luca Weiss , "David Airlie" , Subject: Re: [Freedreno] [PATCH 1/7] drm/msm/a6xx: Fix unknown speedbin case Message-ID: References: <20230926-topic-a643-v1-0-7af6937ac0a3@linaro.org> <20230926-topic-a643-v1-1-7af6937ac0a3@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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-ORIG-GUID: -T2DgK6rkz0P_dvCFV1TA1PJcvaODXgX X-Proofpoint-GUID: -T2DgK6rkz0P_dvCFV1TA1PJcvaODXgX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-17_03,2023-10-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 malwarescore=0 phishscore=0 mlxscore=0 mlxlogscore=999 impostorscore=0 bulkscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310170167 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 17 Oct 2023 12:43:41 -0700 (PDT) On Tue, Oct 17, 2023 at 01:22:27AM +0530, Akhil P Oommen wrote: > > On Tue, Sep 26, 2023 at 08:24:36PM +0200, Konrad Dybcio wrote: > > > > When opp-supported-hw is present under an OPP node, but no form of > > opp_set_supported_hw() has been called, that OPP is ignored by the API > > and marked as unsupported. > > > > Before Commit c928a05e4415 ("drm/msm/adreno: Move speedbin mapping to > > device table"), an unknown speedbin would result in marking all OPPs > > as available, but it's better to avoid potentially overclocking the > > silicon - the GMU will simply refuse to power up the chip. > > > > Currently, the Adreno speedbin code does just that (AND returns an > > invalid error, (int)UINT_MAX). Fix that by defaulting to speedbin 0 > > (which is conveniently always bound to fuseval == 0). > > Wish we documented somewhere that we should reserve BIT(0) for fuse > val=0 always and assume that would be the super SKU. Aah! I got this backward. Fuseval=0 is the supersku and it is not safe to fallback to that blindly. Ideally, we should fallback to the lowest denominator SKU, but it is difficult to predict that upfront and assign BIT(0). Anyway, I can't see a better way to handle this. -Akhil > > Reviewed-by: Akhil P Oommen > > -Akhil > > > > > Fixes: c928a05e4415 ("drm/msm/adreno: Move speedbin mapping to device table") > > Signed-off-by: Konrad Dybcio > > --- > > drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > > index d4e85e24002f..522ca7fe6762 100644 > > --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > > +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > > @@ -2237,7 +2237,7 @@ static int a6xx_set_supported_hw(struct device *dev, const struct adreno_info *i > > DRM_DEV_ERROR(dev, > > "missing support for speed-bin: %u. Some OPPs may not be supported by hardware\n", > > speedbin); > > - return UINT_MAX; > > + supp_hw = BIT(0); /* Default */ > > } > > > > ret = devm_pm_opp_set_supported_hw(dev, &supp_hw, 1); > > > > -- > > 2.42.0 > >