From patchwork Thu May 25 06:17:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 766841 X-Patchwork-Delegate: boris.brezillon@free-electrons.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wYJx01cDWz9s7y for ; Thu, 25 May 2017 16:18:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TN0VJVtE"; dkim-atps=neutral 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=EBl9hpVGHQ73W/5BUTKz0TK6JC2CqpWetH873dZBZUY=; b=TN0VJVtE4xJsSV 8CqPExqkRgXMQ6vl56Py/j97w9JOLzNsKXiHO744gjj40caTPmwLoFO62yqaQKXeuxar4FZCnG++P eLHD5zSuvxjB/oa/g7uiz7XxJVNy/KkGxGXT8PbBJE9f1NYwdgwic5eohEtV6LPLOhVfNpzKkLF6/ foyq9PzBzrLc9uu+lRmc+f6bDRPoyCcuUOIl7opJQ+1M07UI7hLtkHkm+k60ivJTJqCDCy8ewPWeB yNivXT9blPVLEfa4Sf1RaLFNx3dmlWCX0dzA3uRfO7OA19WS1YYuvhBoLUkA3NcinrJzgkUKK1MxW 6KCrTwq9Sbg2Glpjs9FQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dDm6K-0007nt-MS; Thu, 25 May 2017 06:18:24 +0000 Received: from mail.free-electrons.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dDm68-0007co-Ds; Thu, 25 May 2017 06:18:14 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id 5CE8F207E6; Thu, 25 May 2017 08:17:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (unknown [91.160.177.164]) by mail.free-electrons.com (Postfix) with ESMTPSA id 268162077D; Thu, 25 May 2017 08:17:49 +0200 (CEST) Date: Thu, 25 May 2017 08:17:47 +0200 From: Boris Brezillon To: Chris Packham Subject: Re: pxa3xx-nand failing to find device on linux-next Message-ID: <20170525081747.4c86164c@bbrezillon> In-Reply-To: <69dfc0d5ca774efb8c92e9ec635f68ec@svr-chch-ex1.atlnz.lc> References: <2a79405e219b4c37ba00defbe4a0dfe4@svr-chch-ex1.atlnz.lc> <20170524132301.12ad33d8@bbrezillon> <20170524132508.420614c7@bbrezillon> <20170525003646.276516d0@bbrezillon> <69dfc0d5ca774efb8c92e9ec635f68ec@svr-chch-ex1.atlnz.lc> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170524_231812_765277_58BC9850 X-CRM114-Status: GOOD ( 22.88 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "linux-kernel@vger.kernel.org" , "linux-mtd@lists.infradead.org" , "ezequiel.garcia@free-electrons.com" , Gregory Clement , "linux-arm-kernel@lists.infradead.org" Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Le Wed, 24 May 2017 22:58:53 +0000, Chris Packham a écrit : > On 25/05/17 10:36, Boris Brezillon wrote: > > Le Wed, 24 May 2017 22:03:52 +0000, > > Chris Packham a écrit : > > > >> On 24/05/17 23:25, Boris Brezillon wrote: > >>> On Wed, 24 May 2017 13:23:01 +0200 > >>> Boris Brezillon wrote: > >>> > >>>> Hi Chris, > >>>> > >>>> On Wed, 24 May 2017 09:36:56 +0000 > >>>> Chris Packham wrote: > >>>> > >>>>> On 23/05/17 17:27, Chris Packham wrote: > >>>>>> Hi, > >>>>>> > >>>>>> I'm doing some testing on linux-next and I'm finding that my nand flash > >>>>>> has disappeared. > >>>>>> > >>>>>> pxa3xx-nand f10d0000.flash: This platform can't do DMA on this device > >>>>>> pxa3xx-nand f10d0000.flash: non-supported command ef > >>>>>> pxa3xx-nand f10d0000.flash: non-supported command ee > >>>>>> pxa3xx-nand f10d0000.flash: non-supported command ef > >>>>>> pxa3xx-nand f10d0000.flash: non-supported command ee > >>>>>> On-die ECC forcefully enabled, not supported > >>>>>> nand: No NAND device found > >>>>>> pxa3xx-nand f10d0000.flash: failed to scan nand at cs 0 > >>>>>> > >>>>>> This was working around 4.11. I'll try to do some more digging tomorrow > >>>>>> to narrow down a failure point but I thought I'd send this out now just > >>>>>> in case it rings any bells. > >>>>>> > >>>>>> The board I'm using (DB-88F6820-AMC) is unfortunately out-of tree but it > >>>>>> should be pretty close to the armada-388-db. I can make my dts available > >>>>>> if it's helpful. > >>>>> > >>>>> Still works on 4.12-rc2. Fails on next-20170524. > >>>>> > >>>>> This appears to be due to commit b566d9c055de ("mtd: nand: add support > >>>>> for Micron on-die ECC"). Which based on the description seems intentional. > >>>>> > >>>>> Since I have access to a hardware platform that has a micron flash with > >>>>> ECC forcefully enabled how can I help to get this implemented. > >>>> > >>>> Can you try with this patch applied [1]? > >>> > >>> Sorry, wrong patch. Can you try this one [1] instead? > >>> > >>> [1]http://code.bulix.org/pkfhmi-135875 > >>> > >> > >> With the patch above the chip is detected but ubifs is unhappy > > > > Hm, weird. And if you revert my both Thomas patch and mine, what do you > > get? > > Seems to work just fine. Okay. Let's try with something simpler then. Can you test the following patch? --->8--- From 0a0eaa39ea9b19191ae0c31ff3625c224a8a55f2 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 25 May 2017 08:15:15 +0200 Subject: [PATCH] mtd: nand: pxa3xx: Implement failing ->onfi_{set,get}_features() stubs Implement stubs returning -ENOTSUPP for ->onfi_{set,get}_features() so that we don't let the core think we are supporting the GET/SET FEATURES operation. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/pxa3xx_nand.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 649ba8200832..341a229046f5 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1649,6 +1649,13 @@ static int pxa_ecc_init(struct pxa3xx_nand_info *info, return 0; } +static int pxa3xx_nand_get_set_features(struct mtd_info *mtd, + struct nand_chip *chip, + int feature_addr, u8 *subfeature_para) +{ + return -ENOTSUPP; +} + static int pxa3xx_nand_scan(struct mtd_info *mtd) { struct nand_chip *chip = mtd_to_nand(mtd); @@ -1812,6 +1819,8 @@ static int alloc_nand_resource(struct platform_device *pdev) chip->write_buf = pxa3xx_nand_write_buf; chip->options |= NAND_NO_SUBPAGE_WRITE; chip->cmdfunc = nand_cmdfunc; + chip->onfi_set_features = pxa3xx_nand_get_set_features; + chip->onfi_get_features = pxa3xx_nand_get_set_features; } nand_hw_control_init(chip->controller);