Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp128219ybg; Mon, 27 Jul 2020 17:52:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTT2ThZr8dpuot+rZV1K+SmUNugdOvOxCc5AW32+UNBlgtDY1rK83PBfwUWzzMkzFQdYN5 X-Received: by 2002:a17:906:b150:: with SMTP id bt16mr14879068ejb.89.1595897569493; Mon, 27 Jul 2020 17:52:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595897569; cv=none; d=google.com; s=arc-20160816; b=kYlubswfvD4eNVFY4SJ9qFstycsphxg3qVhyyJUiCFcxge2vjXegOixsNd7B2sEKcT GK2my1x8oOABNFxbfpGmM22x9vcWWgOaDTKjo2PQXJx/XAktk8uLfxXlCnbATHQ6fyD0 NrsfwJjY+cOCvcg5Yy4J5iyn4CKD+JQvt8C941BlwpHPId/8AjeHWvQyJGWdLd6b0pzR WK6OkqEPc7tXfHIihYRRfUSSMEj21m5B3/qGrgvKzRqVZKcKlmGjQsebvwlkQOCSpvT1 hICuJWowzz+avKL1fBC1sJMgco5XcfzLXpTOU616TOi4Gl+ynsLg47tkZ4wxE7WDngac CILg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:date:to:cc:from :subject:references:in-reply-to:content-transfer-encoding :mime-version:dkim-signature; bh=m7jjeXUjLOQLN5e/RcPuTUYcHmosve5+xAqi+Zbt0YQ=; b=Z6/XdH6soHTW1W3YGP2GCzdFkuTiJf9uAtQ5dmQA207cxmhz7WDLfwxWpwB1oPE0tV tkxOCaW5py+bMOXSf4866TureNdKCPmclLwE+7c6Yq9Wu+Fzs+Ful+dpShipSlf5AFhL tlmmohstKHqaq+PXuRhdlJ/hkh538kkx4puln31rFTnpvA9ui3X2azgd2e/bpRTab+GM 4c/A9ga3cKJl3b17EtGG9qnBusLOlvnhAVLOo1WLelCQgnCA00pE1pxCHot07ilAse91 RvK5EPpR4c2ioO6Q7ol5N0Dh20DhHLCKCdMsWVq569KzzvDUAA2S1IBoSUU2PF6ZD0re ZMcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=w62FTpyl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g13si6904832ejd.152.2020.07.27.17.52.27; Mon, 27 Jul 2020 17:52:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=w62FTpyl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726620AbgG1AwP (ORCPT + 99 others); Mon, 27 Jul 2020 20:52:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:54946 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726194AbgG1AwO (ORCPT ); Mon, 27 Jul 2020 20:52:14 -0400 Received: from kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 05F0F20775; Tue, 28 Jul 2020 00:52:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595897534; bh=m7jjeXUjLOQLN5e/RcPuTUYcHmosve5+xAqi+Zbt0YQ=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=w62FTpylcJe1DoroN9vtlns6YHVZ+2MUmDYEb0s6XFUWPQafag64VmIWb6PNwqqQA q5XMN8JMuRn05nuXtJIuSRlc3kamGWpy6lHHX0HTMgdoOEROPNDM64PEncCXGAzkCF ywbGmjX0t8uW+seZw1Vv+ixRrR0Vl71EsGYPw1CA= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20200727153806.kgegadvghmkevch3@vireshk-mac-ubuntu> References: <1595503612-2901-1-git-send-email-rnayak@codeaurora.org> <1595503612-2901-5-git-send-email-rnayak@codeaurora.org> <94581989-e069-55e5-6b70-919185eda33e@linaro.org> <5a8af2da-cc3f-005d-47e6-b36be1104d6a@codeaurora.org> <20200727153806.kgegadvghmkevch3@vireshk-mac-ubuntu> Subject: Re: [PATCH v4 4/5] arm64: dts: sdm845: Add OPP tables and power-domains for venus From: Stephen Boyd Cc: Stanimir Varbanov , robh+dt@kernel.org, agross@kernel.org, bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mka@chromium.org, Taniya Das To: Rajendra Nayak , Viresh Kumar Date: Mon, 27 Jul 2020 17:52:12 -0700 Message-ID: <159589753282.1360974.11628682178494669632@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Viresh Kumar (2020-07-27 08:38:06) > On 27-07-20, 17:38, Rajendra Nayak wrote: > > On 7/27/2020 11:23 AM, Rajendra Nayak wrote: > > > On 7/24/2020 7:39 PM, Stanimir Varbanov wrote: > > > > > > + > > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 opp-533000000 { > > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 opp-hz =3D /bits/ 64= <533000000>; >=20 > Is this the highest OPP in table ? >=20 > > > > Actually it comes from videocc, where ftbl_video_cc_venus_clk_src > > > > defines 533000000 but the real calculated freq is 533000097. > > >=20 > > > I still don't quite understand why the videocc driver returns this > > > frequency despite this not being in the freq table. > >=20 > > Ok, so I see the same issue on sc7180 also. clk_round_rate() does seem = to > > return whats in the freq table, but clk_set_rate() goes ahead and sets = it I'm happy to see clk_round_rate() return the actual rate that would be achieved and not just the rate that is in the frequency tables. Would that fix the problem? It may be that we need to make clk_round_rate() do some more math on qcom platforms and actually figure out what the rate is going to be instead of blindly trust the frequency that has been set in the tables. > > to 533000097. Subsequently when we try to set a different OPP, it fails= to > > find the 'current' OPP entry for 533000097. This sounds like an issue w= ith the OPP > > framework? Should we not fall back to the highest OPP as the current OP= P? > >=20 > > Stephen/Viresh, any thoughts? >=20 > I think we (in all frameworks generally) try to set a frequency <=3D > target frequency and so there may be a problem if the frequency is > larger than highest supported. IOW, you need to fix tables a bit. >=20 Rounding is annoying for sure.