diff options
author | Jisheng Zhang <jszhang@marvell.com> | 2015-11-25 15:42:49 (GMT) |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2015-12-16 08:45:10 (GMT) |
commit | 272a25a247ce6d31315856721014635469500e96 (patch) | |
tree | 8048afdbd8078cd6b5075584656ae66040d638e5 /drivers/idle | |
parent | 08e4b44852626f3549c8bd45308431d9c9e0ee6d (diff) | |
download | linux-272a25a247ce6d31315856721014635469500e96.tar.xz |
clocksource/drivers/pistachio: Fix wrong calculated clocksource read value
Let's assume the counter value is 0xf0000000, the pistachio clocksource
read cycles function should return ~0x0fffffff but actually it returns
0xffffffff0fffffff.
That occurs because:
~(cycle_t)value is different from (cycle_t)~value.
unsigned long val = ~(unsigned long)0xf0000000;
40049a: 48 b8 ff ff ff 0f ff movabs $0xffffffff0fffffff,%rax
unsigned long val = (unsigned long)~0xf0000000;
40049a: 48 c7 45 f8 ff ff ff movq $0xfffffff,-0x8(%rbp)
We fix this issue by calculating bitwise-not counter, then cast to
cycle_t.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/idle')
0 files changed, 0 insertions, 0 deletions