summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/event_analyzing_sample.py
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2025-06-18 14:14:18 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2025-07-30 11:30:05 +0200
commit62df72a0ab22b3377aeba3b2159ab35274a4106f (patch)
treed37f647c62e7e9feb86ae230ffa98cf42ed18d91 /tools/perf/scripts/python/event_analyzing_sample.py
parentf552a7c7e0a14215cb8a6fd89e60fa3932a74786 (diff)
spi: spi-mem: Use picoseconds for calculating the op durations
spi_mem_calc_op_duration() is deriving the duration of a specific op, by multiplying the number of cycles with the time a cycle will last. This time was measured in nanoseconds, which means at high frequencies the delta between two frequencies might not be properly catch due to roundings. For instance, the Winbond driver has a changing number of dummy cycles depending on the speed, adding +8 dummy cycles when running at 166MHz compared to 162MHz. Both frequencies would lead to using a 6ns delay per cycle for the op duration computation, whereas in practice there is a small difference which actually offsets the number of extra dummy cycles on a normal page read. Augmenting the precision of the calculation by using picoseconds prevents selecting a lower frequency if we can do slightly better with another frequency involving more cycles. As a result, the above situation leads to comparing cycles of 6024 and 6172 picoseconds which leads to picking the most efficient variant. Reviewed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions