mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: Do not automatically set SUBPAGE_READ flag
@ 2014-02-21 15:23 Hattink, Tjalling [FINT]
  2014-02-24  8:53 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Hattink, Tjalling [FINT] @ 2014-02-21 15:23 UTC (permalink / raw)
  To: barebox

The default nand_read_subpage implementation returns -ENOSUPP, so if you
use a large nand chip without a specific read_subpage implementation the
read operations will always fail.

This functionaliy can be restored when a proper nand_read_subpage is
implemented for the default driver.

Signed-off-by: Tjalling Hattink <t.hattink@fugro.nl>
---
 drivers/mtd/nand/nand_base.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 54d8ba3..bfd695b 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3562,10 +3562,6 @@ int nand_scan_tail(struct mtd_info *mtd)
        /* Invalidate the pagebuffer reference */
        chip->pagebuf = -1;
 
-       /* Large page NAND with SOFT_ECC should support subpage reads */
-       if ((chip->ecc.mode == NAND_ECC_SOFT) && (chip->page_shift > 9))
-               chip->options |= NAND_SUBPAGE_READ;
-
        /* Fill in remaining MTD driver data */
        mtd->type = MTD_NANDFLASH;
        mtd->flags = (chip->options & NAND_ROM) ? MTD_CAP_ROM :
-- 
1.8.3.2

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: nand: Do not automatically set SUBPAGE_READ flag
  2014-02-21 15:23 [PATCH] mtd: nand: Do not automatically set SUBPAGE_READ flag Hattink, Tjalling [FINT]
@ 2014-02-24  8:53 ` Sascha Hauer
  2014-02-24  9:20   ` Hattink, Tjalling [FINT]
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2014-02-24  8:53 UTC (permalink / raw)
  To: Hattink, Tjalling [FINT]; +Cc: barebox

Hi Tjalling,

On Fri, Feb 21, 2014 at 04:23:07PM +0100, Hattink, Tjalling [FINT] wrote:
> The default nand_read_subpage implementation returns -ENOSUPP, so if you
> use a large nand chip without a specific read_subpage implementation the
> read operations will always fail.
> 
> This functionaliy can be restored when a proper nand_read_subpage is
> implemented for the default driver.
> 
> Signed-off-by: Tjalling Hattink <t.hattink@fugro.nl>
> ---
>  drivers/mtd/nand/nand_base.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 54d8ba3..bfd695b 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -3562,10 +3562,6 @@ int nand_scan_tail(struct mtd_info *mtd)
>         /* Invalidate the pagebuffer reference */
>         chip->pagebuf = -1;
>  
> -       /* Large page NAND with SOFT_ECC should support subpage reads */
> -       if ((chip->ecc.mode == NAND_ECC_SOFT) && (chip->page_shift > 9))
> -               chip->options |= NAND_SUBPAGE_READ;
> -

Only barebox nand_read_subpage returns -ENOSUPP. The kernel has a
default implementation. Wouldn't it be possible (and better) to just
remove the return -ENOSUPP from nand_read_subpage and use the code which
we already have?

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] mtd: nand: Do not automatically set SUBPAGE_READ flag
  2014-02-24  8:53 ` Sascha Hauer
@ 2014-02-24  9:20   ` Hattink, Tjalling [FINT]
  2014-02-24  9:25     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Hattink, Tjalling [FINT] @ 2014-02-24  9:20 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

> > The default nand_read_subpage implementation returns -ENOSUPP, so if
> > you use a large nand chip without a specific read_subpage
> > implementation the read operations will always fail.
> >
> > This functionaliy can be restored when a proper nand_read_subpage is
> > implemented for the default driver.
> >
> > Signed-off-by: Tjalling Hattink <t.hattink@fugro.nl>
> > ---
> >  drivers/mtd/nand/nand_base.c | 4 ----
> >  1 file changed, 4 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/nand_base.c
> > b/drivers/mtd/nand/nand_base.c index 54d8ba3..bfd695b 100644
> > --- a/drivers/mtd/nand/nand_base.c
> > +++ b/drivers/mtd/nand/nand_base.c
> > @@ -3562,10 +3562,6 @@ int nand_scan_tail(struct mtd_info *mtd)
> >         /* Invalidate the pagebuffer reference */
> >         chip->pagebuf = -1;
> >
> > -       /* Large page NAND with SOFT_ECC should support subpage
reads
> */
> > -       if ((chip->ecc.mode == NAND_ECC_SOFT) && (chip->page_shift >
> 9))
> > -               chip->options |= NAND_SUBPAGE_READ;
> > -
> 
> Only barebox nand_read_subpage returns -ENOSUPP. The kernel has a
> default implementation. Wouldn't it be possible (and better) to just
> remove the return -ENOSUPP from nand_read_subpage and use the code
> which we already have?
> 
> Sascha
> 

Hi Sascha,

I will remove the ENOSUPP return code and compare the code with the
kernel and test it. I'll publish a new patch if I have results (which is
probably upcoming Friday).

I still wonder though why this -ENOSUPP return is added in the first
place. The motivation written above it is somewhat unclear to me:
"Currently we have no users in barebox, so disable this for now"

Kind regards,

Tjalling Hattink

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: nand: Do not automatically set SUBPAGE_READ flag
  2014-02-24  9:20   ` Hattink, Tjalling [FINT]
@ 2014-02-24  9:25     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2014-02-24  9:25 UTC (permalink / raw)
  To: Hattink, Tjalling [FINT]; +Cc: barebox

On Mon, Feb 24, 2014 at 10:20:05AM +0100, Hattink, Tjalling [FINT] wrote:
> > > The default nand_read_subpage implementation returns -ENOSUPP, so if
> > > you use a large nand chip without a specific read_subpage
> > > implementation the read operations will always fail.
> > >
> > > This functionaliy can be restored when a proper nand_read_subpage is
> > > implemented for the default driver.
> > >
> > > Signed-off-by: Tjalling Hattink <t.hattink@fugro.nl>
> > > ---
> > >  drivers/mtd/nand/nand_base.c | 4 ----
> > >  1 file changed, 4 deletions(-)
> > >
> > > diff --git a/drivers/mtd/nand/nand_base.c
> > > b/drivers/mtd/nand/nand_base.c index 54d8ba3..bfd695b 100644
> > > --- a/drivers/mtd/nand/nand_base.c
> > > +++ b/drivers/mtd/nand/nand_base.c
> > > @@ -3562,10 +3562,6 @@ int nand_scan_tail(struct mtd_info *mtd)
> > >         /* Invalidate the pagebuffer reference */
> > >         chip->pagebuf = -1;
> > >
> > > -       /* Large page NAND with SOFT_ECC should support subpage
> reads
> > */
> > > -       if ((chip->ecc.mode == NAND_ECC_SOFT) && (chip->page_shift >
> > 9))
> > > -               chip->options |= NAND_SUBPAGE_READ;
> > > -
> > 
> > Only barebox nand_read_subpage returns -ENOSUPP. The kernel has a
> > default implementation. Wouldn't it be possible (and better) to just
> > remove the return -ENOSUPP from nand_read_subpage and use the code
> > which we already have?
> > 
> > Sascha
> > 
> 
> Hi Sascha,
> 
> I will remove the ENOSUPP return code and compare the code with the
> kernel and test it. I'll publish a new patch if I have results (which is
> probably upcoming Friday).
> 
> I still wonder though why this -ENOSUPP return is added in the first
> place. The motivation written above it is somewhat unclear to me:
> "Currently we have no users in barebox, so disable this for now"

The motivation was to reduce the binary size. Should we remove the
-ENOSUPP it might be good thinking about the conditions under which we
need the code and add some Kconfig entry for it, or better use existing
ones if possible.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-24  9:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-21 15:23 [PATCH] mtd: nand: Do not automatically set SUBPAGE_READ flag Hattink, Tjalling [FINT]
2014-02-24  8:53 ` Sascha Hauer
2014-02-24  9:20   ` Hattink, Tjalling [FINT]
2014-02-24  9:25     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox