mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: disable subpage reads
@ 2014-03-03  7:50 Sascha Hauer
  2014-03-03  8:15 ` Hattink, Tjalling [FINT]
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2014-03-03  7:50 UTC (permalink / raw)
  To: barebox; +Cc: Hattink, Tjalling [FINT]

The default nand_read_subpage implementation returns -ENOSUPP, so we have
to make sure that barebox never uses this implementation. By setting the
NAND_SUBPAGE_READ flag to 0x0 we ensure NAND_HAS_SUBPAGE_READ() never returns
true and also give the compiler a chance to optimize away some unused code.

subpage reads are a rather exotic feature even in Linux. It is only used on
largepage NANDs with soft ecc. Even if we have this case it needs non page
aligned reads to actually profit from this feature.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Hattink, Tjalling [FINT] <T.Hattink@fugro.nl>
---

Hi Tjalling,
I had a closer look at the subpage read stuff and saw that this
is really an exotic feature that even if we could support it doesn't
help very much. So I decided to go back to a variant of your first
patch: Fix subpage reads by disabling them completely.


 include/linux/mtd/nand.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 74ea0b4..3c7509f 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -162,7 +162,8 @@ typedef enum {
 #define NAND_ROM		0x00000800
 
 /* Device supports subpage reads */
-#define NAND_SUBPAGE_READ	0x00001000
+/* Disabled in barebox for smaller binary sizes */
+#define NAND_SUBPAGE_READ	(__BAREBOX__ ? 0x0 : 0x00001000)
 
 /* Options valid for Samsung large page devices */
 #define NAND_SAMSUNG_LP_OPTIONS NAND_CACHEPRG
-- 
1.8.5.3


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

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

* RE: [PATCH] mtd: nand: disable subpage reads
  2014-03-03  7:50 [PATCH] mtd: nand: disable subpage reads Sascha Hauer
@ 2014-03-03  8:15 ` Hattink, Tjalling [FINT]
  0 siblings, 0 replies; 2+ messages in thread
From: Hattink, Tjalling [FINT] @ 2014-03-03  8:15 UTC (permalink / raw)
  To: barebox

> -----Original Message-----
> From: Sascha Hauer [mailto:s.hauer@pengutronix.de]
> Sent: Monday, March 03, 2014 08:50
> To: barebox@lists.infradead.org
> Cc: Sascha Hauer; Hattink, Tjalling [FINT]
> Subject: [PATCH] mtd: nand: disable subpage reads
> 
> The default nand_read_subpage implementation returns -ENOSUPP, so we
> have to make sure that barebox never uses this implementation. By
> setting the NAND_SUBPAGE_READ flag to 0x0 we ensure
> NAND_HAS_SUBPAGE_READ() never returns true and also give the compiler
a
> chance to optimize away some unused code.
> 
> subpage reads are a rather exotic feature even in Linux. It is only
> used on largepage NANDs with soft ecc. Even if we have this case it
> needs non page aligned reads to actually profit from this feature.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Hattink, Tjalling [FINT] <T.Hattink@fugro.nl>
> ---
> 
> Hi Tjalling,
> I had a closer look at the subpage read stuff and saw that this is
> really an exotic feature that even if we could support it doesn't help
> very much. So I decided to go back to a variant of your first
> patch: Fix subpage reads by disabling them completely.
> 
> 
>  include/linux/mtd/nand.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index
> 74ea0b4..3c7509f 100644
> --- a/include/linux/mtd/nand.h
> +++ b/include/linux/mtd/nand.h
> @@ -162,7 +162,8 @@ typedef enum {
>  #define NAND_ROM		0x00000800
> 
>  /* Device supports subpage reads */
> -#define NAND_SUBPAGE_READ	0x00001000
> +/* Disabled in barebox for smaller binary sizes */
> +#define NAND_SUBPAGE_READ	(__BAREBOX__ ? 0x0 : 0x00001000)
> 
>  /* Options valid for Samsung large page devices */  #define
> NAND_SAMSUNG_LP_OPTIONS NAND_CACHEPRG
> --
> 1.8.5.3

Hi Sascha,

I don't think it matters much either when subpage read is disabled.
Barebox will not do heavy read operations on the nand so the subpage
support will not do much.

Thanks for resolving this bug,

Tjalling

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

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

end of thread, other threads:[~2014-03-03  8:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-03  7:50 [PATCH] mtd: nand: disable subpage reads Sascha Hauer
2014-03-03  8:15 ` Hattink, Tjalling [FINT]

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