* [Qemu-devel] [PATCH] Fix interval interrupt of cadence ttc when timer is in decrement mode
@ 2015-06-30 11:58 Johannes Schlatow
2015-06-30 17:38 ` Peter Crosthwaite
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schlatow @ 2015-06-30 11:58 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Crosthwaite
The interval interrupt is not set if the timer is in decrement mode.
This is because x >=0 and x < interval after leaving the while-loop.
Signed-off-by: Johannes Schlatow <schlatow@ida.ing.tu-bs.de>
---
hw/timer/cadence_ttc.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/hw/timer/cadence_ttc.c b/hw/timer/cadence_ttc.c
index d46db3c..35bc880 100644
--- a/hw/timer/cadence_ttc.c
+++ b/hw/timer/cadence_ttc.c
@@ -208,15 +208,14 @@ static void cadence_timer_sync(CadenceTimerState *s)
s->reg_intr |= (2 << i);
}
}
+ if ((x < 0) || (x >= interval)) {
+ s->reg_intr |= (s->reg_count & COUNTER_CTRL_INT) ?
+ COUNTER_INTR_IV : COUNTER_INTR_OV;
+ }
while (x < 0) {
x += interval;
}
s->reg_value = (uint32_t)(x % interval);
-
- if (s->reg_value != x) {
- s->reg_intr |= (s->reg_count & COUNTER_CTRL_INT) ?
- COUNTER_INTR_IV : COUNTER_INTR_OV;
- }
cadence_timer_update(s);
}
--
2.4.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix interval interrupt of cadence ttc when timer is in decrement mode
2015-06-30 11:58 [Qemu-devel] [PATCH] Fix interval interrupt of cadence ttc when timer is in decrement mode Johannes Schlatow
@ 2015-06-30 17:38 ` Peter Crosthwaite
2015-06-30 17:42 ` Peter Maydell
0 siblings, 1 reply; 3+ messages in thread
From: Peter Crosthwaite @ 2015-06-30 17:38 UTC (permalink / raw)
To: Johannes Schlatow, Peter Maydell; +Cc: qemu-devel@nongnu.org Developers
On Tue, Jun 30, 2015 at 4:58 AM, Johannes Schlatow
<schlatow@ida.ing.tu-bs.de> wrote:
> The interval interrupt is not set if the timer is in decrement mode.
> This is because x >=0 and x < interval after leaving the while-loop.
>
> Signed-off-by: Johannes Schlatow <schlatow@ida.ing.tu-bs.de>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Can this go via target-arm for 2.4 (as a bugfix)?
Regards,
Peter
> ---
> hw/timer/cadence_ttc.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/hw/timer/cadence_ttc.c b/hw/timer/cadence_ttc.c
> index d46db3c..35bc880 100644
> --- a/hw/timer/cadence_ttc.c
> +++ b/hw/timer/cadence_ttc.c
> @@ -208,15 +208,14 @@ static void cadence_timer_sync(CadenceTimerState *s)
> s->reg_intr |= (2 << i);
> }
> }
> + if ((x < 0) || (x >= interval)) {
> + s->reg_intr |= (s->reg_count & COUNTER_CTRL_INT) ?
> + COUNTER_INTR_IV : COUNTER_INTR_OV;
> + }
> while (x < 0) {
> x += interval;
> }
> s->reg_value = (uint32_t)(x % interval);
> -
> - if (s->reg_value != x) {
> - s->reg_intr |= (s->reg_count & COUNTER_CTRL_INT) ?
> - COUNTER_INTR_IV : COUNTER_INTR_OV;
> - }
> cadence_timer_update(s);
> }
>
> --
> 2.4.5
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix interval interrupt of cadence ttc when timer is in decrement mode
2015-06-30 17:38 ` Peter Crosthwaite
@ 2015-06-30 17:42 ` Peter Maydell
0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2015-06-30 17:42 UTC (permalink / raw)
To: Peter Crosthwaite; +Cc: qemu-devel@nongnu.org Developers, Johannes Schlatow
On 30 June 2015 at 18:38, Peter Crosthwaite
<peter.crosthwaite@xilinx.com> wrote:
> On Tue, Jun 30, 2015 at 4:58 AM, Johannes Schlatow
> <schlatow@ida.ing.tu-bs.de> wrote:
>> The interval interrupt is not set if the timer is in decrement mode.
>> This is because x >=0 and x < interval after leaving the while-loop.
>>
>> Signed-off-by: Johannes Schlatow <schlatow@ida.ing.tu-bs.de>
>
> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
>
> Can this go via target-arm for 2.4 (as a bugfix)?
Sure, applied to target-arm.next.
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-06-30 17:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-30 11:58 [Qemu-devel] [PATCH] Fix interval interrupt of cadence ttc when timer is in decrement mode Johannes Schlatow
2015-06-30 17:38 ` Peter Crosthwaite
2015-06-30 17:42 ` Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).