qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/pxa2xx.c: Fix handling of RW bits in PMCR
@ 2011-11-13 14:18 Peter Maydell
  2011-11-14  2:57 ` andrzej zaborowski
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2011-11-13 14:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, patches

Fix an error in commit afd4a6522 which meant that writing a zero
to the RW bits in the PMCR wouldn't actually clear them. (Error
spotted by Andrzej Zaborowski.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
This fixes the bug Andrzej pointed out in comments on the earlier
patch; sorry about this error. I opted to use a separate & rather
than merging the bit-clearing in with the W1C handling for clarity.

 hw/pxa2xx.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c
index d38b922..e9a507e 100644
--- a/hw/pxa2xx.c
+++ b/hw/pxa2xx.c
@@ -117,6 +117,7 @@ static void pxa2xx_pm_write(void *opaque, target_phys_addr_t addr,
         /* Clear the write-one-to-clear bits... */
         s->pm_regs[addr >> 2] &= ~(value & 0x2a);
         /* ...and set the plain r/w bits */
+        s->pm_regs[addr >> 2] &= ~0x15;
         s->pm_regs[addr >> 2] |= value & 0x15;
         break;
 
-- 
1.7.4.1

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

end of thread, other threads:[~2011-11-14  2:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-13 14:18 [Qemu-devel] [PATCH] hw/pxa2xx.c: Fix handling of RW bits in PMCR Peter Maydell
2011-11-14  2:57 ` andrzej zaborowski

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).