Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp592401pxb; Wed, 27 Jan 2021 16:06:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZ1aD+ssWC9NqpHeLp761MSufomCSxWoOxNGl4O9pqRthRvsjeCojHOmkvA+6xWRieuBYd X-Received: by 2002:a17:906:cc89:: with SMTP id oq9mr8556164ejb.154.1611792402734; Wed, 27 Jan 2021 16:06:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611792402; cv=none; d=google.com; s=arc-20160816; b=up+ac+zkRomxU+Qci2T307NSd33kLdiBSyJt9RCVwFy1SOatXrMLgydPfP6YodsyeV gUIFvzeecX82mOklixPfWAmHrplTFGMVvtl9eE0bLQvztVP0hzSR/vbyBFYsWAqmVIcf QCbfWEN/1374doxEasfp+BNMX0cmdROkgRtskVk2bPkmvEgHai4c/NDEN1kKbHuuXMpB Kt6561WaiRN4Sf0MQoEaA8Eo7bUTRruSB0zrYw3QaosBZZTpnwx9j0nsgI3TIJGU+86S Tj5x16qqvhGpaPqf3JQAy9/1Gt0iR+t7vSWiFtdrvHgr69Es6kz6j1AJamSxcfnUhJL+ Pniw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dmarc-filter:sender:dkim-signature; bh=z5sITnYH+hKH5ob5jP7ZjC3SvuyrrXJFxVS7t/eQ6UM=; b=sv5BfbdOd59qp04n1ccBxpFNGv67D4BpJNVPlr2MrPD2OhyUo4uM2J7rW3BPyFXN8M 0gpp2WKu/RG2oMuTVe822C9ePkwLGsKio6kEP6t7Zq/+8dJG8pyizLkoCqvPU6WWId3n HwDDWSCDfmXnLke6aH3OmuGuNbZcO8l5efsHXah9LtL8ZUGN94OP/sTj4pnwAedmpilP l2Ye0vheT/V9gvCq3OW4PV5yaZNaQrSI077nB5664Y0Al3MFliOO0glHkP4RAqjOSj9E NwplunykAwssYCCxN/L6jOBNG9pJ3qa/d2bDh6DzO/YRPSxLDngN4OYlbJpdhiOjXcXW wcrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=f7b+sn0w; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si1943890edm.477.2021.01.27.16.06.18; Wed, 27 Jan 2021 16:06:42 -0800 (PST) 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=@mg.codeaurora.org header.s=smtp header.b=f7b+sn0w; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343935AbhA0Qcx (ORCPT + 99 others); Wed, 27 Jan 2021 11:32:53 -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) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 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.