qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/1] pl061: fix wrong calculation of GPIOMIS register
@ 2015-06-01 10:33 Victor CLEMENT
  2015-06-01 10:47 ` Peter Crosthwaite
  2015-06-01 17:22 ` Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Victor CLEMENT @ 2015-06-01 10:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: Victor CLEMENT, julien.viarddegalbert

The masked interrupt status register should be the state of the interrupt
after masking.
There should be a logical AND instead of a logical OR between the
interrupt status and the interrupt mask.

Signed-off-by: Victor CLEMENT <victor.clement@openwide.fr>

---

See ARM PrimeCell GPIO manual below
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0190b/I36092.html
---
 hw/gpio/pl061.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/gpio/pl061.c b/hw/gpio/pl061.c
index bd03e99..4ba730b 100644
--- a/hw/gpio/pl061.c
+++ b/hw/gpio/pl061.c
@@ -173,7 +173,7 @@ static uint64_t pl061_read(void *opaque, hwaddr offset,
     case 0x414: /* Raw interrupt status */
         return s->istate;
     case 0x418: /* Masked interrupt status */
-        return s->istate | s->im;
+        return s->istate & s->im;
     case 0x420: /* Alternate function select */
         return s->afsel;
     case 0x500: /* 2mA drive */
-- 
2.3.7

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 1/1] pl061: fix wrong calculation of GPIOMIS register
  2015-06-01 10:33 [Qemu-devel] [PATCH 1/1] pl061: fix wrong calculation of GPIOMIS register Victor CLEMENT
@ 2015-06-01 10:47 ` Peter Crosthwaite
  2015-06-01 17:22 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Crosthwaite @ 2015-06-01 10:47 UTC (permalink / raw)
  To: Victor CLEMENT, Peter Maydell
  Cc: qemu-devel@nongnu.org Developers, julien.viarddegalbert

gpio: prefix on subject line (in addition to pl061:)

On Mon, Jun 1, 2015 at 3:33 AM, Victor CLEMENT
<victor.clement@openwide.fr> wrote:
> The masked interrupt status register should be the state of the interrupt
> after masking.
> There should be a logical AND instead of a logical OR between the
> interrupt status and the interrupt mask.
>
> Signed-off-by: Victor CLEMENT <victor.clement@openwide.fr>
>

So this makes sense to me, given that the code uses ->im with &
operation for the actual interrupt pin calculation. That | result in
original code makes little sense.

With just the subject line change:

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

> ---
>
> See ARM PrimeCell GPIO manual below
> http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0190b/I36092.html
> ---
>  hw/gpio/pl061.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/gpio/pl061.c b/hw/gpio/pl061.c
> index bd03e99..4ba730b 100644
> --- a/hw/gpio/pl061.c
> +++ b/hw/gpio/pl061.c
> @@ -173,7 +173,7 @@ static uint64_t pl061_read(void *opaque, hwaddr offset,
>      case 0x414: /* Raw interrupt status */
>          return s->istate;
>      case 0x418: /* Masked interrupt status */
> -        return s->istate | s->im;
> +        return s->istate & s->im;
>      case 0x420: /* Alternate function select */
>          return s->afsel;
>      case 0x500: /* 2mA drive */
> --
> 2.3.7
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 1/1] pl061: fix wrong calculation of GPIOMIS register
  2015-06-01 10:33 [Qemu-devel] [PATCH 1/1] pl061: fix wrong calculation of GPIOMIS register Victor CLEMENT
  2015-06-01 10:47 ` Peter Crosthwaite
@ 2015-06-01 17:22 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2015-06-01 17:22 UTC (permalink / raw)
  To: Victor CLEMENT; +Cc: QEMU Developers, julien.viarddegalbert

On 1 June 2015 at 11:33, Victor CLEMENT <victor.clement@openwide.fr> wrote:
> The masked interrupt status register should be the state of the interrupt
> after masking.
> There should be a logical AND instead of a logical OR between the
> interrupt status and the interrupt mask.
>
> Signed-off-by: Victor CLEMENT <victor.clement@openwide.fr>

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-01 17:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-01 10:33 [Qemu-devel] [PATCH 1/1] pl061: fix wrong calculation of GPIOMIS register Victor CLEMENT
2015-06-01 10:47 ` Peter Crosthwaite
2015-06-01 17:22 ` 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).