Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2638189rdh; Mon, 30 Oct 2023 03:25:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHEHSlio2U7jN93QPbpwX9OqQc6AWvRL8oboeQPM+4F49iJWRwRylMKauEj1n/IvKY1pOHL X-Received: by 2002:a05:6a20:160b:b0:159:c24f:5fa4 with SMTP id l11-20020a056a20160b00b00159c24f5fa4mr9043974pzj.1.1698661535835; Mon, 30 Oct 2023 03:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698661535; cv=none; d=google.com; s=arc-20160816; b=rxN5jMCOO5EU0xJZ74G0X+e8u7XGYQK3FO5UlrlYeQJC9Z3HU22t3tNmalw7V9sWR+ Gz0JSv/2sdVQ0n40GxtYZ57cYLiKqGwEqOmlVCMHi0wIUNZ0g9ogksmPaQHMCF2HmyJP TyuN3gKnXw/MuZbbmchT1JYIQewJoJGnB23wcxnRyIyq1jG9ybwsLt/Mxj3TC+FnCKSR uly7IyuCLkQIhzA2lDhyTx4t7ub+Qm2Bj5TCwEZy50/gIiJ3BrrYa+3cjEAJvy+HOUxJ KRULY9df4LBdAKe473p8OdpGAKYCtLR1+PpY1f0Y6O1I6Mk3xCUpSUwxffN3WuBf9vFe +Emw== 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=1N/2Vj2C4PIiKfPHSCW4+mtkbqzibb/OcJadYL0Oz5c=; fh=JUYlNDV7nRVv5GTX6O9FQA2k84zJVA9vaIwmsOtZmYc=; b=eoD2rEgTpAcTjBH9LNDLaCPPRhDiADFG93fUM0lepYNtfI2Hm8wJXLQrzsKOS9eyuQ tq1HLWAsVImjQwRjzRyRObMdoph8RSyqcb8pbS25FzLoZ4f+DLFRlcJixqD5t6ANx/Hd mqy1E+cODKhY/8a5/CS0r3cU0TIcwJdlzK4toSiC0ctyVWatrfz9wVb+N7BKvYMV/bVd eufHFAXfFXdeOtff8v8s3ndo593NwSKeC1T1UnegV5JYPmlISDTFsgfWJamtD2TlzIye atIoijYnFxrS+tg2WNZtu132oCtNnfN6VeeZROa53pg/t5IV/E4VYmNhpm1OxCxdGUKO wmLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yHEycjEW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id jy6-20020a17090342c600b001ca27dfde3dsi4732933plb.541.2023.10.30.03.25.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 03:25:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yHEycjEW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 9A047807CEE2; Mon, 30 Oct 2023 03:25:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232624AbjJ3KZB (ORCPT + 99 others); Mon, 30 Oct 2023 06:25:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233142AbjJ3KYr (ORCPT ); Mon, 30 Oct 2023 06:24:47 -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 D8EBD1996 for ; Mon, 30 Oct 2023 03:24:23 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1c434c33ec0so30983265ad.3 for ; Mon, 30 Oct 2023 03:24:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698661463; x=1699266263; 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=1N/2Vj2C4PIiKfPHSCW4+mtkbqzibb/OcJadYL0Oz5c=; b=yHEycjEW0VG2+u+jLQ13QzBh5JafkHVbuiYlSPXGgZa5v7ZhEJrcJ2CU5lb8dn8DOe xUgkLljiPcOKXkfgTsgBkTDZsg9YOGNWEWQi+5Aqssd3Ivj2gVUDE0r4v2Wocj8umKRo joLmnmckRiDnwXrhmDoyTlVGAl4hHMTY6e3bjYa2IpMqHzHxO7/3dBptqbokvAqMGHh4 7NLvsMA86pxIxSHi04zJZV1ewtoRX/LpZrrBddIiFCo6hH19JuiCN8TmOZPV4NB3ls0D p9lSueXKkioW5lPQXgicZubvPciDA76/zQ/+14Q+Rwi09xOV8nX49HPBdWB9hUBUj/ul p3Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698661463; x=1699266263; 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=1N/2Vj2C4PIiKfPHSCW4+mtkbqzibb/OcJadYL0Oz5c=; b=ER53f5FQWXjVV5hjhkVTOs3e96NaXD7+Awh4Y24QvCBpJRjLgAlHF8wgsjVrwb33ub 0rjVbDyE0gHzBR4XdIe9ZAsnpWbrLPLECfS0HqKfCjIL8OtpZNwaY1oIYyRi+DKPxphS Vde3BtKqrIkZnl6icMemv37hjCDLT45nxO22pcTRtqEdBDspUimial6m7LMjXi4OWM2F On9yx77LryCRyF7D4pvgb8rXInawZIVvRwo4nASutH8CNJKpUKsQt9haohTeETxIv4iV cQ87spqWgfP+Hm9ZUXh0Lq30Bwq5qlynIhELWzfMA2Pi46d7xspEDAr9ZeS/8DOhSENJ 4pfA== X-Gm-Message-State: AOJu0YxQd3+XhYFTCsnI4FAQdb/z2szUz2HuQnIAJ/LkHIJKbhKAL4XP 5xL8V1F8Bpzkia/6JMHVJGFS2g== X-Received: by 2002:a17:90b:1904:b0:280:16bb:8169 with SMTP id mp4-20020a17090b190400b0028016bb8169mr4115127pjb.40.1698661463214; Mon, 30 Oct 2023 03:24:23 -0700 (PDT) Received: from localhost ([122.172.80.14]) by smtp.gmail.com with ESMTPSA id s63-20020a17090a69c500b00263b9e75aecsm5641272pjj.41.2023.10.30.03.24.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 03:24:22 -0700 (PDT) From: Viresh Kumar To: Nishanth Menon , "Rafael J. Wysocki" , Stephen Boyd , Viresh Kumar Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Ulf Hansson , Stephan Gerhold , Konrad Dybcio , Manivannan Sadhasivam , linux-kernel@vger.kernel.org Subject: [PATCH V2 0/3] OPP: Simplify required-opp handling Date: Mon, 30 Oct 2023 15:54:14 +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=-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 pete.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 (pete.vger.email [0.0.0.0]); Mon, 30 Oct 2023 03:25:26 -0700 (PDT) Hello, I wasn't able to test this locally (despite trying to hack it around) and need help from someone who is `virt_devs` field of `struct dev_pm_opp_config`. Pushed here: git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git opp/required-opps -------------------------8<------------------------- 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. 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: Level zero is valid OPP: Use _set_opp_level() for single genpd case OPP: Call dev_pm_opp_set_opp() for required OPPs drivers/opp/core.c | 176 ++++++++++++++++++++++------------------- drivers/opp/of.c | 48 ++++++++--- drivers/opp/opp.h | 8 +- include/linux/pm_opp.h | 12 ++- 4 files changed, 145 insertions(+), 99 deletions(-) -- 2.31.1.272.g89b43f80a514