mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Maulik Shah <maulik.shah@oss.qualcomm.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Doug Anderson <dianders@chromium.org>
Subject: Re: [PATCH v2 1/3] soc: qcom: qcom_stats: Add support to read DDR statistic
Date: Wed, 21 May 2025 19:01:06 +0200	[thread overview]
Message-ID: <c4442c3b-4f05-4031-8b1c-243e3028fc78@oss.qualcomm.com> (raw)
In-Reply-To: <20250521-ddr_stats_-v2-1-2c54ea4fc071@oss.qualcomm.com>

On 5/21/25 10:32 AM, Maulik Shah wrote:
> DDR statistic provide different DDR LPM and DDR frequency statistic.
> Add support to read from MSGRAM and display via debugfs.
> 
> Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
> ---

[...]

> +	case 0:
> +		seq_printf(s, "DDR LPM Stat Name:0x%x\tcount:%u\tDuration (ticks):%llu\n",
> +			   DDR_STATS_LPM_NAME(data->name), data->count, data->duration);
> +		break;
> +	case 1:
> +		if (!data->count || !DDR_STATS_FREQ(data->name))
> +			return;
> +
> +		cp_idx = DDR_STATS_CP_IDX(data->name);
> +		seq_printf(s, "DDR Freq %uMhz:\tCP IDX:%u\tcount:%u\tDuration (ticks):%llu\n",
> +			   DDR_STATS_FREQ(data->name), cp_idx, data->count, data->duration);

clang complains about both prints:

drivers/soc/qcom/qcom_stats.c:173:7: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Wformat]
  172 |                 seq_printf(s, "DDR LPM Stat Name:0x%x\tcount:%u\tDuration (ticks):%llu\n",
      |                                                    ~~
      |                                                    %lx
  173 |                            DDR_STATS_LPM_NAME(data->name), data->count, data->duration);
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

drivers/soc/qcom/qcom_stats.c:181:7: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Wformat]
  180 |                 seq_printf(s, "DDR Freq %uMhz:\tCP IDX:%u\tcount:%u\tDuration (ticks):%llu\n",
      |                                         ~~
      |                                         %lu
  181 |                            DDR_STATS_FREQ(data->name), cp_idx, data->count, data->duration);
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~




> +
> +	key = readl_relaxed(reg + config->ddr_stats_offset + DDR_STATS_MAGIC_KEY_ADDR);
> +	if (key == DDR_STATS_MAGIC_KEY)
> +		debugfs_create_file("ddr_stats", 0400, root,
> +				    (__force void *)reg + config->ddr_stats_offset,
> +				    &qcom_ddr_stats_fops);

else
	pr_err("Found invalid DDR stats magic\n");

(because through the compatible, we much expect it to be present)

Konrad

  reply	other threads:[~2025-05-21 17:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-21  8:32 [PATCH v2 0/3] soc: qcom: qcom_stats: Add DDR stats Maulik Shah
2025-05-21  8:32 ` [PATCH v2 1/3] soc: qcom: qcom_stats: Add support to read DDR statistic Maulik Shah
2025-05-21 17:01   ` Konrad Dybcio [this message]
2025-05-22  5:48     ` Maulik Shah (mkshah)
2025-05-22 14:24       ` Konrad Dybcio
2025-05-21 23:40   ` kernel test robot
2025-05-21  8:32 ` [PATCH v2 2/3] soc: qcom: qcom_stats: Add QMP support for syncing ddr stats Maulik Shah
2025-05-21 12:52   ` Dmitry Baryshkov
2025-05-21 21:53     ` Konrad Dybcio
2025-05-22  5:48     ` Maulik Shah (mkshah)
2025-05-21  8:32 ` [PATCH v2 3/3] arm64: dts: qcom: Add QMP handle for qcom_stats Maulik Shah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c4442c3b-4f05-4031-8b1c-243e3028fc78@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=maulik.shah@oss.qualcomm.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®