Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp572419ybg; Tue, 28 Jul 2020 13:07:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbfa3UU2RDJGQ/vtHe3RLUQzs8ZJNnhRoeFqlak52dJRx2yx7ZZHvvxtftpxxd8PdomUPb X-Received: by 2002:a05:6402:cb9:: with SMTP id cn25mr28400006edb.247.1595966867646; Tue, 28 Jul 2020 13:07:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595966867; cv=none; d=google.com; s=arc-20160816; b=cswyvgGqaiCoqIkoTVT6XCt/GOtKgLBRWUqa3p3oAXi/bqL8AoMnyv23nWK9MvzRnk e7GDB14VY5MUHCfljeFdr0yo5+uqsQxKV/mKDLVBtMlv8QzSte5aZDpyYQJrUmIPT+Jb rQRZTcgSDr0nDK7Xp0RJ9+3JEghkAjzWob4xJutOKnvgISJ2rv6V5lXgTE4Qw2FKaK6a S9JTzllB66e8nTkU2A2dhdJq7awGvLI8fmncNrmWBlwyojeALqYfcZFhEcMPEhhbnTQb 1vbpVGfiGJIkAXdXdrodBzuRskoXoF8IDBTDUGyykHQnRm+dR4WQaEJcbLOia6u12weA LFMA== 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=z3RTYldI4Zax6DhwFLMFZoHJWAMKsWPXMCNUdp5q3qw=; b=ehA79TuQKCXhq+xvNNsiVJkKMAu0phFdwN5eymHLMHVQLWqeQh3OuvKWwSvbgGVtqn BcdONk5NZy/gawWLG5SMBPBQMxfSCtlihL2wwLSQ08P8iYMwsnTzujeoR0D3/E+L0Qjo xk0/ArK8IUKEHuhWVrpHIW/bzGe0vREpP310Ea6Voy+GPMlBf240EETD9zRqpcWqsCs4 j7Qoi8TGpinL/7w9UWntWw3JYyjhSh9n9EHZUt8VhzZgu/R/1rIKAhPOYBpZlsbDHbmo 4w6jOajK4pwSz1GacXaAxKF2GLhBXKTbHo7XHia3WICBTeXoDOXIbRP0ujySMZxEdmHw Xm7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q4KnJnRG; 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 r4si699829ejs.719.2020.07.28.13.07.25; Tue, 28 Jul 2020 13:07:47 -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=Q4KnJnRG; 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 S1728725AbgG1Tyd (ORCPT + 99 others); Tue, 28 Jul 2020 15:54:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:36526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726764AbgG1Tyd (ORCPT ); Tue, 28 Jul 2020 15:54:33 -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 8F01C2075A; Tue, 28 Jul 2020 19:54:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595966072; bh=z3RTYldI4Zax6DhwFLMFZoHJWAMKsWPXMCNUdp5q3qw=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=Q4KnJnRGXDmcHGd7YqCD+uolQe9gLS2wVgGuOYGuNJZLhbZ4IRhyfAcLSJbRLLN75 /xITTaWj85yxXn2pl0C1X99NsOgCk2aPtgZIPEd46AxA2Zfq7+4cYv9ZHvWh8dEqGT TMwL1CG/n0aTLTo0mg8l0Ok0NSLaiuZ33/+Qp89w= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: 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> <159589753282.1360974.11628682178494669632@swboyd.mtv.corp.google.com> 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: Tue, 28 Jul 2020 12:54:31 -0700 Message-ID: <159596607146.1360974.8446772748472044390@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 Rajendra Nayak (2020-07-27 21:17:28) >=20 > On 7/28/2020 6:22 AM, Stephen Boyd wrote: > > 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 <5= 33000000>; > >> > >> Is this the highest OPP in table ? > >> > >>>>> Actually it comes from videocc, where ftbl_video_cc_venus_clk_src > >>>>> defines 533000000 but the real calculated freq is 533000097. > >>>> > >>>> I still don't quite understand why the videocc driver returns this > >>>> frequency despite this not being in the freq table. > >>> > >>> Ok, so I see the same issue on sc7180 also. clk_round_rate() does see= m to > >>> return whats in the freq table, but clk_set_rate() goes ahead and set= s it > >=20 > > 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?=20 >=20 > It would, but only if I also update the OPP table to have 533000097 > instead of 533000000 (which I guess is needed anyway) > If this is the actual frequency that's achievable, then perhaps even the = clock > freq table should have this? 533000097 and not 533000000? > That way clk_round_rate() would return the actual rate that's achieved and > we don't need any extra math. Isn't that the reason these freq tables exi= st > anyway. Yes the freq tables are there in the clk driver so we don't have to do a bunch of math. Fixing them to be accurate has been deemed "hard" from what I recall because the tables are generated from some math function that truncates the lower Hertz values.