Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-17 Thread Jisheng Zhang
On Wed, 16 Dec 2015 10:38:03 + Russell King - ARM Linux wrote: > On Wed, Dec 16, 2015 at 11:32:17AM +0100, Daniel Lezcano wrote: > > On 12/16/2015 10:33 AM, Russell King - ARM Linux wrote: > > >On Wed, Dec 16, 2015 at 10:21:55AM +0100, Daniel Lezcano wrote: > > >>On 12/16/2015 08:36 AM,

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-17 Thread Jisheng Zhang
On Wed, 16 Dec 2015 10:38:03 + Russell King - ARM Linux wrote: > On Wed, Dec 16, 2015 at 11:32:17AM +0100, Daniel Lezcano wrote: > > On 12/16/2015 10:33 AM, Russell King - ARM Linux wrote: > > >On Wed, Dec 16, 2015 at 10:21:55AM +0100, Daniel Lezcano wrote: > > >>On 12/16/2015 08:36 AM,

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-16 Thread Daniel Lezcano
On 12/16/2015 11:38 AM, Russell King - ARM Linux wrote: On Wed, Dec 16, 2015 at 11:32:17AM +0100, Daniel Lezcano wrote: On 12/16/2015 10:33 AM, Russell King - ARM Linux wrote: On Wed, Dec 16, 2015 at 10:21:55AM +0100, Daniel Lezcano wrote: On 12/16/2015 08:36 AM, Jisheng Zhang wrote: And in

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-16 Thread Russell King - ARM Linux
On Wed, Dec 16, 2015 at 11:32:17AM +0100, Daniel Lezcano wrote: > On 12/16/2015 10:33 AM, Russell King - ARM Linux wrote: > >On Wed, Dec 16, 2015 at 10:21:55AM +0100, Daniel Lezcano wrote: > >>On 12/16/2015 08:36 AM, Jisheng Zhang wrote: > >>>And in fact, clocksource_mmio_readw_down() also has

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-16 Thread Daniel Lezcano
On 12/16/2015 10:33 AM, Russell King - ARM Linux wrote: On Wed, Dec 16, 2015 at 10:21:55AM +0100, Daniel Lezcano wrote: On 12/16/2015 08:36 AM, Jisheng Zhang wrote: And in fact, clocksource_mmio_readw_down() also has similar issue, but it masks with c->mask before return, the c->mask is less

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-16 Thread Russell King - ARM Linux
On Wed, Dec 16, 2015 at 10:21:55AM +0100, Daniel Lezcano wrote: > On 12/16/2015 08:36 AM, Jisheng Zhang wrote: > >And in fact, clocksource_mmio_readw_down() also has similar issue, but it > >masks > >with c->mask before return, the c->mask is less than 32 bit (because the > >clocksource_mmio_init

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-16 Thread Daniel Lezcano
On 12/16/2015 08:36 AM, Jisheng Zhang wrote: On Wed, 16 Dec 2015 15:28:07 +0800 wrote: On Wed, 16 Dec 2015 15:11:25 +0800 Jisheng Zhang wrote: Dear Daniel, On Tue, 15 Dec 2015 21:59:30 +0100 Daniel Lezcano wrote: On 11/25/2015 04:42 PM, Jisheng Zhang wrote: Let's assume the counter

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-16 Thread Daniel Lezcano
On 12/16/2015 08:11 AM, Jisheng Zhang wrote: Dear Daniel, On Tue, 15 Dec 2015 21:59:30 +0100 Daniel Lezcano wrote: On 11/25/2015 04:42 PM, Jisheng Zhang wrote: Let's assume the counter value is 0xf00, the pistachio clocksource read cycles function would return 0x0fff, but it

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-16 Thread Daniel Lezcano
On 12/16/2015 08:28 AM, Jisheng Zhang wrote: On Wed, 16 Dec 2015 15:11:25 +0800 Jisheng Zhang wrote: Dear Daniel, On Tue, 15 Dec 2015 21:59:30 +0100 Daniel Lezcano wrote: On 11/25/2015 04:42 PM, Jisheng Zhang wrote: Let's assume the counter value is 0xf00, the pistachio clocksource

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-16 Thread Daniel Lezcano
On 12/16/2015 11:38 AM, Russell King - ARM Linux wrote: On Wed, Dec 16, 2015 at 11:32:17AM +0100, Daniel Lezcano wrote: On 12/16/2015 10:33 AM, Russell King - ARM Linux wrote: On Wed, Dec 16, 2015 at 10:21:55AM +0100, Daniel Lezcano wrote: On 12/16/2015 08:36 AM, Jisheng Zhang wrote: And in

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-16 Thread Daniel Lezcano
On 12/16/2015 08:36 AM, Jisheng Zhang wrote: On Wed, 16 Dec 2015 15:28:07 +0800 wrote: On Wed, 16 Dec 2015 15:11:25 +0800 Jisheng Zhang wrote: Dear Daniel, On Tue, 15 Dec 2015 21:59:30 +0100 Daniel Lezcano wrote: On 11/25/2015 04:42 PM, Jisheng Zhang wrote: Let's assume the counter

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-16 Thread Russell King - ARM Linux
On Wed, Dec 16, 2015 at 10:21:55AM +0100, Daniel Lezcano wrote: > On 12/16/2015 08:36 AM, Jisheng Zhang wrote: > >And in fact, clocksource_mmio_readw_down() also has similar issue, but it > >masks > >with c->mask before return, the c->mask is less than 32 bit (because the > >clocksource_mmio_init

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-16 Thread Daniel Lezcano
On 12/16/2015 08:28 AM, Jisheng Zhang wrote: On Wed, 16 Dec 2015 15:11:25 +0800 Jisheng Zhang wrote: Dear Daniel, On Tue, 15 Dec 2015 21:59:30 +0100 Daniel Lezcano wrote: On 11/25/2015 04:42 PM, Jisheng Zhang wrote: Let's assume the counter value is 0xf00, the pistachio clocksource

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-16 Thread Daniel Lezcano
On 12/16/2015 08:11 AM, Jisheng Zhang wrote: Dear Daniel, On Tue, 15 Dec 2015 21:59:30 +0100 Daniel Lezcano wrote: On 11/25/2015 04:42 PM, Jisheng Zhang wrote: Let's assume the counter value is 0xf00, the pistachio clocksource read cycles function would return 0x0fff, but it

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-16 Thread Daniel Lezcano
On 12/16/2015 10:33 AM, Russell King - ARM Linux wrote: On Wed, Dec 16, 2015 at 10:21:55AM +0100, Daniel Lezcano wrote: On 12/16/2015 08:36 AM, Jisheng Zhang wrote: And in fact, clocksource_mmio_readw_down() also has similar issue, but it masks with c->mask before return, the c->mask is less

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-16 Thread Russell King - ARM Linux
On Wed, Dec 16, 2015 at 11:32:17AM +0100, Daniel Lezcano wrote: > On 12/16/2015 10:33 AM, Russell King - ARM Linux wrote: > >On Wed, Dec 16, 2015 at 10:21:55AM +0100, Daniel Lezcano wrote: > >>On 12/16/2015 08:36 AM, Jisheng Zhang wrote: > >>>And in fact, clocksource_mmio_readw_down() also has

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-15 Thread Jisheng Zhang
On Wed, 16 Dec 2015 15:36:09 +0800 Jisheng Zhang wrote: > On Wed, 16 Dec 2015 15:28:07 +0800 wrote: > > > On Wed, 16 Dec 2015 15:11:25 +0800 > > Jisheng Zhang wrote: > > > > > Dear Daniel, > > > > > > On Tue, 15 Dec 2015 21:59:30 +0100 Daniel Lezcano wrote: > > > > > > > On 11/25/2015

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-15 Thread Jisheng Zhang
On Wed, 16 Dec 2015 15:28:07 +0800 wrote: > On Wed, 16 Dec 2015 15:11:25 +0800 > Jisheng Zhang wrote: > > > Dear Daniel, > > > > On Tue, 15 Dec 2015 21:59:30 +0100 Daniel Lezcano wrote: > > > > > On 11/25/2015 04:42 PM, Jisheng Zhang wrote: > > > > Let's assume the counter value is

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-15 Thread Jisheng Zhang
On Wed, 16 Dec 2015 15:11:25 +0800 Jisheng Zhang wrote: > Dear Daniel, > > On Tue, 15 Dec 2015 21:59:30 +0100 Daniel Lezcano wrote: > > > On 11/25/2015 04:42 PM, Jisheng Zhang wrote: > > > Let's assume the counter value is 0xf00, the pistachio clocksource oops, sorry, should be

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-15 Thread Jisheng Zhang
Dear Daniel, On Tue, 15 Dec 2015 21:59:30 +0100 Daniel Lezcano wrote: > On 11/25/2015 04:42 PM, Jisheng Zhang wrote: > > Let's assume the counter value is 0xf00, the pistachio clocksource > > read cycles function would return 0x0fff, but it should > > return 0xfff. > > > > We

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-15 Thread Daniel Lezcano
On 11/25/2015 04:42 PM, Jisheng Zhang wrote: Let's assume the counter value is 0xf00, the pistachio clocksource read cycles function would return 0x0fff, but it should return 0xfff. We fix this issue by calculating bitwise-not counter, then cast to cycle_t. Signed-off-by:

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-15 Thread Daniel Lezcano
On 11/25/2015 04:42 PM, Jisheng Zhang wrote: Let's assume the counter value is 0xf00, the pistachio clocksource read cycles function would return 0x0fff, but it should return 0xfff. We fix this issue by calculating bitwise-not counter, then cast to cycle_t. Signed-off-by:

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-15 Thread Jisheng Zhang
Dear Daniel, On Tue, 15 Dec 2015 21:59:30 +0100 Daniel Lezcano wrote: > On 11/25/2015 04:42 PM, Jisheng Zhang wrote: > > Let's assume the counter value is 0xf00, the pistachio clocksource > > read cycles function would return 0x0fff, but it should > > return 0xfff. > > > > We

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-15 Thread Jisheng Zhang
On Wed, 16 Dec 2015 15:11:25 +0800 Jisheng Zhang wrote: > Dear Daniel, > > On Tue, 15 Dec 2015 21:59:30 +0100 Daniel Lezcano wrote: > > > On 11/25/2015 04:42 PM, Jisheng Zhang wrote: > > > Let's assume the counter value is 0xf00, the pistachio clocksource oops, sorry, should be

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-15 Thread Jisheng Zhang
On Wed, 16 Dec 2015 15:28:07 +0800 wrote: > On Wed, 16 Dec 2015 15:11:25 +0800 > Jisheng Zhang wrote: > > > Dear Daniel, > > > > On Tue, 15 Dec 2015 21:59:30 +0100 Daniel Lezcano wrote: > > > > > On 11/25/2015 04:42 PM, Jisheng Zhang wrote: > > > > Let's assume the counter value is

Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-12-15 Thread Jisheng Zhang
On Wed, 16 Dec 2015 15:36:09 +0800 Jisheng Zhang wrote: > On Wed, 16 Dec 2015 15:28:07 +0800 wrote: > > > On Wed, 16 Dec 2015 15:11:25 +0800 > > Jisheng Zhang wrote: > > > > > Dear Daniel, > > > > > > On Tue, 15 Dec 2015 21:59:30 +0100 Daniel Lezcano wrote: > > > > > > > On 11/25/2015

[PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-11-25 Thread Jisheng Zhang
Let's assume the counter value is 0xf00, the pistachio clocksource read cycles function would return 0x0fff, but it should return 0xfff. We fix this issue by calculating bitwise-not counter, then cast to cycle_t. Signed-off-by: Jisheng Zhang ---

[PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value

2015-11-25 Thread Jisheng Zhang
Let's assume the counter value is 0xf00, the pistachio clocksource read cycles function would return 0x0fff, but it should return 0xfff. We fix this issue by calculating bitwise-not counter, then cast to cycle_t. Signed-off-by: Jisheng Zhang ---