From patchwork Sun Nov 13 14:18:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 5089 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id CF73A23E01 for ; Sun, 13 Nov 2011 14:18:51 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id BB359A1834A for ; Sun, 13 Nov 2011 14:18:51 +0000 (UTC) Received: by faan26 with SMTP id n26so6956472faa.11 for ; Sun, 13 Nov 2011 06:18:51 -0800 (PST) Received: by 10.152.105.226 with SMTP id gp2mr11428856lab.28.1321193931427; Sun, 13 Nov 2011 06:18:51 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.40.7 with SMTP id t7cs12002lak; Sun, 13 Nov 2011 06:18:49 -0800 (PST) Received: by 10.216.186.211 with SMTP id w61mr3372692wem.75.1321193927651; Sun, 13 Nov 2011 06:18:47 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id w2si5270055weq.100.2011.11.13.06.18.46 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 13 Nov 2011 06:18:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1RPatL-0004T1-5N; Sun, 13 Nov 2011 14:18:39 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Andrzej Zaborowski , Anthony Liguori Subject: [PATCH] hw/pxa2xx.c: Fix handling of RW bits in PMCR Date: Sun, 13 Nov 2011 14:18:39 +0000 Message-Id: <1321193919-17148-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 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 --- 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;