From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48285 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q8zOH-0001Fi-Ml for qemu-devel@nongnu.org; Sun, 10 Apr 2011 14:29:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q8zOG-0004vY-KH for qemu-devel@nongnu.org; Sun, 10 Apr 2011 14:29:41 -0400 Received: from mail-px0-f174.google.com ([209.85.212.174]:57080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q8zOG-0004vR-Er for qemu-devel@nongnu.org; Sun, 10 Apr 2011 14:29:40 -0400 Received: by pxi15 with SMTP id 15so2511111pxi.33 for ; Sun, 10 Apr 2011 11:29:38 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4DA16C6A.7090303@web.de> References: <1301861786-6637-1-git-send-email-jordan.l.justen@intel.com> <4DA16C6A.7090303@web.de> Date: Sun, 10 Apr 2011 11:29:38 -0700 Message-ID: Subject: Re: [Qemu-devel] Re: [PATCH] hw/pflash_cfi02: Fix lazy reset of ROMD mode From: Jordan Justen Content-Type: text/plain; charset=ISO-8859-1 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel@nongnu.org On Sun, Apr 10, 2011 at 01:38, Jan Kiszka wrote: > 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). Looking at the 2nd parameter to the call, and the pflash_register_memory code, it seems it only makes sense with the !pfl->rom_mode. I thought that the goal was to allow multiple write operations before exiting to rom mode, but that a read will return it to rom mode. In that case, this change seemed to fix it. > 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. I had enabled the debug trace messages and was probing the flash from the efi shell on x86-64. I found that I would always see the debug messages for reads, after I started writing to the flash. This change allowed the flash to go back to a rom mode where the debug prints would then disappear for subsequent reads. -Jordan