Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1515112 > unrolled thread

[PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error

Started byMasahiro Yamada <yamada.masahiro@socionext.com>
First post2016-11-04 11:50 +0100
Last post2016-11-07 00:00 +0100
Articles 8 on this page of 28 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 07/22] mtd: nand: orion: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 01/22] mtd: nand: ams-delta: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 20/22] mtd: nand: pxa3xx: return error code of nand_scan_ident() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 19/22] mtd: nand: hisi504: return error code of nand_scan_ident() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 14/22] mtd: nand: mediatek: return error code of nand_scan_ident/tail() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 11/22] mtd: nand: brcmnand: return error code of nand_scan_ident/tail() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 17/22] mtd: nand: vf610: return error code of nand_scan_ident/tail() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 16/22] mtd: nand: omap2: return error code of nand_scan_ident/tail() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 12/22] mtd: nand: fsmc: return error code of nand_scan_ident/tail() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 08/22] mtd: nand: pasemi: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 18/22] mtd: nand: cafe: return error code of nand_scan_ident() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 21/22] mtd: nand: nandsim: remove unneeded checks for nand_scan_ident/tail() Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 09/22] mtd: nand: plat_nand: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 10/22] mtd: nand: atmel: return error code of nand_scan_ident/tail() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 06/22] mtd: nand: tmio: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 22/22] mtd: nand: socrates: use nand_scan() for nand_scan_ident/tail() combo Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 15/22] mtd: nand: mxc: return error code of nand_scan_ident/tail() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 03/22] mtd: nand: cs553x: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 13/22] mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
      Re: [PATCH 13/22] mtd: nand: lpc32xx: return error code of  nand_scan_ident/tail() on error Vladimir Zapolskiy <vz@mleia.com> - 2016-11-06 02:40 +0100
      Re: [PATCH 13/22] mtd: nand: lpc32xx: return error code of  nand_scan_ident/tail() on error Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-11-06 19:40 +0100
        Re: [PATCH 13/22] mtd: nand: lpc32xx: return error code of  nand_scan_ident/tail() on error Vladimir Zapolskiy <vz@mleia.com> - 2016-11-07 01:40 +0100
    [PATCH 05/22] mtd: nand: mpc5121: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 02/22] mtd: nand: cmx270: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 04/22] mtd: nand: gpio: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    Re: [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,  _tail) on error Marek Vasut <marek.vasut@gmail.com> - 2016-11-05 08:40 +0100
    Re: [PATCH 00/22] mtd: nand: return error code of  nand_scan(_ident,_tail) on error Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-11-07 00:00 +0100

Page 2 of 2 — ← Prev page 1 [2]


#1515649 — Re: [PATCH 13/22] mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on error

FromVladimir Zapolskiy <vz@mleia.com>
Date2016-11-06 02:40 +0100
SubjectRe: [PATCH 13/22] mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on error
Message-ID<sAkBb-7hY-5@gated-at.bofh.it>
In reply to#1515131
On 11/04/2016 12:43 PM, Masahiro Yamada wrote:
> The nand_scan_ident/tail() returns an appropriate error value when
> it fails.  Use it instead of the fixed error code -ENXIO.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---

Acked-by: Vladimir Zapolskiy <vz@mleia.com>

Thank you for the change.

--
With best wishes,
Vladimir

[toc] | [prev] | [next] | [standalone]


#1515732 — Re: [PATCH 13/22] mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on error

FromBoris Brezillon <boris.brezillon@free-electrons.com>
Date2016-11-06 19:40 +0100
SubjectRe: [PATCH 13/22] mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on error
Message-ID<sAAwh-zC-1@gated-at.bofh.it>
In reply to#1515131
On Fri,  4 Nov 2016 19:43:01 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:

> The nand_scan_ident/tail() returns an appropriate error value when
> it fails.  Use it instead of the fixed error code -ENXIO.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>  drivers/mtd/nand/lpc32xx_mlc.c | 10 ++++------
>  drivers/mtd/nand/lpc32xx_slc.c |  9 +++------
>  2 files changed, 7 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/mtd/nand/lpc32xx_mlc.c b/drivers/mtd/nand/lpc32xx_mlc.c
> index 8523881..5553a5d 100644
> --- a/drivers/mtd/nand/lpc32xx_mlc.c
> +++ b/drivers/mtd/nand/lpc32xx_mlc.c
> @@ -747,10 +747,9 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
>  	 * Scan to find existance of the device and
>  	 * Get the type of NAND device SMALL block or LARGE block
>  	 */
> -	if (nand_scan_ident(mtd, 1, NULL)) {
> -		res = -ENXIO;
> +	res = nand_scan_ident(mtd, 1, NULL);
> +	if (res)
>  		goto err_exit3;
> -	}
>  
>  	host->dma_buf = devm_kzalloc(&pdev->dev, mtd->writesize, GFP_KERNEL);
>  	if (!host->dma_buf) {
> @@ -793,10 +792,9 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
>  	 * Fills out all the uninitialized function pointers with the defaults
>  	 * And scans for a bad block table if appropriate.
>  	 */
> -	if (nand_scan_tail(mtd)) {
> -		res = -ENXIO;
> +	res = nand_scan_tail(mtd);
> +	if (res)
>  		goto err_exit4;
> -	}
>  
>  	mtd->name = DRV_NAME;
>  
> diff --git a/drivers/mtd/nand/lpc32xx_slc.c b/drivers/mtd/nand/lpc32xx_slc.c
> index 8d3edc3..f1094e5 100644
> --- a/drivers/mtd/nand/lpc32xx_slc.c
> +++ b/drivers/mtd/nand/lpc32xx_slc.c
> @@ -894,10 +894,9 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
>  	}
>  
>  	/* Find NAND device */
> -	if (nand_scan_ident(mtd, 1, NULL)) {
> -		res = -ENXIO;
> +	res = nand_scan_ident(mtd, 1, NULL);
> +	if (res)
>  		goto err_exit3;
> -	}
>  
>  	/* OOB and ECC CPU and DMA work areas */
>  	host->ecc_buf = (uint32_t *)(host->data_buf + LPC32XX_DMA_DATA_SIZE);
> @@ -929,10 +928,8 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
>  	/*
>  	 * Fills out all the uninitialized function pointers with the defaults
>  	 */
> -	if (nand_scan_tail(mtd)) {
> -		res = -ENXIO;
> +	res = nand_scan_tail(mtd);

You miss

	if (res)

here.

No need to resend, I'll fix it when applying the patches.

>  		goto err_exit3;
> -	}
>  
>  	mtd->name = "nxp_lpc3220_slc";
>  	res = mtd_device_register(mtd, host->ncfg->parts,

[toc] | [prev] | [next] | [standalone]


#1515803 — Re: [PATCH 13/22] mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on error

FromVladimir Zapolskiy <vz@mleia.com>
Date2016-11-07 01:40 +0100
SubjectRe: [PATCH 13/22] mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on error
Message-ID<sAG8F-47m-1@gated-at.bofh.it>
In reply to#1515732
Hi Boris,

On 11/06/2016 08:27 PM, Boris Brezillon wrote:
> On Fri,  4 Nov 2016 19:43:01 +0900
> Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>
>> The nand_scan_ident/tail() returns an appropriate error value when
>> it fails.  Use it instead of the fixed error code -ENXIO.
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> ---

[snip]

>> -	if (nand_scan_tail(mtd)) {
>> -		res = -ENXIO;
>> +	res = nand_scan_tail(mtd);
>
> You miss
>
> 	if (res)
>
> here.
>
> No need to resend, I'll fix it when applying the patches.
>
>>  		goto err_exit3;
>> -	}
>>

nice catch, thank you for noticing and fixing the overlooked bug!

--
With best wishes,
Vladimir

[toc] | [prev] | [next] | [standalone]


#1515132 — [PATCH 05/22] mtd: nand: mpc5121: return error code of nand_scan() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 05/22] mtd: nand: mpc5121: return error code of nand_scan() on error
Message-ID<szKen-yl-65@gated-at.bofh.it>
In reply to#1515112
The nand_scan() returns an appropriate error value when it fails.
Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/mpc5121_nfc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c
index 7eacb2f..6d6eaed 100644
--- a/drivers/mtd/nand/mpc5121_nfc.c
+++ b/drivers/mtd/nand/mpc5121_nfc.c
@@ -777,9 +777,9 @@ static int mpc5121_nfc_probe(struct platform_device *op)
 	}
 
 	/* Detect NAND chips */
-	if (nand_scan(mtd, be32_to_cpup(chips_no))) {
+	retval = nand_scan(mtd, be32_to_cpup(chips_no));
+	if (retval) {
 		dev_err(dev, "NAND Flash not found !\n");
-		retval = -ENXIO;
 		goto error;
 	}
 
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515133 — [PATCH 02/22] mtd: nand: cmx270: return error code of nand_scan() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 02/22] mtd: nand: cmx270: return error code of nand_scan() on error
Message-ID<szKen-yl-67@gated-at.bofh.it>
In reply to#1515112
The nand_scan() returns an appropriate error value when it fails.
Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/cmx270_nand.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/cmx270_nand.c b/drivers/mtd/nand/cmx270_nand.c
index 4913378..226ac0b 100644
--- a/drivers/mtd/nand/cmx270_nand.c
+++ b/drivers/mtd/nand/cmx270_nand.c
@@ -195,9 +195,9 @@ static int __init cmx270_init(void)
 	this->write_buf = cmx270_write_buf;
 
 	/* Scan to find existence of the device */
-	if (nand_scan (cmx270_nand_mtd, 1)) {
+	ret = nand_scan(cmx270_nand_mtd, 1);
+	if (ret) {
 		pr_notice("No NAND device\n");
-		ret = -ENXIO;
 		goto err_scan;
 	}
 
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515135 — [PATCH 04/22] mtd: nand: gpio: return error code of nand_scan() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 04/22] mtd: nand: gpio: return error code of nand_scan() on error
Message-ID<szKen-yl-73@gated-at.bofh.it>
In reply to#1515112
The nand_scan() returns an appropriate error value when it fails.
Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/gpio.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c
index 6317f68..0d24857 100644
--- a/drivers/mtd/nand/gpio.c
+++ b/drivers/mtd/nand/gpio.c
@@ -286,10 +286,9 @@ static int gpio_nand_probe(struct platform_device *pdev)
 	if (gpio_is_valid(gpiomtd->plat.gpio_nwp))
 		gpio_direction_output(gpiomtd->plat.gpio_nwp, 1);
 
-	if (nand_scan(mtd, 1)) {
-		ret = -ENXIO;
+	ret = nand_scan(mtd, 1);
+	if (ret)
 		goto err_wp;
-	}
 
 	if (gpiomtd->plat.adjust_parts)
 		gpiomtd->plat.adjust_parts(&gpiomtd->plat, mtd->size);
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515511 — Re: [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident, _tail) on error

FromMarek Vasut <marek.vasut@gmail.com>
Date2016-11-05 08:40 +0100
SubjectRe: [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident, _tail) on error
Message-ID<sA3K1-4Yr-1@gated-at.bofh.it>
In reply to#1515112
On 11/04/2016 11:42 AM, Masahiro Yamada wrote:
> 
> nand_scan(), nand_scan_ident(), nand_scan_tail() return
> an appropriate negative value on error.
> 
> Most of drivers return the value from them on error,
> but some of them return the fixed error code -ENXIO
> (and a few return -ENODEV).
> 
> This series make those drivers return more precise error code.
> 

Reviewed-by: Marek Vasut <marek.vasut@gmail.com>

Nice cleanup, thanks!

-- 
Best regards,
Marek Vasut

[toc] | [prev] | [next] | [standalone]


#1515780 — Re: [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error

FromBoris Brezillon <boris.brezillon@free-electrons.com>
Date2016-11-07 00:00 +0100
SubjectRe: [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error
Message-ID<sAEzT-33D-1@gated-at.bofh.it>
In reply to#1515112
On Fri,  4 Nov 2016 19:42:48 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:

> nand_scan(), nand_scan_ident(), nand_scan_tail() return
> an appropriate negative value on error.
> 
> Most of drivers return the value from them on error,
> but some of them return the fixed error code -ENXIO
> (and a few return -ENODEV).
> 
> This series make those drivers return more precise error code.

Applied and fixed the bug I found in patch 13.

Thanks,

Boris

> 
> 
> Masahiro Yamada (22):
>   mtd: nand: ams-delta: return error code of nand_scan() on error
>   mtd: nand: cmx270: return error code of nand_scan() on error
>   mtd: nand: cs553x: return error code of nand_scan() on error
>   mtd: nand: gpio: return error code of nand_scan() on error
>   mtd: nand: mpc5121: return error code of nand_scan() on error
>   mtd: nand: tmio: return error code of nand_scan() on error
>   mtd: nand: orion: return error code of nand_scan() on error
>   mtd: nand: pasemi: return error code of nand_scan() on error
>   mtd: nand: plat_nand: return error code of nand_scan() on error
>   mtd: nand: atmel: return error code of nand_scan_ident/tail() on error
>   mtd: nand: brcmnand: return error code of nand_scan_ident/tail() on
>     error
>   mtd: nand: fsmc: return error code of nand_scan_ident/tail() on error
>   mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on
>     error
>   mtd: nand: mediatek: return error code of nand_scan_ident/tail() on
>     error
>   mtd: nand: mxc: return error code of nand_scan_ident/tail() on error
>   mtd: nand: omap2: return error code of nand_scan_ident/tail() on error
>   mtd: nand: vf610: return error code of nand_scan_ident/tail() on error
>   mtd: nand: cafe: return error code of nand_scan_ident() on error
>   mtd: nand: hisi504: return error code of nand_scan_ident() on error
>   mtd: nand: pxa3xx: return error code of nand_scan_ident() on error
>   mtd: nand: nandsim: remove unneeded checks for nand_scan_ident/tail()
>   mtd: nand: socrates: use nand_scan() for nand_scan_ident/tail() combo
> 
>  drivers/mtd/nand/ams-delta.c         |  5 ++---
>  drivers/mtd/nand/atmel_nand.c        | 10 ++++------
>  drivers/mtd/nand/brcmnand/brcmnand.c | 10 ++++++----
>  drivers/mtd/nand/cafe_nand.c         |  5 ++---
>  drivers/mtd/nand/cmx270_nand.c       |  4 ++--
>  drivers/mtd/nand/cs553x_nand.c       |  5 ++---
>  drivers/mtd/nand/fsmc_nand.c         |  9 ++++-----
>  drivers/mtd/nand/gpio.c              |  5 ++---
>  drivers/mtd/nand/hisi504_nand.c      |  4 +---
>  drivers/mtd/nand/lpc32xx_mlc.c       | 10 ++++------
>  drivers/mtd/nand/lpc32xx_slc.c       |  9 +++------
>  drivers/mtd/nand/mpc5121_nfc.c       |  4 ++--
>  drivers/mtd/nand/mtk_nand.c          |  4 ++--
>  drivers/mtd/nand/mxc_nand.c          | 10 ++++------
>  drivers/mtd/nand/nandsim.c           |  4 ----
>  drivers/mtd/nand/omap2.c             |  9 ++++-----
>  drivers/mtd/nand/orion_nand.c        |  5 ++---
>  drivers/mtd/nand/pasemi_nand.c       |  5 ++---
>  drivers/mtd/nand/plat_nand.c         |  5 ++---
>  drivers/mtd/nand/pxa3xx_nand.c       |  5 +++--
>  drivers/mtd/nand/socrates_nand.c     | 12 ++----------
>  drivers/mtd/nand/tmio_nand.c         |  6 +++---
>  drivers/mtd/nand/vf610_nfc.c         | 10 ++++------
>  23 files changed, 62 insertions(+), 93 deletions(-)
> 

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.kernel


csiph-web