From patchwork Mon Mar 14 21:10:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jordan.l.justen@intel.com X-Patchwork-Id: 86820 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D1872B6FF2 for ; Tue, 15 Mar 2011 08:11:51 +1100 (EST) Received: from localhost ([127.0.0.1]:51948 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzF3M-0006NF-AV for incoming@patchwork.ozlabs.org; Mon, 14 Mar 2011 17:11:48 -0400 Received: from [140.186.70.92] (port=35716 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzF2u-0006My-C0 for qemu-devel@nongnu.org; Mon, 14 Mar 2011 17:11:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzF2s-0007KZ-U9 for qemu-devel@nongnu.org; Mon, 14 Mar 2011 17:11:20 -0400 Received: from mga02.intel.com ([134.134.136.20]:33274) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzF2s-0007Jy-Lp for qemu-devel@nongnu.org; Mon, 14 Mar 2011 17:11:18 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 14 Mar 2011 14:11:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.62,318,1297065600"; d="scan'208";a="612880893" Received: from localhost.localdomain (HELO jljusten-laptop.jf.intel.com) ([10.7.202.166]) by orsmga002.jf.intel.com with ESMTP; 14 Mar 2011 14:11:01 -0700 From: jordan.l.justen@intel.com To: qemu-devel@nongnu.org Date: Mon, 14 Mar 2011 14:10:58 -0700 Message-Id: <1300137058-16576-1-git-send-email-jordan.l.justen@intel.com> X-Mailer: git-send-email 1.7.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.20 Cc: Jordan Justen , jljusten@gmail.com Subject: [Qemu-devel] [PATCH] hw/pflash_cfi02: Fix lazy reset of ROMD mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jordan Justen When checking pfl->rom_mode for when to lazily reenter ROMD mode, the value was check was the opposite of what it should have been. This prevent the part from returning to ROMD mode after a write was made to the CFI rom region. --- hw/pflash_cfi02.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/pflash_cfi02.c b/hw/pflash_cfi02.c index 3594a36..a936cdb 100644 --- a/hw/pflash_cfi02.c +++ b/hw/pflash_cfi02.c @@ -112,7 +112,7 @@ static uint32_t pflash_read (pflash_t *pfl, target_phys_addr_t offset, DPRINTF("%s: offset " TARGET_FMT_plx "\n", __func__, offset); ret = -1; - if (pfl->rom_mode) { + if (!pfl->rom_mode) { /* Lazy reset of to ROMD mode */ if (pfl->wcycle == 0) pflash_register_memory(pfl, 1);