From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPBXA-0006Ib-FH for qemu-devel@nongnu.org; Fri, 19 Oct 2012 08:18:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TPBX0-0008D9-Sw for qemu-devel@nongnu.org; Fri, 19 Oct 2012 08:18:36 -0400 Received: from mail-ee0-f45.google.com ([74.125.83.45]:41327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPBX0-0008B6-Fj for qemu-devel@nongnu.org; Fri, 19 Oct 2012 08:18:26 -0400 Received: by mail-ee0-f45.google.com with SMTP id b47so179540eek.4 for ; Fri, 19 Oct 2012 05:18:24 -0700 (PDT) Date: Fri, 19 Oct 2012 14:18:18 +0200 From: "Edgar E. Iglesias" Message-ID: <20121019121817.GC16244@zapo> References: <97b5b7221a00513e1a695ef9d692b5f5dee4fc6a.1350619775.git.peter.crosthwaite@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v1 7/7] nand: Reset addressing after READSTATUS. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Peter Crosthwaite , john.williams@xilinx.com, qemu-devel@nongnu.org On Fri, Oct 19, 2012 at 12:59:49PM +0100, Peter Maydell wrote: > On 19 October 2012 07:40, Peter Crosthwaite > wrote: > > From: Edgar E. Iglesias > > > > Signed-off-by: Edgar E. Iglesias > > --- > > > > hw/nand.c | 6 ++++++ > > 1 files changed, 6 insertions(+), 0 deletions(-) > > > > diff --git a/hw/nand.c b/hw/nand.c > > index 01f3ada..f931d0c 100644 > > --- a/hw/nand.c > > +++ b/hw/nand.c > > @@ -478,6 +478,12 @@ void nand_setio(DeviceState *dev, uint32_t value) > > int i; > > NANDFlashState *s = (NANDFlashState *) dev; > > if (!s->ce && s->cle) { > > + if (s->cmd == NAND_CMD_READSTATUS) { > > + s->addr = 0; > > + s->addrlen = 0; > > + s->iolen = 0; > > + } > > + > > I find the NAND chip datasheets remarkably hard to interpret, but > I'm not convinced this patch is the right thing. Can you provide > some rationale/justification, please? (ideally with reference to > datasheets...) This is patch is quite old (several years). At the time modern linux kernels stopped working with our nand model in some cases. Some patch to our nand model broke something. I recall trying to make some sense out of it and this was the closest I got.. I don't know what the state it is today nor do I remember the exact circumstances on which the bug was trigged. Maybe Peter C has more info? Cheers, Edgar