diff mbox

[v2,07/18] omap_gpmc: GPMC_IRQSTATUS is write-one-to-clear

Message ID 1314550628-26869-9-git-send-email-peter.maydell@linaro.org
State Accepted
Commit 9c8255e12422771cdecbb3bf538f0732be629e2a
Headers show

Commit Message

Peter Maydell Aug. 28, 2011, 4:56 p.m. UTC
Fix a bug in the handling of writes to GPMC_IRQSTATUS:
it behaves as "write one to clear, writing zero is ignored".

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/omap_gpmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

andrzej zaborowski Sept. 17, 2011, 1:08 a.m. UTC | #1
On 28 August 2011 18:56, Peter Maydell <peter.maydell@linaro.org> wrote:
> Fix a bug in the handling of writes to GPMC_IRQSTATUS:
> it behaves as "write one to clear, writing zero is ignored".
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/omap_gpmc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/omap_gpmc.c b/hw/omap_gpmc.c
> index d16b28b..ff4d485 100644
> --- a/hw/omap_gpmc.c
> +++ b/hw/omap_gpmc.c
> @@ -284,7 +284,7 @@ static void omap_gpmc_write(void *opaque, target_phys_addr_t addr,
>         break;
>
>     case 0x018:        /* GPMC_IRQSTATUS */
> -        s->irqen = ~value;
> +        s->irqen &= ~value;

Should we be clearing s->irqst here instead of irqen?  Good catch though.

Cheers
Peter Maydell Sept. 17, 2011, 3:47 p.m. UTC | #2
On 17 September 2011 02:08, andrzej zaborowski <balrogg@gmail.com> wrote:
>> --- a/hw/omap_gpmc.c
>> +++ b/hw/omap_gpmc.c
>> @@ -284,7 +284,7 @@ static void omap_gpmc_write(void *opaque, target_phys_addr_t addr,
>>         break;
>>
>>     case 0x018:        /* GPMC_IRQSTATUS */
>> -        s->irqen = ~value;
>> +        s->irqen &= ~value;
>
> Should we be clearing s->irqst here instead of irqen?

Oops, you're right... (IIRC this change was a spotted-while-reading-code
one, not a response to a behavioural issue with the model.)

-- PMM
diff mbox

Patch

diff --git a/hw/omap_gpmc.c b/hw/omap_gpmc.c
index d16b28b..ff4d485 100644
--- a/hw/omap_gpmc.c
+++ b/hw/omap_gpmc.c
@@ -284,7 +284,7 @@  static void omap_gpmc_write(void *opaque, target_phys_addr_t addr,
         break;
 
     case 0x018:	/* GPMC_IRQSTATUS */
-        s->irqen = ~value;
+        s->irqen &= ~value;
         omap_gpmc_int_update(s);
         break;