All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: daniel.forsgren@enea.com, qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] hw/pl031: Actually raise interrupt on timer expiry
Date: Wed, 15 Feb 2012 12:23:22 +0100	[thread overview]
Message-ID: <4F3B95AA.8090007@suse.de> (raw)
In-Reply-To: <1329241239-9327-1-git-send-email-peter.maydell@linaro.org>

Am 14.02.2012 18:40, schrieb Peter Maydell:
> Fix a typo in pl031_interrupt() which meant we were setting a bit
> in the interrupt mask rather than the interrupt status register
> and thus not actually raising an interrupt. This fix allows the
> rtctest program from the kernel's Documentation/rtc.txt to pass
> rather than hanging.
> 

Reported-by: Daniel Forsgren <daniel.forsgren@enea.com>

> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Looks like our PL031 has always had this bug since it was added
> in 2007... Daniel Forsgren reported this, suggested the fix and
> pointed me at the test program. Thanks!

Down here the credit for the find gets lost.

>  https://bugs.launchpad.net/qemu-linaro/+bug/931940
> 
>  hw/pl031.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/pl031.c b/hw/pl031.c
> index 8416a60..f06b5ae 100644
> --- a/hw/pl031.c
> +++ b/hw/pl031.c
> @@ -76,7 +76,7 @@ static void pl031_interrupt(void * opaque)
>  {
>      pl031_state *s = (pl031_state *)opaque;
>  
> -    s->im = 1;
> +    s->is = 1;
>      DPRINTF("Alarm raised\n");
>      pl031_update(s);
>  }

So on RTC_ICR write s->is = 0; but it was never set elsewhere, so
RTC_RIS would always return 0.

Acked-by: Andreas Färber <afaerber@suse.de>

However, to facilitate future review of these non-telling fields I
propose the following documentation patch as a follow-up:

diff --git a/hw/pl031.c b/hw/pl031.c
index 8416a60..a20c625 100644
--- a/hw/pl031.c
+++ b/hw/pl031.c
@@ -32,6 +32,11 @@ do { printf("pl031: " fmt , ## __VA_ARGS__); } while (0)
 #define RTC_MIS     0x18    /* Masked interrupt status register */
 #define RTC_ICR     0x1c    /* Interrupt clear register */

+/**
+ * pl031_state:
+ * @im: Interrupt mask.
+ * @is: Interrupt state.
+ */
 typedef struct {
     SysBusDevice busdev;
     MemoryRegion iomem;

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2012-02-15 11:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14 17:40 [Qemu-devel] [PATCH] hw/pl031: Actually raise interrupt on timer expiry Peter Maydell
2012-02-15 11:23 ` Andreas Färber [this message]
2012-02-15 11:34   ` Peter Maydell

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=4F3B95AA.8090007@suse.de \
    --to=afaerber@suse.de \
    --cc=daniel.forsgren@enea.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.