From patchwork Wed Aug 23 11:45:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 716786 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2542EE49B5 for ; Wed, 23 Aug 2023 11:45:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234480AbjHWLpu (ORCPT ); Wed, 23 Aug 2023 07:45:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234449AbjHWLpt (ORCPT ); Wed, 23 Aug 2023 07:45:49 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82F67E65 for ; Wed, 23 Aug 2023 04:45:41 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2b95d5ee18dso85330341fa.1 for ; Wed, 23 Aug 2023 04:45:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692791140; x=1693395940; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O7tHqCtCBwrBi+V5VhXtnXcNtgviyB9B8EoBzfXwamQ=; b=E8GWGehguy7PP4MX5+Ef/QMUDP9jO042Djy0QuWaaJ8WBLX960EVJOJ5JAdzm6aXxS iFAsnk0PL4/fdEY9CHQ7JfdtzDW5RJ/ggoQpMcg9306EQ7lr5CZ+NR3RUnunLpQ3budb x+zdO03UVyovdggvHc4COXayuwUhMl67cK8Ne3sKgJhe7lGliC53GDaqz/Nus8BDuI7G gKqssHAGlbvdVCK/mjBJ2tNrRfpWcHTv8acmqxf7g6FXdVcZmUrNXIubaeT7V+70AMId AsNTSLsDHOoqmVD/huyhBJ6+MM/GBvTyBE6u14nvmL6bz2gc0T6OZCWPqvlvU6WS1xHT wzqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692791140; x=1693395940; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O7tHqCtCBwrBi+V5VhXtnXcNtgviyB9B8EoBzfXwamQ=; b=lgYN1an3ON8RJVFqTgc57ool8p7Kzouwv5681Pp4YnhJrqCR8ywEb4L05poAb4Nfvp vIsilYD6mIg+N0amHsI9VKhbSKDWTAGsBXJjVQ6BlZwilj7RQ6WWMah8JOi4LrpVIsor nttHC49lbrKCvNEFrYOvJcgP60fd9a7m4mMkfrW+NQ0JQXaqYRspnUrZsyiWLPK6ipRN xcxXcyBkuK/bwEv9KNJ+T1+/KbsNI7xP64qphCmCxgT6dOtaoDt2q/u+DKwk4aB9ZvZM ulVxpCHl2L3QDVTCSnSCNu9BIc5XpVPd683sdAjm8RJasNSA7LCvfcorpVGiVdDTHjuk /BiA== X-Gm-Message-State: AOJu0Yx9FHPh+QTFD72T4bSo/9u/Gy6a6E/qFQG7EHERpMY6Z6EOAn0o xgGZkKSYqO4WeFL5muK+DmS1Xg== X-Google-Smtp-Source: AGHT+IHdwziasj0D1MZ9uBcdhByqBC95ew9J9TcFICwlP0Jl9zRXSGXh3Dl8RPw6cWdVo/fTvnM4uQ== X-Received: by 2002:a2e:88d1:0:b0:2b6:cff1:cd1c with SMTP id a17-20020a2e88d1000000b002b6cff1cd1cmr9657741ljk.34.1692791139858; Wed, 23 Aug 2023 04:45:39 -0700 (PDT) Received: from hackbox.lan ([84.232.191.92]) by smtp.gmail.com with ESMTPSA id m18-20020a7bce12000000b003fbc0a49b57sm18503577wmc.6.2023.08.23.04.45.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 04:45:39 -0700 (PDT) From: Abel Vesa To: "Rafael J . Wysocki" , Kevin Hilman , Ulf Hansson , Pavel Machek , Len Brown , Greg Kroah-Hartman , Bjorn Andersson , Andy Gross , Konrad Dybcio , Mike Turquette , Stephen Boyd , Taniya Das Cc: linux-pm@vger.kernel.org, Linux Kernel Mailing List , linux-arm-msm@vger.kernel.org, Taniya Das Subject: [PATCH v3 2/5] PM: domains: Add the domain HW-managed mode to the summary Date: Wed, 23 Aug 2023 14:45:25 +0300 Message-Id: <20230823114528.3677667-3-abel.vesa@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230823114528.3677667-1-abel.vesa@linaro.org> References: <20230823114528.3677667-1-abel.vesa@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Now that genpd supports dynamically switching the control for an attached device between hardware- and software-mode, let's add this information to the genpd summary in debugfs. Suggested-by: Taniya Das Signed-off-by: Abel Vesa --- Changes since v2: * Reworded the commit according to Ulf's suggestion * Dropped the _mode suffix from the status * Replaced "mode" with "managed by" in summary show function drivers/base/power/domain.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index dfb4f1de540d..93350e67b0e8 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -3171,6 +3171,15 @@ static void rtpm_status_str(struct seq_file *s, struct device *dev) seq_printf(s, "%-25s ", p); } +static void mode_status_str(struct seq_file *s, struct device *dev) +{ + struct generic_pm_domain_data *gpd_data; + + gpd_data = to_gpd_data(dev->power.subsys_data->domain_data); + + seq_printf(s, "%20s", gpd_data->hw_mode ? "HW" : "SW"); +} + static void perf_status_str(struct seq_file *s, struct device *dev) { struct generic_pm_domain_data *gpd_data; @@ -3229,6 +3238,7 @@ static int genpd_summary_one(struct seq_file *s, seq_printf(s, "\n %-50s ", kobj_path); rtpm_status_str(s, pm_data->dev); perf_status_str(s, pm_data->dev); + mode_status_str(s, pm_data->dev); kfree(kobj_path); } @@ -3245,8 +3255,9 @@ static int summary_show(struct seq_file *s, void *data) int ret = 0; seq_puts(s, "domain status children performance\n"); - seq_puts(s, " /device runtime status\n"); - seq_puts(s, "----------------------------------------------------------------------------------------------\n"); + seq_puts(s, " /device runtime status managed by\n"); + seq_puts(s, "------------------------------------------------------------------------------------------------------------\n"); + ret = mutex_lock_interruptible(&gpd_list_lock); if (ret)