From patchwork Thu Aug 22 22:45:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 13774317 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 A9AB0C5320E for ; Thu, 22 Aug 2024 22:47:49 +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=GDln139mCm+Zd13awBRXGy0VzjVE5RxG35fqlHyQFyw=; b=CgK/076Yky5pp4Vc2rk1N9Rjd0 TLTNWp9NjchSQk2exmLw8v42cBX2z3mAzPJjxUjI4HpNQqX1AvdSrAXHKl5pAN1en/ggQKEcXygxW aIY2dImbWC956aWxoHVy3s33mS/NU0vk8xO53+U6Z5ftVeNSF12vHNUKyod4XUZRI+hSjak1UTbKk KK0e/VD4sBfDxbfp/V1BjvBqmt4vpRvGa0AhaI0YHUScYMYCySNrOwjWhyJ8z7dEqL3kw8VBicnDt 3CN6DPoITCj9akQoV/Wxl+cauJ47qy984mUa5c8sz0/5dFktOjTsVIXFMsnPPe2AfSQu6/sEXVC5/ p52zy+jw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shGai-0000000EW18-1A3t; Thu, 22 Aug 2024 22:47:40 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shGZC-0000000EVcS-31k3 for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2024 22:46:11 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-53346132348so1563139e87.2 for ; Thu, 22 Aug 2024 15:46:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724366764; x=1724971564; 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=GDln139mCm+Zd13awBRXGy0VzjVE5RxG35fqlHyQFyw=; b=Nar2bXBvDwDgFpBilW2Vqoe95e6KjXz/st/vo+aGEVLmTVJS9Pp/p/REjxFOsyxJnz r5BwCznjWOR3tAJG+23349vTKo/tzjJV++6qCmu2OI8LTdCWRaYEtAdhkyExwCbTh5bn yoLstqoTLpaR0jkiobVenw1P7HOqI6emPlaYm5traae1pB4Vc9L99xbEZ0GdvWcQR+qJ SceT9BFt9D5VWcOzKAS13KSTKGQX5zTlcRIx8FikIne8jOnuFEUh1kDHwH3M75Zh56Ax ZMiKgUC76T/yaaBVZD8/M//Iq6bgkxWVFt9YUhkYQjelZue24DQqjvgDWybERAO5Tumb 6vgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724366764; x=1724971564; 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=GDln139mCm+Zd13awBRXGy0VzjVE5RxG35fqlHyQFyw=; b=rDoEFmxrEBcnSt3Hjxwwel1Fki4iY6uygM84s0BhpzDp/1mO08tf/Loilz9NU4NIxw Ne/roADk+OaXURvsWiDK4RP+H2NdE+IaFb7pq7YOIhTPji0hpviMs90yduQVRSHI2+LC EiLQloQjmqvQd+wgcyPn8rrL5ieMvcEd65SzDBTV6wOVzy/jwSKq+lKjJpjq8t7jXAXn e8PjNfNzzYEY4BVV8yXZBH6GPwpUivcSrWfSE1DVo5al9gnhyqtmWC4vhdVHnr8oKcww d4jmwBNdG4rgpbjvUyof49FL/ZSQH9sni0kMtkpf2/UZVQot0cFY5g3dK1QwD9WTiAUB DtLQ== X-Forwarded-Encrypted: i=1; AJvYcCWfUJvZLHlpZHoQyn5Y36OSw3Q+XwxJCQt3jeTJ1tdrtalBKMujELDh0eL/5+KAwU78xJ1QmFLKG9gLJnPzyGIa@lists.infradead.org X-Gm-Message-State: AOJu0YyMXNr5uubhmp446MkMoHGkn8U3/0KOvCGOSvXSgmZY2EJeN7UO 3H/aGGyjsbz5XfBCXoVPj2wfpEhnQmmL3hTAJK5W6tuXDX5jzIjW1C8q3pl7jBU= X-Google-Smtp-Source: AGHT+IFjVQunj9GKCtth0S4ejm9CXTEW6D+raTuzjDc0w/Drq5/I9hvp1yQaTp6WSmFZ8QYDX2Jjiw== X-Received: by 2002:a05:6512:128a:b0:52f:c27b:d572 with SMTP id 2adb3069b0e04-534387c4b18mr189259e87.59.1724366764414; Thu, 22 Aug 2024 15:46:04 -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-5334ea362a4sm379443e87.66.2024.08.22.15.46.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2024 15:46:03 -0700 (PDT) From: Ulf Hansson To: Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: 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 v3 00/10] OPP/pmdomain: Assign required_devs for required OPPs through genpd Date: Fri, 23 Aug 2024 00:45:37 +0200 Message-Id: <20240822224547.385095-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-20240822_154606_953762_09A24A5E X-CRM114-Status: GOOD ( 17.03 ) 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 Changes in v3: - Combine the two series [1] and [2] into one. - A few minor changes to consumer drivers. - Clarification in commit messages. 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, using dev_pm_opp_set_config() for 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 prepare for the removal of _opp_attach_genpd(). Moreover, it converts the few existing users of the _opp_attach_genpd() into dev|devm__pm_domain_attach(), allowing the final patch to drop the redundant code that becomes redundant. To test this, I have used a QEMU setup, with local PM test-drivers to try to test all various combinations of single/multi power/performance PM domains for a device. Hopefully I have covered it all, but I would certainly appreciate if someone could help to run a slew of tests on some HWs. Note, due to dependencies I think this whole series is best funneled together through my pmdomain tree. If you think there may be issues with this approach, please let me know so we can figure out the best merging strategy. Kind regards Ulf Hansson [1] https://lore.kernel.org/all/20240718234319.356451-1-ulf.hansson@linaro.org/ [2] https://lore.kernel.org/all/20240723144610.564273-1-ulf.hansson@linaro.org/ Ulf Hansson (10): OPP: Fix support for required OPPs for multiple PM domains OPP: Rework _set_required_devs() to manage a single device per call pmdomain: core: Manage the default required OPP from a separate function OPP/pmdomain: Set the required_dev for a required OPP during genpd attach pmdomain: core: Drop the redundant dev_to_genpd_dev() 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/cpufreq/qcom-cpufreq-nvmem.c | 79 ++---- drivers/gpu/drm/tegra/gr3d.c | 38 +-- 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 | 252 ++++++------------ drivers/opp/of.c | 39 +-- drivers/opp/opp.h | 5 +- drivers/pmdomain/core.c | 107 ++++++-- include/linux/pm_domain.h | 6 - include/linux/pm_opp.h | 42 +-- 11 files changed, 217 insertions(+), 409 deletions(-) Acked-by: Viresh Kumar