diff options
author | Nicolas Frattaroli <nicolas.frattaroli@collabora.com> | 2025-05-30 16:38:08 +0300 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2025-09-09 17:37:39 +0300 |
commit | f89c7fb83ae95578e355bed1a7aeea5f3ca5a067 (patch) | |
tree | 548c2cb34514bb2935c139559a6bb50169e72fa3 /fs/btrfs/dev-replace.c | |
parent | 6d0982ae7880f2c4d5fbd1b5f7574ea93d1311ac (diff) | |
download | linux-f89c7fb83ae95578e355bed1a7aeea5f3ca5a067.tar.xz |
PM / devfreq: rockchip-dfi: double count on RK3588
On RK3588 with LPDDR4X memory, the cycle count as returned by
perf stat -a -e rockchip_ddr/cycles/ sleep 1
consistently reads half as much as what the actual DDR frequency is at.
For a LPDDR4X module running at 2112MHz, I get more like 1056059916
cycles per second, which is almost bang-on half what it should be. No,
I'm not mixing up megatransfers and megahertz.
Consulting the downstream driver, this appears to be because the RK3588
hardware specifically (and RK3528 as well, for future reference) needs a
multiplier of 2 to get to the correct frequency with everything but
LPDDR5.
The RK3588's actual memory bandwidth measurements in MB/s are correct
however, as confirmed with stress-ng --stream. This makes me think the
access counters are not affected in the same way. This tracks with the
vendor kernel not multiplying the access counts either.
Solve this by adding a new member to the dfi struct, which each SoC can
set to whatever they want, but defaults to 1 if left unset by the SoC
init functions. The event_get_count op can then use this multiplier if
the cycle count is requested.
The cycle multiplier is not used in rockchip_dfi_get_event because the
vendor driver doesn't use it there either, and we don't do other actual
bandwidth unit conversion stuff in there anyway.
Fixes: 481d97ba61e1 ("PM / devfreq: rockchip-dfi: add support for RK3588")
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Link: https://lore.kernel.org/lkml/20250530-rk3588-dfi-improvements-v1-1-6e077c243a95@collabora.com/
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions