From patchwork Sat Sep 23 11:50:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 725995 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 857BFCE7A8F for ; Sat, 23 Sep 2023 11:50:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231453AbjIWLu1 (ORCPT ); Sat, 23 Sep 2023 07:50:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231431AbjIWLu0 (ORCPT ); Sat, 23 Sep 2023 07:50:26 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BFD11B2 for ; Sat, 23 Sep 2023 04:50:20 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-99357737980so443813666b.2 for ; Sat, 23 Sep 2023 04:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695469819; x=1696074619; darn=vger.kernel.org; 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=gkMg6Ss1ODOcr8VdxRq6yPqfjTyE6Onn/Fwc4BWB7DM=; b=rLkzUVP9FvDi4+xOnZH7Iga1U2MJSV+W/0G+rtds2o8MTzHpFrZ009AS4vb/8PN6td f9vExEq4tuN4HGGf7XfxTn1GwdiQhiq2QZ11Dyu6shWaC5nbvKNbgotBaGEmajaiBSW0 +gc72amGkuTSZxoRt/Kv4yH99qDceXRaltQ6HceQpxu+z9o1RXa07q0i7ymRcV4of6hf H1TXEbkI7YxfcN4wk+VvVt/uvBnohsgKBGXfTxIEqbLg7QVI7WZB7aFFxF+SE5/vHkHi qzgCk6EctIw9+jHV9x2iX5Zz4NXmrGfEj5Dt4AzZEqMqLS83NEF+JKgCl0eQKlExPsl0 R5Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695469819; x=1696074619; 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=gkMg6Ss1ODOcr8VdxRq6yPqfjTyE6Onn/Fwc4BWB7DM=; b=iwq8lJKA3+2q5uducDpjVTKEqiBXo3tZo/i7X5TniuH9OBgyhTPQpWO1TOHJbC11Aa 7ngSPtOX/+gw23l90upE3iAFSw5mtRjbe/tpa2qo/BnupK3+bAq2hbX9WxmeyDNm8IUK HwQOVVN69+aTdodH3Gz1oyEXVRXe/JAGK18ULxQB+NojeyKj+2KQmafptFwU62VtdPhJ DDnsa3OpgKGOTuz3PNgTGP37CFJux7/vWX3wmAbyhCosn5ctTMMZoUkmVhDLg0DmU+c1 P0YBz5e+W5mmJ8qsFqwT5k2z8y36nXuT0uwfPqRc+Sbvlyw3tMCpP+FH9glVFBBk1T6t MkEg== X-Gm-Message-State: AOJu0Yyv/obiMY6m9mZ4cYuMqH6FnlRUPk8mHZODwqpWex9yVfz1M+0z E/u7dQueU1Mei9Mtf6GaFnHtKQ== X-Google-Smtp-Source: AGHT+IFA63qVcvn23d2cB7ArqMpEOgP3SaNn+1EhFxPur0BUfXBa/lAhkkc40O5YTXiHAPiXx/8TGQ== X-Received: by 2002:a17:906:310d:b0:9a2:24f9:fabe with SMTP id 13-20020a170906310d00b009a224f9fabemr2003596ejx.66.1695469818880; Sat, 23 Sep 2023 04:50:18 -0700 (PDT) Received: from hackbox.lan ([86.120.16.169]) by smtp.gmail.com with ESMTPSA id k15-20020a1709062a4f00b009ad8084e08asm3853310eje.0.2023.09.23.04.50.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 04:50:18 -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: [RESEND v3 2/5] PM: domains: Add the domain HW-managed mode to the summary Date: Sat, 23 Sep 2023 14:50:05 +0300 Message-Id: <20230923115008.1698384-3-abel.vesa@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230923115008.1698384-1-abel.vesa@linaro.org> References: <20230923115008.1698384-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 Reviewed-by: Ulf Hansson --- 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)