From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 517C8C433E0 for ; Sat, 16 May 2020 19:09:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 196CD20709 for ; Sat, 16 May 2020 19:09:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bCNLxd0H" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 196CD20709 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wprE/MKR4VtOo541JrdHF7k38T22NJMgMMGR6+0VlxA=; b=bCNLxd0H+ntmdZ eIi4XlfZg/8JXYwlSu85/kc9LENhPiUe7Mnqsgw9B/xmqYdUaC2Xrdo7WGv+LehONNsC24RMS/aaK hCcU4iY/ed947d4CUxtHrJv2aYN8RShdakJKGqjB56Oemph3Nnqu1dL2sOT9nwTEMItGWvKMKnZi/ Nrx+J72m3f9/7GVRaF7gGm0CAVwTIsSikeS0ndl3SZt1yY1uFZF/kgc5o1I5RS7YsnpBO/5fK5AOJ GvWx9n3kBUP1bPAiTqGsC+ihafxUBqlVqpceAvNnNqiicCsiHw8aUY+YeK9AZMcux8iRDDHQk55Ze dByJqAKvluUBRTjFrS6Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ja2BJ-0007XQ-98; Sat, 16 May 2020 19:09:09 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ja2BD-0007QW-JS for linux-mtd@lists.infradead.org; Sat, 16 May 2020 19:09:05 +0000 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:b93f:9fae:b276:a89a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 273E52A05EC; Sat, 16 May 2020 20:09:00 +0100 (BST) Date: Sat, 16 May 2020 21:08:57 +0200 From: Boris Brezillon To: Lubomir Rintel Subject: Re: [PATCH v2 00/19] mtd: rawnand: cafe: Convert to exec_op() (and more) Message-ID: <20200516210857.2b579ae4@collabora.com> In-Reply-To: <20200516145650.GA1433661@furthur.local> References: <20200509202855.GB524772@furthur.local> <20200510083105.4bcfa71b@collabora.com> <20200510084541.29e4069e@collabora.com> <20200510072108.GA587379@furthur.local> <20200510093549.56f74e61@collabora.com> <20200511102305.7d843fbc@collabora.com> <20200512164057.GC604838@furthur.local> <20200513191038.49a4fdf3@collabora.com> <20200515144703.GA1245784@furthur.local> <20200515192540.GB1245784@furthur.local> <20200516145650.GA1433661@furthur.local> Organization: Collabora X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200516_120903_901646_AB605D42 X-CRM114-Status: GOOD ( 29.80 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Weinberger , Tudor Ambarus , linux-mtd@lists.infradead.org, Vignesh Raghavendra , Miquel Raynal Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Sat, 16 May 2020 16:56:50 +0200 Lubomir Rintel wrote: > On Fri, May 15, 2020 at 09:25:43PM +0200, Lubomir Rintel wrote: > > On Fri, May 15, 2020 at 04:47:07PM +0200, Lubomir Rintel wrote: > > > On Wed, May 13, 2020 at 07:10:38PM +0200, Boris Brezillon wrote: > > > > Hi Lubomir, > > > > > > > > On Tue, 12 May 2020 18:40:57 +0200 > > > > Lubomir Rintel wrote: > > > > > > > > > I don't really mind the patch; I was just not sure why you removed the > > > > > acks and re-set the mask and suspected that maybe it was not > > > > > intentional. > > > > > > > > > > That said, I've now disabled the camera and mmc and did my usual test > > > > > of mounting the filesystem and I'm seeing zero interrupts. > > > > > > > > > > I suppose it's safe to assume that contrary to what I was imagining, > > > > > the masking works well and the interrupts I was seeing are indeed from > > > > > elsewhere (I guess the MMC driver polling the controller or something). > > > > > > > > > > Also, the re-set of the mask from the interrupt handler is not realy > > > > > necessary (but I certainly wouldn't complain if you keep it in place). > > > > > > > > I pushed a new version to my nand/cafe-nand-exec-op-debug branch. This > > > > time I get rid of the IRQ handler as it's not used anyway. Let me know > > > > if that keeps working an I'll send a v3. > > > > > > I can confirm that your branch (as of 12ef1918985f "mtd: rawnand: cafe: Get > > > rid of the last printk()") is working great here: > > > > > > bash-5.0# time mount -t jffs2 mtd0 /mnt > > > jffs2: notice: (101) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) . > > > > > > real 0m7.319s > > > user 0m0.000s > > > sys 0m7.294s > > > bash-5.0# uname -a > > > Linux (none) 5.7.0-rc3-00097-g12ef1918985f #114 PREEMPT Fri May 15 16:35:01 CEST 2020 i586 GNU/Linux > > > bash-5.0# > > > > Spoke too soon again. Seems like the writes don't make it to the device: > > > > bash-5.0# mount -t jffs2 /dev/mtdblock0 /mnt > > jffs2: Empty flash at 0x045a5798 ends at 0x045a5800 > > jffs2: notice: (98) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (0 unchecked, 0 orphan) and 1 of xref (0 dead, 0 orphan) f. > > bash-5.0# touch /mnt/meh > > bash-5.0# sync > > jffs2: jffs2_flush_wbuf(): Write failed with -5 > > jffs2: jffs2_flush_wbuf(): Write failed with -5 > > jffs2: jffs2_flush_wbuf(): Write failed with -5 > > jffs2: jffs2_flush_wbuf(): Write failed with -5 > > bash-5.0# > > > > I'll follow up once I know more; with some traces or hopefully a fix. > > Hi again. Hope you're having a good weekend. > > Some good news and some bad news. Good news is that now I got around to > building an image with mtd_debug and got around to making erase, write > adn read work, withut the hassle of dealing with jffs2 (and hassle of > dealing with corrupted image from eariler attempts). > > The bad news is that I have very little idea about what I'm actually > doing. Here's the branch with changes I've done, with my notes in > the commit messages: > > git fetch git://git.kernel.org/pub/scm/linux/kernel/git/lkundrak/linux.git \ > lr/nand/cafe-nand-exec-op-debug > > The relevant changes: > > 6ee7e0d11e19 fixup! mtd: rawnand: cafe: Demistify register fields This one is valid. > 565d5f126e86 fixup! mtd: rawnand: cafe: Demistify register fields Here it should be #define CAFE_NAND_ECC_SYN_REG(x) ((((x) / 2) * 4) + 0x50) but maybe the loop is no longer valid after that. > 064d381b4615 fixup! mtd: rawnand: cafe: Demistify register fields This one looks good too. > > During the test with JFFS2 filesystem, I was seeing a metric ton of ECC > errors. I have no clue where they came from because they presumably happened > on an asynchronous writeback, but they no longer happen and I believe > some of the above was to blame. Unfortunely I didn't investigate > further, because in my setup it is hugely inconvenient to beat the image > back into shape. > > 085a6ad43151 Revert "mtd: rawnand: cafe: Don't leave ECC enabled in the write path" > > This triggered a WARN_ON(). Probably not too important, because the > code in question gets thrown out afterwards. Oops. Maybe I should move it after the exec_op() conversion then. > > 4a9d95bf6d6b fixup! mtd: rawnand: cafe: Add exec_op() support > > An straightforward fix for page write op. Yep, that one is valid, thanks for the fix. > > 6959a724994d XXX add address to CMD_STATUS > > Tricky, and I have no idea what's going on. Perhaps you'll have an > idea how to either address this more reasonably. As usual, I'm happy > to apply patches with extra tracing if necessary. Duh, that one is super weird. I wonder if it doesn't have to do with the fact we're using DMA. Can you try with the DMA disabled? I see there's also a non-memory read mode, but even the standard mode should work according to the diagram page 37 of the spec [1]. [1]http://wiki.laptop.org/images/5/5c/88ALP01_Datasheet_July_2007.pdf ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/