Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2386262rda; Wed, 25 Oct 2023 00:47:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEaWJnpfxOi8b1IJvPcvkTm8RYnXLQGlct6uxqQJGodjxqdbItmbgkSqVxXH9NRmk2wI28Y X-Received: by 2002:a81:6cd2:0:b0:5a8:874:bb3a with SMTP id h201-20020a816cd2000000b005a80874bb3amr14988924ywc.31.1698220019802; Wed, 25 Oct 2023 00:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698220019; cv=none; d=google.com; s=arc-20160816; b=sNSB1WSSxql1JvUS+jAh9Ns7eGEK/IbgIil66rJVYlkuRYAWiLmm2XG7PgmcevyXE2 D4vvRw66GXa9AZGEDXb/oTgHFtFH/Kv2FzK6hInjBHDcFP5wqP3ONRzkI8k6pW+4dWsA XBpt7oNMVoCliidBPeYEb+sHKk99+1yT7VCs/oe4wUH9doe3NS6GzU/OyF2DYxNahfMu FccJLg3fRrA9wQJW2skyxykTUMw3TxutKW0Z1Ss3QttALY1eAbhKR3hh2/ShuTAIUWsO R3F8+hnNizkLyr8EPjBlaVQOC9CJSai1QK7CxtoNbvshQAHiOdbOlXdQGoBINN2oQ8JM dQ6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Q1AcdXM2oNG7X6kDVrsLsHOjBP4fqbkgPzfufbyu9xI=; fh=sAYHdDsgrQWyLxF8wv5FyG8RdxG3TI38PdEGLXabhsQ=; b=FeziE91e2S7kPUEvdbNv6VQOc+lMk/najxI9o3JkSIpU2vqiSGYPjZv3i7P+w3hDjt 3FYHg5f0gUToa1T15K5xjU/kmjlGNdF+VLu1bguGiXRLLO6MtwU5NRTUWvd+Amu/Sb1r 14K6rGjJs3B9yFGVaAHRxKvmTQv0MU5cmZ9yrnjy7oT7h0fYI66XVbRSO8QV7kHTt7Xp SBa9TLJjIBbXVlGnMYrRGw1IDeYlNcEf6HBKl1THABo2P+gGT1UMXBCbgPZTFxpin15U vWZOhaTTH6DeEGi0q+pqfl60z2Cbbgd62ERvGtnzy9D7GbMwG78eFduMtL6lNsNTyNB2 sBkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cgh2T62m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id a11-20020a0dd80b000000b005a80f09948asi10158352ywe.131.2023.10.25.00.46.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 00:46:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cgh2T62m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id CD2BE8020DA3; Wed, 25 Oct 2023 00:46:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234230AbjJYHqp (ORCPT + 99 others); Wed, 25 Oct 2023 03:46:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232864AbjJYHqC (ORCPT ); Wed, 25 Oct 2023 03:46:02 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E64CB44B5 for ; Wed, 25 Oct 2023 00:36:37 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1c9b7c234a7so46119165ad.3 for ; Wed, 25 Oct 2023 00:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698219397; x=1698824197; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Q1AcdXM2oNG7X6kDVrsLsHOjBP4fqbkgPzfufbyu9xI=; b=Cgh2T62mCUAEsjgnHL5w/47TYSdmGtb18N/ii8XieIUVr7j4iG0Uygj5QW2DbvQsBi WoGhXW2trTiA73V6+4iuHa4rYFGS17AzcRcH5iVD/wyErLmFYGPT9mGfpKTicSJLuQ// V0mg+QjRFyCrxKwll0pKC4Z5FyyrKdLAg/cCtkHOZuZj7zknnYJu1Y9DOlfbSF6QZA3X Iedqjz758oY7Jo2lwkSKLP4H+MuZ8mjb9hkYwtCIeZIKlsAz5WVBbzjQG4NVXi1rnA/O GxACI7IcB1Ib661O97A4TQCWvEOs1xy4M9AhFg8LTL4I0NI/uyKMzdwydUxUayNzGO6s yXYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698219397; x=1698824197; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Q1AcdXM2oNG7X6kDVrsLsHOjBP4fqbkgPzfufbyu9xI=; b=K3sJVHfp2W0ijOQQ/7e6sLonTKjeD7Zr5iahgdVDhPsAgv3CWLUbf1d865h8XzXDWe yjP3q+5SV8QyPodKwhLHh968cUZc1CXOOW6PfCOuVcerG3TsuyxqWktkfkeee1O3KYpl b8crVw678O1g1kkY4iDwrg24XdTAAjcahiysa4/cR9je3wyCukxgrFpbmzFmj2fadbeR KqfFLBhCRy19ETxmO4LukN6KHECnbuisUHVNd7lOMga10KqpQVU0DthCvISPmwCCAr2O 6p5xhsv6ZPG6ipssNn5E5Wzoe+eHzbB+rR0ftq7kVFDR+rHpVN+8de0ae1w+zHW+tA44 /i5Q== X-Gm-Message-State: AOJu0YyQxeUyFeqaw969VyMnM7N3wTCPiSrj6C1c3vN9iuS1nkZI4NHB UvYIox1dXgZ2TZJ/zSG1XP3oig== X-Received: by 2002:a17:902:cf47:b0:1c0:ecbb:182f with SMTP id e7-20020a170902cf4700b001c0ecbb182fmr12511654plg.5.1698219397035; Wed, 25 Oct 2023 00:36:37 -0700 (PDT) Received: from localhost ([122.172.80.14]) by smtp.gmail.com with ESMTPSA id x18-20020a17090300d200b001bd62419744sm8647760plc.147.2023.10.25.00.36.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 00:36:36 -0700 (PDT) Date: Wed, 25 Oct 2023 13:06:34 +0530 From: Viresh Kumar To: Stephan Gerhold Cc: Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Vincent Guittot , Ulf Hansson , Konrad Dybcio , Manivannan Sadhasivam , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] OPP: Call dev_pm_opp_set_opp() for required OPPs Message-ID: <20231025073634.4et5epfog25o2pxf@vireshk-i7> References: <6de4fcb5bb943a131d0cdf0a858bd35af02a2f88.1697710527.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 25 Oct 2023 00:46:56 -0700 (PDT) Thanks a lot for taking this up, really appreciate it Stephan. On 24-10-23, 13:18, Stephan Gerhold wrote: > Unfortunately this patch breaks scaling the performance state of the > virtual genpd devices completely. As far as I can tell it just keeps > setting level = 0 for every OPP switch (this is on MSM8909 with [1], > a single "perf" power domain attached to the CPU): > > [ 457.252255] cpu cpu0: _set_opp: switching OPP: Freq 998400000 -> 799999804 Hz, Level 0 -> 0, Bw 3200000 -> 1600000 > [ 457.253739] genpd genpd:1:cpu0: _set_opp: switching OPP: Freq 998400000 -> 799999804 Hz, Level 0 -> 0, Bw 3200000 -> 1600000 The thing I was more worried about worked fine it seems (recursively calling dev_pm_opp_set_opp() i.e.). > [ 457.304581] cpu cpu0: _set_opp: switching OPP: Freq 799999804 -> 533333202 Hz, Level 0 -> 0, Bw 1600000 -> 1600000 > [ 457.306091] genpd genpd:1:cpu0: _set_opp: switching OPP: Freq 799999804 -> 533333202 Hz, Level 0 -> 0, Bw 1600000 -> 1600000 > [ 457.323489] cpu cpu0: _set_opp: switching OPP: Freq 533333202 -> 399999902 Hz, Level 0 -> 0, Bw 1600000 -> 800000 > [ 457.352792] genpd genpd:1:cpu0: _set_opp: switching OPP: Freq 533333202 -> 399999902 Hz, Level 0 -> 0, Bw 1600000 -> 800000 > [ 457.353056] cpu cpu0: _set_opp: switching OPP: Freq 399999902 -> 199999951 Hz, Level 0 -> 0, Bw 800000 -> 800000 > [ 457.355285] genpd genpd:1:cpu0: _set_opp: switching OPP: Freq 399999902 -> 199999951 Hz, Level 0 -> 0, Bw 800000 -> 800000 > > Where do you handle setting the pstate specified in the "required-opps" > of the OPP table with this patch? I've looked at your changes for some > time but must admit I haven't really understood how it is supposed to > work. :-) Thanks for the debug print, they helped me find the issue. > [ 457.304581] cpu cpu0: _set_opp: switching OPP: Freq 799999804 -> 533333202 Hz, Level 0 -> 0, Bw 1600000 -> 1600000 > [ 457.306091] genpd genpd:1:cpu0: _set_opp: switching OPP: Freq 799999804 -> 533333202 Hz, Level 0 -> 0, Bw 1600000 -> 1600000 The second line shouldn't have had freq/bw/etc, but just level. Hopefully this will fix it. Pushed to my branch too. Thanks. Please try again. diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 056b51abc501..cb2b353129c6 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -1070,7 +1070,7 @@ static int _set_required_opps(struct device *dev, struct opp_table *opp_table, while (index != target) { if (devs[index]) { - ret = dev_pm_opp_set_opp(devs[index], opp); + ret = dev_pm_opp_set_opp(devs[index], opp->required_opps[index]); if (ret) return ret; } -- viresh