qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alistair Francis <alistair23@gmail.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "open list:RISC-V" <qemu-riscv@nongnu.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Bin Meng <bmeng.cn@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [PATCH v1 1/1] hw/intc/ibex_plic: Clear the claim register when read
Date: Mon, 9 Nov 2020 15:11:31 -0800	[thread overview]
Message-ID: <CAKmqyKPLg+-gmGBj0iKryOYz8VfCWFZqPccS+qLZa2qAoAwggQ@mail.gmail.com> (raw)
In-Reply-To: <1ef9a373-9c67-d12f-014a-9a88520b9635@amsat.org>

On Fri, Nov 6, 2020 at 6:20 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> On 11/6/20 3:32 AM, Alistair Francis wrote:
> > After claiming the interrupt by reading the claim register we want to
> > clear the register to make sure the interrupt doesn't appear at the next
> > read.
> >
> > This matches the documentation for the claim register as it clears the
> > pending bit (which we already do): https://docs.opentitan.org/hw/ip/rv_plic/doc/index.html
>
> "When an interrupt is claimed by a target the relevant bit of IP is
> cleared." Correct.

Yep, I improved this.

>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Thanks

Alistair

>
> >
> > This also matches the current hardware.
> >
> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > ---
> >  hw/intc/ibex_plic.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/hw/intc/ibex_plic.c b/hw/intc/ibex_plic.c
> > index f49fa67c91..235e6b88ff 100644
> > --- a/hw/intc/ibex_plic.c
> > +++ b/hw/intc/ibex_plic.c
> > @@ -139,6 +139,9 @@ static uint64_t ibex_plic_read(void *opaque, hwaddr addr,
> >          /* Return the current claimed interrupt */
> >          ret = s->claim;
> >
> > +        /* Clear the claimed interrupt */
> > +        s->claim = 0x00000000;
> > +
> >          /* Update the interrupt status after the claim */
> >          ibex_plic_update(s);
> >      }
> >
>


      reply	other threads:[~2020-11-09 23:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06  2:32 [PATCH v1 1/1] hw/intc/ibex_plic: Clear the claim register when read Alistair Francis
2020-11-06 14:20 ` Philippe Mathieu-Daudé
2020-11-09 23:11   ` Alistair Francis [this message]

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=CAKmqyKPLg+-gmGBj0iKryOYz8VfCWFZqPccS+qLZa2qAoAwggQ@mail.gmail.com \
    --to=alistair23@gmail.com \
    --cc=alistair.francis@wdc.com \
    --cc=bmeng.cn@gmail.com \
    --cc=f4bug@amsat.org \
    --cc=palmer@dabbelt.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@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).