From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: patches@linaro.org, Guenter Roeck <linux@roeck-us.net>
Subject: [Qemu-devel] [PATCH for-3.0 2/4] hw/timer/cmsdk-apb-timer: Correct ptimer policy settings
Date: Tue, 3 Jul 2018 18:10:42 +0100 [thread overview]
Message-ID: <20180703171044.9503-3-peter.maydell@linaro.org> (raw)
In-Reply-To: <20180703171044.9503-1-peter.maydell@linaro.org>
The CMSDK timer interrupt triggers when the counter goes from 1 to 0,
so we want to trigger immediately, rather than waiting for a
clock cycle. Drop the incorrect NO_IMMEDIATE_TRIGGER setting.
We also do not want to get an interrupt if the guest sets the
counter directly to zero, so use the new TRIGGER_ONLY_ON_DECREMENT
policy.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/timer/cmsdk-apb-timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/timer/cmsdk-apb-timer.c b/hw/timer/cmsdk-apb-timer.c
index 9878746609a..1f99081db1a 100644
--- a/hw/timer/cmsdk-apb-timer.c
+++ b/hw/timer/cmsdk-apb-timer.c
@@ -201,7 +201,7 @@ static void cmsdk_apb_timer_realize(DeviceState *dev, Error **errp)
bh = qemu_bh_new(cmsdk_apb_timer_tick, s);
s->timer = ptimer_init(bh,
PTIMER_POLICY_WRAP_AFTER_ONE_PERIOD |
- PTIMER_POLICY_NO_IMMEDIATE_TRIGGER |
+ PTIMER_POLICY_TRIGGER_ONLY_ON_DECREMENT |
PTIMER_POLICY_NO_IMMEDIATE_RELOAD |
PTIMER_POLICY_NO_COUNTER_ROUND_DOWN);
--
2.17.1
next prev parent reply other threads:[~2018-07-03 17:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-03 17:10 [Qemu-devel] [PATCH for-3.0 0/4] cmsdk-apb-timer: various bugfixes Peter Maydell
2018-07-03 17:10 ` [Qemu-devel] [PATCH for-3.0 1/4] ptimer: Add TRIGGER_ONLY_ON_DECREMENT policy option Peter Maydell
2018-07-03 17:10 ` Peter Maydell [this message]
2018-07-03 17:10 ` [Qemu-devel] [PATCH for-3.0 3/4] hw/timer/cmsdk-apb-timer: Correctly identify and set one-shot mode Peter Maydell
2018-07-03 17:10 ` [Qemu-devel] [PATCH for-3.0 4/4] hw/timer/cmsdk-apb-timer: run or stop timer on writes to RELOAD and VALUE Peter Maydell
2018-07-03 18:20 ` [Qemu-devel] [PATCH for-3.0 0/4] cmsdk-apb-timer: various bugfixes Richard Henderson
2018-07-03 18:50 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180703171044.9503-3-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=linux@roeck-us.net \
--cc=patches@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).