Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3187146rdb; Thu, 16 Nov 2023 02:43:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IE5Ahhi2dTeLc/dqtJxs/LUnci7bkolTIa4mI07zNY8+naHEeXma+AKGrCS27ZIFWb5c19/ X-Received: by 2002:a05:6a20:6a04:b0:186:7c17:62ce with SMTP id p4-20020a056a206a0400b001867c1762cemr11677816pzk.61.1700131431575; Thu, 16 Nov 2023 02:43:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700131431; cv=none; d=google.com; s=arc-20160816; b=MFbXf4LKHy0JhD6K2nP57M8WiOZkm/5MGArqyDoAOIvMBMRId6Z46w9S5P0GnVI1Or D6OqHjYqi930PpbvBBpWNUXPS4i9yj4Csd89id1P+NbjWrbbppczdZI/yMMyyFK/a6DD BvjVGeygioGTnq1jz4LNjlTRgH1gyD90mycUj1HoI4ZxACSyHVAYdtoUdy2pCHFLq6wD UG+tYQWs3xlT5fUQFkPCwrEDc/GpvYg0EHCuOE0Z4PEVanApt5sBuY8FEbFeHG9w3Ia7 Yk04O5YI2fS8KdpZi8VVj8g8i8SkYRbvi5zEm49MTjb4KRtCgVnfODTIc1HlTHdSrOjj FAgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=pBCtZrQ5H8T1TJ4dOAfwL/GAJ5Ua7JQfulVL3ulFxHg=; fh=Rz8Vo64b7t3LSs3j4kV/9dec65EPkI6EAoChP+2LtTQ=; b=PKYKUgSoGKDAWwQgiFsiVdcJXver2n3wt0p+dQf4Yg4ezTsFL0bJBZf1ATEfp3X8zd Lo55+GEqODDiZU5VdcIuhH4c62QDgGiuvgYCozK/wcoItfCX76E0u4KsMenS+sigvvVY djns1/jxFdGAFw9wXg/8c0KnTsWElCTLn27/12bmWMTuxvBX1updJbt47CgEHawpFlA7 mGchrrwouiFcdyeYVNskFafVElE3xZ0b7zWcYQZlTqjN3dmNGE+A1YYc/QtyZ4Z+AfS8 2AnznHKKKQr7sHg4Z1aQp7mRvkqZ2XwiCxC8MMB87CkZ9u1K7iNAp0Gg5FHRicrP1uVJ 4HeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cIolR5mm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id ip9-20020a17090b314900b0027383ac5ebcsi1816646pjb.130.2023.11.16.02.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 02:43:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cIolR5mm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 5837F81C09AD; Thu, 16 Nov 2023 02:43:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230193AbjKPKnU (ORCPT + 99 others); Thu, 16 Nov 2023 05:43:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230348AbjKPKnT (ORCPT ); Thu, 16 Nov 2023 05:43:19 -0500 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 496D9B8 for ; Thu, 16 Nov 2023 02:43:16 -0800 (PST) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1ccbb7f79cdso5757665ad.3 for ; Thu, 16 Nov 2023 02:43:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700131396; x=1700736196; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=pBCtZrQ5H8T1TJ4dOAfwL/GAJ5Ua7JQfulVL3ulFxHg=; b=cIolR5mmT90CwgMmOYgQTvSjmHBJ37YYjOxL7KZFwEVgsT83yx594wWoBtGJYAEmBM ecIacn7Oq5dxY2pCSQXHUgUvgLIMgVRr3+X3nKpnCaLwyTNyZnga22FQrYwB0DhXy5aa Ynvch+aY5AVtENWxuFGvH4lOMNYLHz4CSD85676wA182LxvOcGMavnoePhIpJrSqCgHJ D/BK+608DIypvPA1fEKO6pPhPfjz+ehdkqrmaVG8doIGsZc4BovSLA6yqsOKPlGPF4jR k3reA/4YaX/6mSvOjFH7mNmbgLozm7J/yhNADEBwdtXgTeZYzfxHnZD06YZOP8rwGxk/ 4uYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700131396; x=1700736196; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pBCtZrQ5H8T1TJ4dOAfwL/GAJ5Ua7JQfulVL3ulFxHg=; b=Uxb/uVZoaiirLGX+weevqxbLQT9MlQy3qjgrJh9ul5hfXZdUOareBRRq/0yvraEYB3 9Z4S3FMqC3lrtMKtyxptOBcHS2D8B/iMwwXCOUqQp7MUhO4KiBrXuczd/gZOHmDzhkIO wcMvKoyCnin4TVuaOeC9q1B1xFqRvBFwL0C40RJAvUp8dce3cykO4f+xdm6pAbTlVWoG KDqNrIj5BC49kuA+8JvPrr+1wj6+PfRYI0Gsx6ro87ZxvnzdexYXb8jR77iEAaa1f1za AKCTX52ruV/tj+rVick2PhoBEKUZcvKP+anql0h2ryWirxCLEFnoyVlUPrpMmsYEjRFq LQww== X-Gm-Message-State: AOJu0YxZlUcahdiKA0YR8XZ47eTEaIIlKxJY48y/xNyiwWkdcskBvsYc rTuYjwLlDOQTdOJSXVOrdH05sw== X-Received: by 2002:a17:903:2289:b0:1cc:345b:c7e1 with SMTP id b9-20020a170903228900b001cc345bc7e1mr9101817plh.60.1700131395561; Thu, 16 Nov 2023 02:43:15 -0800 (PST) Received: from localhost ([122.172.82.6]) by smtp.gmail.com with ESMTPSA id w7-20020a170902e88700b001acae9734c0sm8880495plg.266.2023.11.16.02.43.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 02:43:15 -0800 (PST) From: Viresh Kumar To: Ulf Hansson , Stephan Gerhold , Nishanth Menon , "Rafael J. Wysocki" , Stephen Boyd , Viresh Kumar Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Konrad Dybcio , Manivannan Sadhasivam , linux-kernel@vger.kernel.org Subject: [PATCH V3 0/3] OPP: Simplify required-opp handling Date: Thu, 16 Nov 2023 16:13:04 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Thu, 16 Nov 2023 02:43:33 -0800 (PST) Hello, Configuring the required OPP was never properly implemented, we just took an exception for genpds and configured them directly, while leaving out all other required OPP types. Now that a standard call to dev_pm_opp_set_opp() takes care of configuring the opp->level too, the special handling for genpds can be avoided by simply calling dev_pm_opp_set_opp() for the required OPPs, which shall eventually configure the corresponding level for genpds. This also makes it possible for us to configure other type of required OPPs (no concrete users yet though), via the same path. This is how other frameworks take care of parent nodes, like clock, regulators, etc, where we recursively call the same helper. Pushed here: git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git opp/required-opps V2->V3: - Dropped patch 1/3, merged. - Added a new commit to avoid propagation and a WARN() for parent genpd case. V1->V2: - Support opp-level 0, drop vote i.e.. - Fix OPP pointer while calling dev_pm_opp_set_opp() recursively. - Minor checks and fixes. - Add Reviewed-by from Ulf. -- Viresh Viresh Kumar (3): OPP: Use _set_opp_level() for single genpd case OPP: Call dev_pm_opp_set_opp() for required OPPs OPP: Don't set OPP recursively for a parent genpd drivers/opp/core.c | 180 ++++++++++++++++++++++------------------- drivers/opp/of.c | 49 ++++++++--- drivers/opp/opp.h | 8 +- include/linux/pm_opp.h | 7 +- 4 files changed, 144 insertions(+), 100 deletions(-) -- 2.31.1.272.g89b43f80a514