Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp78253lqj; Wed, 10 Apr 2024 04:47:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVvod/bij6/gwosQSfh/HFItwCgbr8hgHRijKKbzqpTqR2Uwuym6E5s8+bqv2SaZxXuYwuTKpivroEcgU/5hAyaXstY9/+Q62jZoNy+ng== X-Google-Smtp-Source: AGHT+IH5hd14/ukkxUbe1W1uawY1TZPh7XxxZ3CyY/KwedD+ckrTGNof63uzDvABDhWe2DdS/usT X-Received: by 2002:a17:906:b355:b0:a4e:8ac4:3c3a with SMTP id cd21-20020a170906b35500b00a4e8ac43c3amr1332463ejb.48.1712749634452; Wed, 10 Apr 2024 04:47:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712749633; cv=pass; d=google.com; s=arc-20160816; b=ZLAFtpZ84v2AAtGl0MZHZ/VUfFDrKpPx1nDZnzWuoAedteLpijbeHh19PDylD+fJ2F GDUKKTd07aBDX786tmsCiBHEAPvMEZTR7VLKoytZ1Q8WyWssW27NZ+wfVRMg8RoCp32/ L+cZbUFrQTIydk2TKxMN/Lyo1ljjlPre80GZn88F758I4mtecxYMuVnMc29AS3SF1Gd0 Vx1XzLMd71zI7KNFvu2kORZaWV9rz23VRv+zus0RzzE156ypK2XOvXZjOOXn1gTogT7a Rt7Gf0FwzLndUFLBm2BA7qBV++alx8Vfwznifu/x8N5aZbSxl02ETFpG9q1TrUdkl35M eU+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=oZ6YNeiNukRuh6MMTnZ6ixiPqjgd5+C31ndu168QCzk=; fh=prWbVop4oPctt0ZuKOj/crGg3OV5nwb/PS8uN9MJEKo=; b=but32oPTm8YjQ+QcGdX7OxwscEGYu6vRJuADw6s/RzTkCSkPCYL58ab3EppBptY0Eq W2Y/Hh7XJ5sNjnDeLS7zJDTS+BUnPAfgDNP1D/33QZCowS0xFWepXBs2aH4bPjYhuqr7 8zttt1uibLTK2o7v1AO8YuLDJZHTGAPVKdrslcpVTtpl0uAs5fa1TLWbf1+etqqC3wun 5YnLWn4DyeZU85LXAdzOgwJchARr/BWPj3QkeU6qYBeHEN01p2gBOYmNMSREfsrCphSn Xs2QU1wd0h20kHvvclpo1u/WxyITly7XpjaXrMJoZu8ex/exdVr2msbToDxAbo73vvNv fi0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FArxwAfY; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-138431-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138431-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dp1-20020a170906c14100b00a51b33faddcsi5244508ejc.290.2024.04.10.04.47.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 04:47:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138431-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FArxwAfY; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-138431-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138431-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5FD7A1F24E13 for ; Wed, 10 Apr 2024 11:47:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C40215ADA1; Wed, 10 Apr 2024 11:47:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FArxwAfY" Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A31B715A4A0 for ; Wed, 10 Apr 2024 11:47:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712749623; cv=none; b=Us2PlBW7p4t+e5P5xYA36BI2enGERd7JehLopgFw5r2GVH0h1mxj9H7Ya9s3CLyTXjO4kyG5EL9mo3SXQIokDq2f3gJElpY46jwKzQz/P2iy7a0qFNd4T0YIStSYLAay649jZn2RTnV1ySbEoYuLUJgLLKtp2ohU2peLS2ixywg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712749623; c=relaxed/simple; bh=CW+mD6GTRkoQYXsN50pvVgrsZ6ghzRF4hd23UYqT+zA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WSxJ2NGslxoRsVbY9zrngNkcEWZ2tZFDJ0H08jtgbUWRRs7PC+i7P21kihXI55r07MLSq7J0k35KuuwZezfhGnivfj25DF9de+zwiNZJTRucmrStKSV+/IgVo98fCo08vI7ZZeH9p65y42whEbuxAP2OmzTwYIo1gS1jr5EfE8g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=FArxwAfY; arc=none smtp.client-ip=209.85.208.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2d895138d0eso27569211fa.1 for ; Wed, 10 Apr 2024 04:47:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712749620; x=1713354420; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=oZ6YNeiNukRuh6MMTnZ6ixiPqjgd5+C31ndu168QCzk=; b=FArxwAfYjCFQ28ezbMSLkd607mC+nlzfb0xDEqr2g5o+PposDK5DmRoKGsAb6kFkFX PLusD0ko4w9VyshZg19zQYmB3V3olgcMNjkC0sXwE/sbGWtFYDPr/5BqRHgWGPdGwgzF rlkDXFMaPpLi9jTgHnieV8MIbkDqW0ma2JM2d2RgNp1zFanCe83tNZccBV5l5z/quXL7 gfFkb84YheHQLOxRiDF57AeQUXxB7BSc71jc1yhJRhCjugO30SguIuq1OTdoNn9CURlb uF3CTkZ1W2oRZIZW+eDAJ5m519c+Epo74JI0ymimfWlBC2OJQB8cA9TgBnfPGhsE/LRR OG7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712749620; x=1713354420; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oZ6YNeiNukRuh6MMTnZ6ixiPqjgd5+C31ndu168QCzk=; b=w7ASIMYtY9sQXDOWt0Wtqhhuf5CwvTwbfe91yleDI39O0lJ9oALrP1UcfZbU96ENOe kCq+UOPkm7IZaQaffpTcUfOxgqRtm+p9SLlU3wTvsVl+2wFtBvV8H44cbXeN54dqRzzm GB1blojq2pPRlmbiCLzsg4CzLaFTC6DuP8c03IVHjTJxyuOM5tgCRI6zPfsqxUc+cJwH y08fXEDWqOTyOUIFYUbhj33wQJKICFidNEedzOq5KOH862rLuOyXpBB0nwacHyASaY72 YCfQivYShoeeV+nt+87vfxzjilUImzUFuJnTTWYiKtff1WgPZqLuplefJ9E0OsoR96jm u27g== X-Forwarded-Encrypted: i=1; AJvYcCUQPXLLJSkFg6c2EjE8hPgUT+GOEz5d6LKldYv81+oPcefwDf2biNwnJaUa3ehdHr8dDfW+p8aeSO72qcMKlzfmKOt4aWtZu9KxSEye X-Gm-Message-State: AOJu0Yx6SiQeZvYjunOLJr+bh5XX/saYs5adoUGd1H679QnHkuSLYor6 xY5Cxpp+/fLMtWQ6hHyTk2H/hHMiJCg4Y3ejBnZhiPvLkQG27fDOq6M7f/6zeFs= X-Received: by 2002:a05:651c:1037:b0:2d8:71d4:4c62 with SMTP id w23-20020a05651c103700b002d871d44c62mr1461674ljm.49.1712749619821; Wed, 10 Apr 2024 04:46:59 -0700 (PDT) Received: from [172.30.204.89] (UNUSED.212-182-62-129.lubman.net.pl. [212.182.62.129]) by smtp.gmail.com with ESMTPSA id r21-20020a2e9955000000b002d85452f55csm1781619ljj.47.2024.04.10.04.46.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Apr 2024 04:46:59 -0700 (PDT) Message-ID: Date: Wed, 10 Apr 2024 13:47:00 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/6] drm/msm/adreno: Allow specifying default speedbin value To: Dmitry Baryshkov Cc: Rob Clark , Bjorn Andersson , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, Neil Armstrong References: <20240405-topic-smem_speedbin-v1-0-ce2b864251b1@linaro.org> <20240405-topic-smem_speedbin-v1-3-ce2b864251b1@linaro.org> <74ebd488-15c1-47a5-86f4-14263e3a914e@linaro.org> Content-Language: en-US From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 4/9/24 20:31, Dmitry Baryshkov wrote: > On Tue, 9 Apr 2024 at 21:27, Konrad Dybcio wrote: >> >> >> >> On 4/9/24 20:15, Dmitry Baryshkov wrote: >>> On Tue, Apr 09, 2024 at 08:07:56PM +0200, Konrad Dybcio wrote: >>>> >>>> >>>> On 4/9/24 20:04, Dmitry Baryshkov wrote: >>>>> On Tue, Apr 09, 2024 at 10:12:00AM -0700, Rob Clark wrote: >>>>>> On Tue, Apr 9, 2024 at 8:23 AM Dmitry Baryshkov >>>>>> wrote: >>>>>>> >>>>>>> On Tue, Apr 09, 2024 at 05:12:46PM +0200, Konrad Dybcio wrote: >>>>>>>> >>>>>>>> >>>>>>>> On 4/6/24 04:56, Dmitry Baryshkov wrote: >>>>>>>>> On Fri, Apr 05, 2024 at 10:41:31AM +0200, Konrad Dybcio wrote: >>>>>>>>>> From: Neil Armstrong >>>>>>>>>> >>>>>>>>>> Usually, speedbin 0 is the "super SKU", a.k.a the one which can clock >>>>>>>>>> the highest. Falling back to it when things go wrong is largely >>>>>>>>>> suboptimal, as more often than not, the top frequencies are not >>>>>>>>>> supposed to work on other bins. >>>>>>>>> >>>>>>>>> Isn't it better to just return an error here instead of trying to guess >>>>>>>>> which speedbin to use? >>>>>>>> >>>>>>>> Not sure. I'd rather better compatibility for e.g. booting up a new >>>>>>>> laptop with just dt. >>>>>>> >>>>>>> New speedbin can have lower max speed, so by attempting to run it at >>>>>>> higher freq you might be breaking it. >>>>>> >>>>>> Usually there are some OPPs in common to all speedbins, so picking a >>>>>> freq from that set would seem like the safe thing to do >>>>> >>>>> Well, the issue is about an uknown speed bin. So in theory we know >>>>> nothing about the set of speeds itsupports. My point is that we should >>>>> simplfy fail in such case. >>>> >>>> Or we could allow e.g. the lowest frequency (or 2) which if often shared >>>> across the board to work, giving a compromise between OOBE and sanity >>> >>> That's also an option. But we should not be using existing speed table for >>> the unknown bin. >> >> I derived this logic from msm-5.15 where it's "intended behavior".. I >> suppose we can do better as you said though >> >> There have been cases in the past where the default speed bin ended up >> having a higher max freq than subsequent ones, and I don't think I can >> trust this product/feature code approach to guarantee this never >> happening again. >> >> So. I think sticking to a single lowest freq and printing a big red line >> in dmesg makes sense here > > Make 0x80 the default supported-hw, make sure that the lowest freq has > 0xff. Plus big-red-line. > And hope that we'll never see 16 speed bins for the hardware. opp-supported-hw is a u32 bitmask fwiw I was thinking, either 0xffffffff or some driver-side hackery (dev_pm_opp_enable). Perhaps I'd be more in favor of the latter, as putting meaningless gobblygoo in dt is not good Konrad