From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=42736 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q8q9q-0004yy-Jl for qemu-devel@nongnu.org; Sun, 10 Apr 2011 04:38:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q8q9p-0003Ft-Ci for qemu-devel@nongnu.org; Sun, 10 Apr 2011 04:38:10 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:47809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q8q9o-0003Fm-Vx for qemu-devel@nongnu.org; Sun, 10 Apr 2011 04:38:09 -0400 Message-ID: <4DA16C6A.7090303@web.de> Date: Sun, 10 Apr 2011 10:38:02 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1301861786-6637-1-git-send-email-jordan.l.justen@intel.com> In-Reply-To: <1301861786-6637-1-git-send-email-jordan.l.justen@intel.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5F407ABAF3BE96D24EB51222" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH] hw/pflash_cfi02: Fix lazy reset of ROMD mode List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jordan Justen Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5F407ABAF3BE96D24EB51222 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2011-04-03 22:16, Jordan Justen wrote: > 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. >=20 > Signed-off-by: Jordan Justen > --- > hw/pflash_cfi02.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) >=20 > diff --git a/hw/pflash_cfi02.c b/hw/pflash_cfi02.c > index 30c8aa4..370c5ee 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, > =20 > DPRINTF("%s: offset " TARGET_FMT_plx "\n", __func__, offset); > ret =3D -1; > - if (pfl->rom_mode) { > + if (!pfl->rom_mode) { > /* Lazy reset of to ROMD mode */ > if (pfl->wcycle =3D=3D 0) > pflash_register_memory(pfl, 1); Indeed, that block looks weird to its author today as well. But inverting the logic completely defeats the purpose of lazy mode switching (will likely file a patch to remove the block). We should instead switch back using the timer. So the question is: Did you actually see a problem that the flash was stuck in write mode, or did you just stumble over this strange code? In the former case, please explain the sequence or provide a trace. Thanks, Jan --------------enig5F407ABAF3BE96D24EB51222 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk2hbG4ACgkQitSsb3rl5xQsGgCfdGjVIBVDyCU4SkCw5o/97htf i2oAmwfaf8Rm1DGsiyozi40JmZgpGFKq =MbkT -----END PGP SIGNATURE----- --------------enig5F407ABAF3BE96D24EB51222--