lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c4442c3b-4f05-4031-8b1c-243e3028fc78@oss.qualcomm.com>
Date: Wed, 21 May 2025 19:01:06 +0200
From: Konrad Dybcio <konrad.dybcio@....qualcomm.com>
To: Maulik Shah <maulik.shah@....qualcomm.com>,
        Bjorn Andersson <andersson@...nel.org>,
        Konrad Dybcio <konradybcio@...nel.org>, Rob Herring <robh@...nel.org>,
        Krzysztof Kozlowski <krzk+dt@...nel.org>,
        Conor Dooley <conor+dt@...nel.org>
Cc: linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
        devicetree@...r.kernel.org,
        Marijn Suijten <marijn.suijten@...ainline.org>,
        Doug Anderson <dianders@...omium.org>
Subject: Re: [PATCH v2 1/3] soc: qcom: qcom_stats: Add support to read DDR
 statistic

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@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ