Skip to content

Commit 78cac39

Browse files
John Garrywilldeacon
authored andcommitted
drivers/perf: thunderx2_pmu: Change data in size tx2_uncore_event_update()
A LSL of 32 requires > 32b value to hold the result. However in tx2_uncore_event_update(), 1UL << 32 currently only works as unsigned long is 64b on a 64b system. If we want to compile test for a 32b system, we need unsigned long long, whose min size is 64b. Signed-off-by: John Garry <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 16cc4af commit 78cac39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/perf/thunderx2_pmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ static void tx2_uncore_event_update(struct perf_event *event)
487487
new = reg_readl(hwc->event_base);
488488
prev = local64_xchg(&hwc->prev_count, new);
489489
/* handles rollover of 32 bit counter */
490-
delta = (u32)(((1UL << 32) - prev) + new);
490+
delta = (u32)(((1ULL << 32) - prev) + new);
491491
}
492492

493493
/* DMC event data_transfers granularity is 16 Bytes, convert it to 64 */

0 commit comments

Comments
 (0)