qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 0/2] pflash_cfi01: avoid and fix unknown-command-sta


From: Peter Maydell
Subject: [Qemu-devel] [PATCH 0/2] pflash_cfi01: avoid and fix unknown-command-state reads
Date: Mon, 21 Jan 2013 14:08:36 +0000

While I was looking at the implicit-fallthrough in pflash_cfi02,
I noticed that the code in pflash_cfi01 was different and wrong.
Specifically, the cfi01 code is attempting to do the same "fall
through to treat as a normal read" trick, but somebody has moved
the default case so it's no longer above the thing it wants to
fall through to. Patch 2 corrects this.

Patch 1 fixes a bug which was the only way you could get into the
default case in the first place: this default is a "can't happen"
case which implies that the pflash_read() switch is missing
handling code for a command which is implemented in pflash_write().
In fact for cfi01 there were some missing cases, so we add them,
based on the spec which defines what the read should return for
these commands, which is the status register value in all cases.

[The patch order is merely so that by the time we get to patch 2
it is a "does not change user visible behaviour" change.]


Peter Maydell (2):
  hw/pflash_cfi01: Make read after byte-write or erase return status
  hw/pflash_cfi01: Treat read in unknown command state as read

 hw/pflash_cfi01.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]