From patchwork Thu Nov 16 10:43:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 16648 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp3122738vqg; Thu, 16 Nov 2023 02:43:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzKzTQPiDFzulrHrDAhRV+MZjITZJHgc+vlYbaEZcB/IklhsETj3LCTeHrQ1RudmoiRWXp X-Received: by 2002:a05:6830:cc:b0:6ce:267b:d409 with SMTP id x12-20020a05683000cc00b006ce267bd409mr8553860oto.13.1700131434748; Thu, 16 Nov 2023 02:43:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700131434; cv=none; d=google.com; s=arc-20160816; b=AJg0kH6hkLg8yaJQoQ2HZKKAj1RV4fCfylUPDsurg2EcZcrCs4tipxHI+dmcmGI9hx uhgbZrNnI1oh8/QeaZrOmdgjz1B0XpY30UUJV3R9r7gZ7nkUzBS0Pnb6wWGs0LSJG7/D AUCJf3o0/7HbTR2lzGn7UgFgN7m6Ms2jDGjSLat/ySNUBRVq1c7YyuwxhK+KILjyktbX 4bdeOTsRsh41rGIsHzPJRBrZjw/hqyh0/vpZYhKOLVNfoc3Do0HIftC/O0VKjVxSjwok WDxj70F4ZIZhlvVnWzSyPA8EmJ1NiGTraT6tMwOLwyzzIpaz1/dpdxDnoQg2dlPmperx 1D7Q== 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 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id l7-20020a632507000000b00578c64433c9si12718478pgl.894.2023.11.16.02.43.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 02:43:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; 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 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id D60858179068; Thu, 16 Nov 2023 02:43:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234970AbjKPKnU (ORCPT + 29 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 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 autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 16 Nov 2023 02:43:46 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782717019439730743 X-GMAIL-MSGID: 1782717019439730743 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. Tested-by: Stephan Gerhold --- 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(-)