From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: "Maulik Shah (mkshah)" <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: Thu, 22 May 2025 16:24:24 +0200 [thread overview]
Message-ID: <3684b6c5-91c1-44b9-aab5-b768db9fd08a@oss.qualcomm.com> (raw)
In-Reply-To: <d70da81f-29a6-487c-9781-c2fda6327a75@oss.qualcomm.com>
On 5/22/25 7:48 AM, Maulik Shah (mkshah) wrote:
>
>
> On 5/21/2025 10:31 PM, Konrad Dybcio wrote:
>> 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);
>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>>
>>
>
> I will update correct format specifiers in v3.
>
>>
>>> +
>>> + 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)
>
> The qcom,rpmh-stats compatible does not guarantee the DDR stats presence. DDR stats is only present if
> magic value matches. The ddr stats was incrementally added over time so older SoCs like SM8150, QCS615
> will not have the ddr stats and would end up printing this error during boot up but yes all almost all
> rpmh targets do have the DDR stats present. If we are ok to print this error for older SoCs i can add it
> or how about using pr_warn instead of pr_err?
OK, Let's not print anything then
Konrad
next prev parent reply other threads:[~2025-05-22 14:24 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
2025-05-22 5:48 ` Maulik Shah (mkshah)
2025-05-22 14:24 ` Konrad Dybcio [this message]
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=3684b6c5-91c1-44b9-aab5-b768db9fd08a@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®