Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSzjJ-0007pK-9Z for qemu-devel@nongnu.org; Thu, 07 Jan 2010 16:17:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSzjH-0007mp-QG for qemu-devel@nongnu.org; Thu, 07 Jan 2010 16:17:16 -0500 Received: from [199.232.76.173] (port=56675 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSzjH-0007mb-Ix for qemu-devel@nongnu.org; Thu, 07 Jan 2010 16:17:15 -0500 Received: from ey-out-1920.google.com ([74.125.78.147]:14117) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSzjH-0002bW-3b for qemu-devel@nongnu.org; Thu, 07 Jan 2010 16:17:15 -0500 Received: by ey-out-1920.google.com with SMTP id 5so14718360eyb.14 for ; Thu, 07 Jan 2010 13:17:13 -0800 (PST) Date: Fri, 8 Jan 2010 05:55:08 +0100 From: "Edgar E. Iglesias" Subject: Re: [Qemu-devel] [PATCH] NAND: Correct random data reads Message-ID: <20100108045508.GA10190@laped.iglesias.mooo.com> References: <4B4641C3.3070503@octasic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B4641C3.3070503@octasic.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jean-Hugues Deschenes Cc: qemu-devel@nongnu.org, edgar.iglesias@axis.com On Thu, Jan 07, 2010 at 03:19:15PM -0500, Jean-Hugues Deschenes wrote: > > On Mon, Dec 15, 2008 at 03:31:55AM +0100, andrzej zaborowski wrote: > > >/ 2008/12/12 Edgar E. Iglesias :/ > > >/ > I'm having problems with machine that uses a NAND_MFR_STMICRO 0xf1,/ > > >/ > recent Linux versions cannot properly read from the flash./ > > >/ >/ > > >/ > Turns out that Linux MTD recently learned howto do randomly accessed reads/ > > >/ > from NAND flashes. QEMU has problemns emulating these./ > > >/ >/ > > >/ > This patch fixes the problem for me but I've only tested on one flash/ > > >/ > model and only with Linux. I'd appreciate help with testing more machines/ > > >/ > with NANDs and ofcourse any comments people may have on the patch./ > > >/ >/ > > >/ > Thanks/ > > >/ >/ > > >/ > commit 68a19f4348b12f85bd5fbfd8cf7b19033e1fd784/ > > >/ > Author: Edgar E. Iglesias / > > >/ > Date: Fri Dec 12 12:48:58 2008 +0100/ > > >/ >/ > > >/ > NAND: Correct random data reads./ > > >/ >/ > > >/ > Random reading depends on having the last row/page latched and not beeing/ > > >/ > clobbered between read and any following random reads./ > > >/ >/ > > >/ > Also, s->iolen must be updated when loading the io/data register with / > > >/ > randomly/ > > >/ > accessed flash data./ > > >/ >/ > > >/ > Signed-off-by: Edgar E. Iglesias / > > >/ > + unsigned int offset;/ ... > > >/ Won't that break sequential reading? I think the other modifications/ > > > > I found specs for a flash with sequential page-crossing reads. My > > code does not handle that but neither does current svn AFAICT. The > > masking is wrong, we'll always end up at page 1. > > > > >/ should also be conditional on the command being RANDOMREAD./ > > >/ / > > >/ BTW, do you happen to know what the difference is between RANDOMREAD2/ > > >/ and NOSERIALREAD2? I basically added those commands because various/ > > > > AFAIK noserial reads are for preparing copyback writes. Random reads are > > for random access within the page register. > > > > I'll try to fix and test the page-crossing seqreads. > > > > Thanks alot for the comments. > Hi, > > I'm just wondering what is the status of this patch; It has definitely solved one of my problems, where a NAND flash controller I'm emulating sends random read commands to an emulated large page device. Hi, I forgot about this one.. It's in one of my trees, I'll try to find it & repost and see if there is more feedback. My main concern was that I only had linux guests to test with. Cheers