From patchwork Wed Oct 2 12:22:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 13819735 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 71321CF31B4 for ; Wed, 2 Oct 2024 12:24:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=LQqVyxDvEWjTmmvG9BCvIQQDCR/TS1dw1HUpo9ttVho=; b=2cyku6NssN6gG6SkuIY0fKADE7 CKtLsXc3rd8YXRqq6zd+tDEdk2Oh2x5C79LI6ngd4C826tkunxYbYvmHCOM9B6kb9BlDYFCVXb5H0 gCwZ/pBYWfmvc8JxOgm8BH7i9Ivt0sQIv/BcW9dq/l2tKJQNxGyB2+m8WOQDLIFhpIf5kvs+hRWMt 7kTBVK1H17+yfR4vIUIPznTp+Ufc/nrjirRQWUheH2l33G0KwcvjUOCuPbZOT0e6Y4ZiIzvgVx95V Z/bVRsj02FfYsLdNCgdVu9YAyxM8iFdudu4iJScpDVj/6yyl9HNehsH4bsRBQAoQJJVBppFrwwrHD uk8G92DA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svyOe-00000005qvM-0xEg; Wed, 02 Oct 2024 12:24:00 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svyNN-00000005qTP-3gEM for linux-arm-kernel@lists.infradead.org; Wed, 02 Oct 2024 12:22:43 +0000 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-5398f3be400so4380067e87.0 for ; Wed, 02 Oct 2024 05:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727871760; x=1728476560; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LQqVyxDvEWjTmmvG9BCvIQQDCR/TS1dw1HUpo9ttVho=; b=IRxrhrHi5aPUncd6wZ0Y2zHEUTOncT23X07JqQH1hUR6yHWgqYuR8QpOnjXKQ+Q0Re 5UizM5CcCMketc0AXt98WpXeTv98MNWZK7v2X9i5WjP+AZJAzjv4+kaxOGFCqFcVX2tB jkDiUO7BPYa/M/nn027Hln/jnzwarr2ao7qYn6idQp8f4YOETrkaI89C8CZjflsg8Cxb qZKFf68dcS7cgQ6Dk83dCw2hurAgrs8ysEsdZ1JqDXgQbcLBmll06drW1xpJAgzih3no sWMZbs6ySYmr0f8Ul7F4GEh8eU3TpmgyO9elAWeUAeJbgNYjiOGYE6oDGOmiK2QjBK0u tZng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727871760; x=1728476560; 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=LQqVyxDvEWjTmmvG9BCvIQQDCR/TS1dw1HUpo9ttVho=; b=MSLQP/YfG4nkj4hyhN11Quqg/kl62EfuE2dRIxAlj3To1IjhE0r0zTG6vhGQUn7yxl 3JtbVmS5QOpRqkR4AgW60Y5qogploK++fv7eJNMfCghtPD6bYtXTtmm3fQ8BWdE2B1nX TbUqRxu8q3UNCdgi4n5+J/iHvOzwzw6xfVYGjkLQvnLGY0ZUjGhDXQjWIX4ScwOZKmx4 wnodCxsXCDMmuSu8MTMFD2gPOEckOT1ibF/7Hbj7NST+ffgVBX4r0f9Ec6aMQod7wuHI VaCnwFv7cda1onUfFwnG1TmU9XIb3emdXtj8hJOboO/bfSnEwSl0AcNHBnThz8wA0cAl 72oQ== X-Forwarded-Encrypted: i=1; AJvYcCXXrI35mFo+KyQGDkzHpt31D6sGiXFPrLhu4yRz5CB5BwUNtzZ1zDs7RFWEVHIg1h6UxczBI70XVGmZLxcCdSmP@lists.infradead.org X-Gm-Message-State: AOJu0YxlZkh4gJIhepZg5JQd+Bo9PSU0615HJjKsqMALS7fmViPzSJdy 46N4KQ+k9D2zM8MP5cd4yOqU/fQj4ZNkAF5orJew7H52NnLuCNHLeOBVBnuuIw8= X-Google-Smtp-Source: AGHT+IGkdIq3Z94WzFKrLjvVjRVqOvUim5HWVDFGQ3X2YlPmlUBY8smvw3gUtH35sLjRTrOlJGV3uQ== X-Received: by 2002:a05:6512:1189:b0:539:9f52:9ea with SMTP id 2adb3069b0e04-539a07a8999mr1648429e87.53.1727871759573; Wed, 02 Oct 2024 05:22:39 -0700 (PDT) Received: from uffe-tuxpro14.. (h-178-174-189-39.A498.priv.bahnhof.se. [178.174.189.39]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-538a043204fsm1912659e87.165.2024.10.02.05.22.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 05:22:38 -0700 (PDT) From: Ulf Hansson To: Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: "Rafael J . Wysocki" , Dikshita Agarwal , Vedang Nagar , Bjorn Andersson , Konrad Dybcio , Nikunj Kela , Bryan O'Donoghue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Stephan Gerhold , Ilia Lin , Stanimir Varbanov , Vikash Garodia , Ulf Hansson , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 00/11] OPP/pmdomain: Simplify assignment of required_devs for required OPPs Date: Wed, 2 Oct 2024 14:22:21 +0200 Message-Id: <20241002122232.194245-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241002_052241_952675_5B129FFE X-CRM114-Status: GOOD ( 12.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Note, due to dependencies this whole series is best funneled together through my pmdomain tree. Thus I am looking acks/reviews/tests. Changes in v4: - We realized that genpd can't solely be responsible for assigning required-devs. In particular in the multiple PM domain case, we need platform code to specify the index for a device's required OPPs [1]. In this version we take that into account by extending dev_pm_domain_attach_list() to cope with required OPPs too. [1] https://lore.kernel.org/all/CAPDyKFp2s4mPtdU6pMzPbBqqLFxZa1esrXyqXL6UJO-gU-PsVw@mail.gmail.com/ Through dev_pm_opp_set_config() the *_opp_attach_genpd() allows consumer drivers to attach a device to its PM domains. Their corresponding virtual devices that are created by genpd during attach, are later being assigned as the required_devs for the corresponding required OPPs. In principle, this works fine. However, attaching a device to its PM domains is in general better done with dev_pm_domain_attach|detach_list(). To avoid having two different ways to manage this, this series prepares for the removal of *_opp_attach_genpd() to finally also remove it. Kind regards Ulf Hansson Ulf Hansson (11): Revert "drm/tegra: gr3d: Convert into dev_pm_domain_attach|detach_list()" PM: domains: Fix alloc/free in dev_pm_domain_attach|detach_list() OPP: Rework _set_required_devs() to manage a single device per call PM: domains: Support required OPPs in dev_pm_domain_attach_list() pmdomain: core: Manage the default required OPP from a separate function pmdomain: core: Set the required dev for a required OPP during genpd attach OPP: Drop redundant code in _link_required_opps() drm/tegra: gr3d: Convert into devm_pm_domain_attach_list() media: venus: Convert into devm_pm_domain_attach_list() for OPP PM domain cpufreq: qcom-nvmem: Convert to dev_pm_domain_attach|detach_list() OPP: Drop redundant *_opp_attach|detach_genpd() drivers/base/power/common.c | 44 +++- drivers/cpufreq/qcom-cpufreq-nvmem.c | 82 +++----- drivers/gpu/drm/tegra/gr3d.c | 11 +- drivers/media/platform/qcom/venus/core.c | 8 +- drivers/media/platform/qcom/venus/core.h | 6 +- .../media/platform/qcom/venus/pm_helpers.c | 44 +--- drivers/opp/core.c | 198 +++++------------- drivers/opp/of.c | 39 +--- drivers/opp/opp.h | 5 +- drivers/pmdomain/core.c | 76 +++++-- include/linux/pm_domain.h | 9 + include/linux/pm_opp.h | 42 +--- 12 files changed, 210 insertions(+), 354 deletions(-)