Patchwork cfi02: Fix lazy ROMD switching - once again

login
register
mail settings
Submitter Jan Kiszka
Date Feb. 4, 2012, 2:58 p.m.
Message ID <4F2D477A.2010801@web.de>
Download mbox | patch
Permalink /patch/139581/
State New
Headers show

Comments

Jan Kiszka - Feb. 4, 2012, 2:58 p.m.
The conversion to memory regions broke lazy ROMD switching by forgetting
to update the rom_mode state variable.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
---
 hw/pflash_cfi02.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Blue Swirl - Feb. 11, 2012, 11:08 a.m.
Thanks, applied.

On Sat, Feb 4, 2012 at 14:58, Jan Kiszka <jan.kiszka@web.de> wrote:
> The conversion to memory regions broke lazy ROMD switching by forgetting
> to update the rom_mode state variable.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
> ---
>  hw/pflash_cfi02.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/hw/pflash_cfi02.c b/hw/pflash_cfi02.c
> index a9e88b9..2ca0fd4 100644
> --- a/hw/pflash_cfi02.c
> +++ b/hw/pflash_cfi02.c
> @@ -102,6 +102,7 @@ static void pflash_setup_mappings(pflash_t *pfl)
>  static void pflash_register_memory(pflash_t *pfl, int rom_mode)
>  {
>     memory_region_rom_device_set_readable(&pfl->orig_mem, rom_mode);
> +    pfl->rom_mode = rom_mode;
>  }
>
>  static void pflash_timer (void *opaque)
> --
> 1.7.3.4

Patch

diff --git a/hw/pflash_cfi02.c b/hw/pflash_cfi02.c
index a9e88b9..2ca0fd4 100644
--- a/hw/pflash_cfi02.c
+++ b/hw/pflash_cfi02.c
@@ -102,6 +102,7 @@  static void pflash_setup_mappings(pflash_t *pfl)
 static void pflash_register_memory(pflash_t *pfl, int rom_mode)
 {
     memory_region_rom_device_set_readable(&pfl->orig_mem, rom_mode);
+    pfl->rom_mode = rom_mode;
 }
 
 static void pflash_timer (void *opaque)