From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BF8EC433E6 for ; Wed, 27 Jan 2021 16:33:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3D51064DA0 for ; Wed, 27 Jan 2021 16:33:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343994AbhA0Qcy (ORCPT ); Wed, 27 Jan 2021 11:32:54 -0500 Received: from m42-8.mailgun.net ([69.72.42.8]:54505 "EHLO m42-8.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343556AbhA0Qci (ORCPT ); Wed, 27 Jan 2021 11:32:38 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1611765128; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=z5sITnYH+hKH5ob5jP7ZjC3SvuyrrXJFxVS7t/eQ6UM=; b=f7b+sn0wHzrsSZGSGuRgujWh/IX8oNH0ANXJ6G4W6VfJffEpsPTfuFHMYWiVArSX6nm2Jhsl +2irZcHeIxSZDQic8ngOL/Vo/pVmecz5cZbNKu6zU5MyfIRLfbfaduTlMwl1wnf2jZ8QjaKs 0ex3Jg6hO3hNvFzrk5s37Zc6LCI= X-Mailgun-Sending-Ip: 69.72.42.8 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-east-1.postgun.com with SMTP id 6011954fbeacd1a252b67cba (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 27 Jan 2021 16:31:11 GMT Sender: akhilpo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id A443CC43468; Wed, 27 Jan 2021 16:31:10 +0000 (UTC) Received: from [192.168.1.105] (unknown [61.1.225.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: akhilpo) by smtp.codeaurora.org (Postfix) with ESMTPSA id D3407C433ED; Wed, 27 Jan 2021 16:31:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D3407C433ED Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=akhilpo@codeaurora.org Subject: Re: [PATCH 03/13] opp: Keep track of currently programmed OPP To: Viresh Kumar , Dmitry Osipenko Cc: Viresh Kumar , Nishanth Menon , Stephen Boyd , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Sibi Sankar , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <96b57316a2a307a5cc5ff7302b3cd0084123a2ed.1611227342.git.viresh.kumar@linaro.org> <20210122044532.pc7cpcgy3kjbqmls@vireshk-i7> From: Akhil P Oommen Message-ID: Date: Wed, 27 Jan 2021 22:01:03 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210122044532.pc7cpcgy3kjbqmls@vireshk-i7> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/22/2021 10:15 AM, Viresh Kumar wrote: > On 22-01-21, 00:41, Dmitry Osipenko wrote: >> 21.01.2021 14:17, Viresh Kumar пишет: >>> @@ -1074,15 +1091,18 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq) >>> >>> if (!ret) { >>> ret = _set_opp_bw(opp_table, opp, dev, false); >>> - if (!ret) >>> + if (!ret) { >>> opp_table->enabled = true; >>> + dev_pm_opp_put(old_opp); >>> + >>> + /* Make sure current_opp doesn't get freed */ >>> + dev_pm_opp_get(opp); >>> + opp_table->current_opp = opp; >>> + } >>> } >> >> I'm a bit surprised that _set_opp_bw() isn't used similarly to >> _set_opp_voltage() in _generic_set_opp_regulator(). >> >> I'd expect the BW requirement to be raised before the clock rate goes UP. > > I remember discussing that earlier when this stuff came in, and this I > believe is the reason for that. > > We need to scale regulators before/after frequency because when we > increase the frequency a regulator may _not_ be providing enough power > to sustain that (even for a short while) and this may have undesired > effects on the hardware and so it is important to prevent that > malfunction. > > In case of bandwidth such issues will not happen (AFAIK) and doing it > just once is normally enough. It is just about allowing more data to > be transmitted, and won't make the hardware behave badly. > I agree with Dmitry. BW is a shared resource in a lot of architectures. Raising clk before increasing the bw can lead to a scenario where this client saturate the entire BW for whatever small duration it may be. This will impact the latency requirements of other clients. -Akhil.