Patchwork hw/pflash_cfi02: Fix lazy reset of ROMD mode

login
register
mail settings
Submitter jordan.l.justen@intel.com
Date March 14, 2011, 9:10 p.m.
Message ID <1300137058-16576-1-git-send-email-jordan.l.justen@intel.com>
Download mbox | patch
Permalink /patch/86820/
State New
Headers show

Comments

jordan.l.justen@intel.com - March 14, 2011, 9:10 p.m.
From: Jordan Justen <jordan.l.justen@intel.com>

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(-)
Aurelien Jarno - April 3, 2011, 7:51 p.m.
On Mon, Mar 14, 2011 at 02:10:58PM -0700, jordan.l.justen@intel.com wrote:
> From: Jordan Justen <jordan.l.justen@intel.com>
> 
> 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);

The patch looks correct, but is missing a Signed-off-by: line. Can you
please resend it?

Patch

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