From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1165114AbdEYGSE convert rfc822-to-8bit (ORCPT ); Thu, 25 May 2017 02:18:04 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:57210 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162785AbdEYGRx (ORCPT ); Thu, 25 May 2017 02:17:53 -0400 Date: Thu, 25 May 2017 08:17:47 +0200 From: Boris Brezillon To: Chris Packham Cc: "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Thomas Petazzoni , "ezequiel.garcia@free-electrons.com" , Gregory Clement 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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); -- 2.11.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 25 May 2017 08:17:47 +0200 From: Boris Brezillon To: Chris Packham Cc: "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Thomas Petazzoni , "ezequiel.garcia@free-electrons.com" , Gregory Clement 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> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Le Wed, 24 May 2017 22:58:53 +0000, Chris Packham a =C3=A9crit : > On 25/05/17 10:36, Boris Brezillon wrote: > > Le Wed, 24 May 2017 22:03:52 +0000, > > Chris Packham a =C3=A9crit : > > =20 > >> On 24/05/17 23:25, Boris Brezillon wrote: =20 > >>> On Wed, 24 May 2017 13:23:01 +0200 > >>> Boris Brezillon wrote: > >>> =20 > >>>> Hi Chris, > >>>> > >>>> On Wed, 24 May 2017 09:36:56 +0000 > >>>> Chris Packham wrote: > >>>> =20 > >>>>> On 23/05/17 17:27, Chris Packham wrote: =20 > >>>>>> 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 dev= ice > >>>>>> 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 tom= orrow > >>>>>> 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 ava= ilable > >>>>>> if it's helpful. =20 > >>>>> > >>>>> Still works on 4.12-rc2. Fails on next-20170524. > >>>>> > >>>>> This appears to be due to commit b566d9c055de ("mtd: nand: add supp= ort > >>>>> for Micron on-die ECC"). Which based on the description seems inten= tional. > >>>>> > >>>>> 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. =20 > >>>> > >>>> Can you try with this patch applied [1]? =20 > >>> > >>> Sorry, wrong patch. Can you try this one [1] instead? > >>> > >>> [1]http://code.bulix.org/pkfhmi-135875 > >>> =20 > >> > >> With the patch above the chip is detected but ubifs is unhappy =20 > >=20 > > Hm, weird. And if you revert my both Thomas patch and mine, what do you > > get? =20 >=20 > Seems to work just fine. Okay. Let's try with something simpler then. Can you test the following patch? --->8--- =46rom 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 *inf= o, return 0; } =20 +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 =3D mtd_to_nand(mtd); @@ -1812,6 +1819,8 @@ static int alloc_nand_resource(struct platform_device= *pdev) chip->write_buf =3D pxa3xx_nand_write_buf; chip->options |=3D NAND_NO_SUBPAGE_WRITE; chip->cmdfunc =3D nand_cmdfunc; + chip->onfi_set_features =3D pxa3xx_nand_get_set_features; + chip->onfi_get_features =3D pxa3xx_nand_get_set_features; } =20 nand_hw_control_init(chip->controller); --=20 2.11.0 From mboxrd@z Thu Jan 1 00:00:00 1970 From: boris.brezillon@free-electrons.com (Boris Brezillon) Date: Thu, 25 May 2017 08:17:47 +0200 Subject: pxa3xx-nand failing to find device on linux-next 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> Message-ID: <20170525081747.4c86164c@bbrezillon> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.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); -- 2.11.0