All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [patch 01/14] mtd: Flex-OneNAND support
@ 2009-05-25 10:52 apgmoorthy
  2009-05-25 11:41 ` Artem Bityutskiy
  2009-05-27 13:55 ` Artem Bityutskiy
  0 siblings, 2 replies; 36+ messages in thread
From: apgmoorthy @ 2009-05-25 10:52 UTC (permalink / raw)
  To: dedekind; +Cc: vishak.g, amul.saha, kyungmin.park, linux-mtd, akpm, dwmw2

Hi Artem , 

On Sat May 23 05:35:19 EDT 2009 dedekind@infradead.org wrote :

>I get the following warning when compile this:

>drivers/mtd/onenand/onenand_base.c:3263: warning: 'flexonenand_setup'
>defined but not used 

I tried on the MTD Git  and have seen the warning as you mentioned.
'#ifndef MODULE' around the function 'flexonenand_setup' should help to get away with that warning.
We will post a patch.

Against which Fork , the patch should be ? 

With Regards
  Moorthy

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-05-25 10:52 [patch 01/14] mtd: Flex-OneNAND support apgmoorthy
@ 2009-05-25 11:41 ` Artem Bityutskiy
  2009-05-25 12:14   ` apgmoorthy
  2009-05-27 13:55 ` Artem Bityutskiy
  1 sibling, 1 reply; 36+ messages in thread
From: Artem Bityutskiy @ 2009-05-25 11:41 UTC (permalink / raw)
  To: apgmoorthy; +Cc: vishak.g, amul.saha, kyungmin.park, linux-mtd, akpm, dwmw2

Hi,

On Mon, 2009-05-25 at 16:22 +0530, apgmoorthy wrote:
> On Sat May 23 05:35:19 EDT 2009 dedekind@infradead.org wrote :
> 
> >I get the following warning when compile this:
> 
> >drivers/mtd/onenand/onenand_base.c:3263: warning: 'flexonenand_setup'
> >defined but not used 
> 
> I tried on the MTD Git  and have seen the warning as you mentioned.
> '#ifndef MODULE' around the function 'flexonenand_setup' should help to get away with that warning.
> We will post a patch.
> 
> Against which Fork , the patch should be ? 

Dunno. Probably 2.6.30-rc7? Also, I think the loooong printk's
lines in the patch are ugly. If you could make them nicer,
it'd be cool. But whole MTD is full of printk's like this, so
I did not complain about that.

I wanted to take your patch to my l2-mtd-2.6.git tree, and then
ping dwmw2 to pull from it. But because of the warning and
these ugly printk's I decided that I will rather not do this
so far.

Also, I'm not sure about #ifndef MODULE. AFAIK, the whole
'__setup()' thing is not supposed to be used in drivers.
But I'm not sure. I'll leave this for Andrew to comment on :-)

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

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

* RE: [patch 01/14] mtd: Flex-OneNAND support
  2009-05-25 11:41 ` Artem Bityutskiy
@ 2009-05-25 12:14   ` apgmoorthy
  0 siblings, 0 replies; 36+ messages in thread
From: apgmoorthy @ 2009-05-25 12:14 UTC (permalink / raw)
  To: dedekind; +Cc: vishak.g, amul.saha, kyungmin.park, linux-mtd, akpm, dwmw2

Hi Artem,

On Monday, May 25, 2009 5:12 PM dedekind@infradead.org wrote :

>> 
>> I tried on the MTD Git  and have seen the warning as you mentioned.
>> '#ifndef MODULE' around the function 'flexonenand_setup' should help to get away with that warning.
>> We will post a patch.
>> 
>> Against which Fork , the patch should be ? 

>Dunno. Probably 2.6.30-rc7?
        - Then is it on linus-fallBack fork of MTD 2.6 Git ?
          You tried on Which Git/Fork ? 
    
> Also, I think the loooong printk's lines in the patch are ugly. If you could make them nicer, it'd be cool. 
> But whole MTD is full of printk's like this, so I did not complain about that.
        - Got your concern , but felt the printk's convey to their purpose.
 
>I wanted to take your patch to my l2-mtd-2.6.git tree, and then ping dwmw2 to pull from it. But because of the warning and these ugly printk's I decided >that I will rather not do this so far.
        
>Also, I'm not sure about #ifndef MODULE. AFAIK, the whole '__setup()' thing is not supposed to be used in drivers.     
>But I'm not sure. I'll leave this for Andrew to comment on :-)
           - OK , But this is the way we see to make the Boundary Setting User Configurable , without compiling the Kernel.

With Regards
 Moorthy
         

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-05-25 10:52 [patch 01/14] mtd: Flex-OneNAND support apgmoorthy
  2009-05-25 11:41 ` Artem Bityutskiy
@ 2009-05-27 13:55 ` Artem Bityutskiy
  2009-06-09 13:38   ` David Woodhouse
  1 sibling, 1 reply; 36+ messages in thread
From: Artem Bityutskiy @ 2009-05-27 13:55 UTC (permalink / raw)
  To: apgmoorthy; +Cc: vishak.g, amul.saha, kyungmin.park, linux-mtd, akpm, dwmw2

On Mon, 2009-05-25 at 16:22 +0530, apgmoorthy wrote:
> Hi Artem , 
> 
> On Sat May 23 05:35:19 EDT 2009 dedekind@infradead.org wrote :
> 
> >I get the following warning when compile this:
> 
> >drivers/mtd/onenand/onenand_base.c:3263: warning: 'flexonenand_setup'
> >defined but not used 
> 
> I tried on the MTD Git  and have seen the warning as you mentioned.
> '#ifndef MODULE' around the function 'flexonenand_setup' should help to get away with that warning.
> We will post a patch.

Does this mean that if I build OneNAND as a module I have no
possibility to define FlexOneNAND boundary?

Sorry if I missed the discussion, but why you cannot use something
like 'module_param_array()' ?
-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-05-27 13:55 ` Artem Bityutskiy
@ 2009-06-09 13:38   ` David Woodhouse
  2009-06-10  7:46     ` Amit Kumar Sharma
                       ` (2 more replies)
  0 siblings, 3 replies; 36+ messages in thread
From: David Woodhouse @ 2009-06-09 13:38 UTC (permalink / raw)
  To: dedekind; +Cc: vishak.g, apgmoorthy, amul.saha, kyungmin.park, linux-mtd, akpm

On Wed, 2009-05-27 at 16:55 +0300, Artem Bityutskiy wrote:
> On Mon, 2009-05-25 at 16:22 +0530, apgmoorthy wrote:
> > I tried on the MTD Git  and have seen the warning as you mentioned.
> > '#ifndef MODULE' around the function 'flexonenand_setup' should help
> > to get away with that warning.
> > We will post a patch.
> 
> Does this mean that if I build OneNAND as a module I have no
> possibility to define FlexOneNAND boundary?
> 
> Sorry if I missed the discussion, but why you cannot use something
> like 'module_param_array()' ?

That certainly seems like it would be the best answer.
Can we have a patch to do that please?

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-06-09 13:38   ` David Woodhouse
@ 2009-06-10  7:46     ` Amit Kumar Sharma
  2009-06-11  9:22     ` Amul Saha
  2009-06-11  9:23     ` Amul Saha
  2 siblings, 0 replies; 36+ messages in thread
From: Amit Kumar Sharma @ 2009-06-10  7:46 UTC (permalink / raw)
  To: David Woodhouse, dedekind
  Cc: vishak.g, apgmoorthy, amul.saha, kyungmin.park, linux-mtd, akpm

Hi David & Artem,

We will take care comments.

Thanks
Amit


----- Original Message ----- 
From: "David Woodhouse" <dwmw2@infradead.org>
To: <dedekind@infradead.org>
Cc: <vishak.g@samsung.com>; "apgmoorthy" 
<moorthy.apg@samsung.com>; <amul.saha@samsung.com>; 
<kyungmin.park@samsung.com>; 
<linux-mtd@lists.infradead.org>; <akpm@linux-foundation.org>
Sent: Tuesday, June 09, 2009 7:08 PM
Subject: Re: [patch 01/14] mtd: Flex-OneNAND support


> On Wed, 2009-05-27 at 16:55 +0300, Artem Bityutskiy wrote:
>> On Mon, 2009-05-25 at 16:22 +0530, apgmoorthy wrote:
>> > I tried on the MTD Git  and have seen the warning as 
>> > you mentioned.
>> > '#ifndef MODULE' around the function 
>> > 'flexonenand_setup' should help
>> > to get away with that warning.
>> > We will post a patch.
>>
>> Does this mean that if I build OneNAND as a module I have 
>> no
>> possibility to define FlexOneNAND boundary?
>>
>> Sorry if I missed the discussion, but why you cannot use 
>> something
>> like 'module_param_array()' ?
>
> That certainly seems like it would be the best answer.
> Can we have a patch to do that please?
>
> -- 
> David Woodhouse                            Open Source 
> Technology Centre
> David.Woodhouse@intel.com 
> Intel Corporation
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/ 

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-06-09 13:38   ` David Woodhouse
  2009-06-10  7:46     ` Amit Kumar Sharma
@ 2009-06-11  9:22     ` Amul Saha
  2009-06-11  9:23     ` Amul Saha
  2 siblings, 0 replies; 36+ messages in thread
From: Amul Saha @ 2009-06-11  9:22 UTC (permalink / raw)
  To: David Woodhouse, dedekind
  Cc: kyungmin.park, vishak.g, linux-mtd, apgmoorthy, akpm

>2009/6/9 David Woodhouse <dwmw2@infradead.org>:
>> On Wed, 2009-05-27 at 16:55 +0300, Artem Bityutskiy wrote:
>>
>> Does this mean that if I build OneNAND as a module I have no
>> possibility to define FlexOneNAND boundary?
>>
>> Sorry if I missed the discussion, but why you cannot use something
>> like 'module_param_array()' ?

We have made use of module_param for getting the parameters for Boundary
Setting.

>
> That certainly seems like it would be the best answer.

Yes, we too see that.

> Can we have a patch to do that please?

Sending the Patch, for supporting Flex-OneNAND as a module, taking Boundary setting parameters.

Regards,
Amul Kumar Saha

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-06-09 13:38   ` David Woodhouse
  2009-06-10  7:46     ` Amit Kumar Sharma
  2009-06-11  9:22     ` Amul Saha
@ 2009-06-11  9:23     ` Amul Saha
  2009-06-11  9:35       ` Artem Bityutskiy
  2 siblings, 1 reply; 36+ messages in thread
From: Amul Saha @ 2009-06-11  9:23 UTC (permalink / raw)
  To: David Woodhouse, dedekind
  Cc: kyungmin.park, vishak.g, linux-mtd, apgmoorthy, akpm

This patch now adds support for Flex-OneNAND to be used as a module,
it also supports Boundary setting at module insertion time

Signed-off-by: Amul Kumar Saha <amul.saha at samsung.com>
Signed-off-by: Vishak G <vishak.g at samsung.com>
---
 onenand_base.c |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 8d4c9c2..a91133b 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -20,6 +20,7 @@

 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
@@ -31,6 +32,18 @@

 #include <asm/io.h>

+#ifdef MODULE
+static char *flex_bdry_info;
+
+module_param(flex_bdry_info, charp, 0400);
+MODULE_PARM_DESC(flex_bdry_info, "SLC Boundary information for Flex-OneNAND"
+				 "Syntax:flex_bdry_info=DIE_BDRY,LOCK,..."
+				 "DIE_BDRY: SLC boundary of the die"
+				 "LOCK: Locking information for SLC boundary"
+				 "    : 0->Set boundary in unlocked status"
+				 "    : 1->Set boundary in locked status");
+#endif
+
 /* Default Flex-OneNAND boundary and lock respectively */
 static int flex_bdry[MAX_DIES * 2] = { -1, 0, -1, 0 };

@@ -3271,7 +3284,9 @@ static int flexonenand_setup(char *s)
 	return 1;
 }

+#ifndef MODULE
 __setup("onenand.bdry=", flexonenand_setup);
+#endif

 /**
  * onenand_probe - [OneNAND Interface] Probe the OneNAND device
@@ -3456,6 +3471,10 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
 	if (onenand_probe(mtd))
 		return -ENXIO;

+#ifdef MODULE
+	flexonenand_setup(flex_bdry_info);
+#endif
+
 	/* Set Sync. Burst Read after probing */
 	if (this->mmcontrol) {
 		printk(KERN_INFO "OneNAND Sync. Burst Read support\n");

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-06-11  9:23     ` Amul Saha
@ 2009-06-11  9:35       ` Artem Bityutskiy
  2009-06-12 10:22         ` Amul Saha
  2009-06-12 10:26         ` Amul Saha
  0 siblings, 2 replies; 36+ messages in thread
From: Artem Bityutskiy @ 2009-06-11  9:35 UTC (permalink / raw)
  To: Amul Saha
  Cc: vishak.g, apgmoorthy, kyungmin.park, linux-mtd, akpm, David Woodhouse

On Thu, 2009-06-11 at 14:53 +0530, Amul Saha wrote:
> This patch now adds support for Flex-OneNAND to be used as a module,
> it also supports Boundary setting at module insertion time
> 
> Signed-off-by: Amul Kumar Saha <amul.saha at samsung.com>
> Signed-off-by: Vishak G <vishak.g at samsung.com>
> ---
>  onenand_base.c |   19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
> index 8d4c9c2..a91133b 100644
> --- a/drivers/mtd/onenand/onenand_base.c
> +++ b/drivers/mtd/onenand/onenand_base.c
> @@ -20,6 +20,7 @@
> 
>  #include <linux/kernel.h>
>  #include <linux/module.h>
> +#include <linux/moduleparam.h>
>  #include <linux/init.h>
>  #include <linux/sched.h>
>  #include <linux/delay.h>
> @@ -31,6 +32,18 @@
> 
>  #include <asm/io.h>
> 
> +#ifdef MODULE
> +static char *flex_bdry_info;
> +
> +module_param(flex_bdry_info, charp, 0400);
> +MODULE_PARM_DESC(flex_bdry_info, "SLC Boundary information for Flex-OneNAND"
> +				 "Syntax:flex_bdry_info=DIE_BDRY,LOCK,..."
> +				 "DIE_BDRY: SLC boundary of the die"
> +				 "LOCK: Locking information for SLC boundary"
> +				 "    : 0->Set boundary in unlocked status"
> +				 "    : 1->Set boundary in locked status");
> +#endif
> +
>  /* Default Flex-OneNAND boundary and lock respectively */
>  static int flex_bdry[MAX_DIES * 2] = { -1, 0, -1, 0 };
> 
> @@ -3271,7 +3284,9 @@ static int flexonenand_setup(char *s)
>  	return 1;
>  }
> 
> +#ifndef MODULE
>  __setup("onenand.bdry=", flexonenand_setup);
> +#endif

Why you still need this? Module parameters still work if your stuff
is compiled in - you just pass the "onenand.flex_bdry_info=" kernel
parameter.

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-06-11  9:35       ` Artem Bityutskiy
@ 2009-06-12 10:22         ` Amul Saha
  2009-06-12 10:26         ` Amul Saha
  1 sibling, 0 replies; 36+ messages in thread
From: Amul Saha @ 2009-06-12 10:22 UTC (permalink / raw)
  To: dedekind
  Cc: vishak.g, apgmoorthy, kyungmin.park, linux-mtd, akpm, David Woodhouse

>> +#ifndef MODULE
>>  __setup("onenand.bdry=", flexonenand_setup);
>> +#endif
>
> Why you still need this? Module parameters still work if your stuff
> is compiled in - you just pass the "onenand.flex_bdry_info=" kernel
> parameter.
>
OK.
Sending across the updated patch.

Regards,
Amul Kumar Saha 

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-06-11  9:35       ` Artem Bityutskiy
  2009-06-12 10:22         ` Amul Saha
@ 2009-06-12 10:26         ` Amul Saha
  2009-06-12 10:42           ` Artem Bityutskiy
  1 sibling, 1 reply; 36+ messages in thread
From: Amul Saha @ 2009-06-12 10:26 UTC (permalink / raw)
  To: dedekind
  Cc: vishak.g, apgmoorthy, kyungmin.park, linux-mtd, akpm, David Woodhouse

This patch now adds support for Flex-OneNAND to be used as a module,
it also supports Boundary setting at module insertion time

Signed-off-by: Amul Kumar Saha <amul.saha at samsung.com>
Signed-off-by: Vishak G <vishak.g at samsung.com>
---
 onenand_base.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 8d4c9c2..6d2086f 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -20,6 +20,7 @@

 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
@@ -31,6 +32,16 @@

 #include <asm/io.h>

+static char *flex_bdry_info;
+
+module_param(flex_bdry_info, charp, 0400);
+MODULE_PARM_DESC(flex_bdry_info, "SLC Boundary information for Flex-OneNAND"
+				 "Syntax:flex_bdry_info=DIE_BDRY,LOCK,..."
+				 "DIE_BDRY: SLC boundary of the die"
+				 "LOCK: Locking information for SLC boundary"
+				 "    : 0->Set boundary in unlocked status"
+				 "    : 1->Set boundary in locked status");
+
 /* Default Flex-OneNAND boundary and lock respectively */
 static int flex_bdry[MAX_DIES * 2] = { -1, 0, -1, 0 };

@@ -3456,6 +3467,10 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
 	if (onenand_probe(mtd))
 		return -ENXIO;

+#ifdef MODULE
+	flexonenand_setup(flex_bdry_info);
+#endif
+
 	/* Set Sync. Burst Read after probing */
 	if (this->mmcontrol) {
 		printk(KERN_INFO "OneNAND Sync. Burst Read support\n");

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-06-12 10:26         ` Amul Saha
@ 2009-06-12 10:42           ` Artem Bityutskiy
  2009-06-12 11:57             ` Amul Saha
  0 siblings, 1 reply; 36+ messages in thread
From: Artem Bityutskiy @ 2009-06-12 10:42 UTC (permalink / raw)
  To: Amul Saha
  Cc: vishak.g, apgmoorthy, kyungmin.park, linux-mtd, akpm, David Woodhouse

On Fri, 2009-06-12 at 15:56 +0530, Amul Saha wrote:
> This patch now adds support for Flex-OneNAND to be used as a module,
> it also supports Boundary setting at module insertion time
> 
> Signed-off-by: Amul Kumar Saha <amul.saha at samsung.com>
> Signed-off-by: Vishak G <vishak.g at samsung.com>
> ---
>  onenand_base.c |   15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
> index 8d4c9c2..6d2086f 100644
> --- a/drivers/mtd/onenand/onenand_base.c
> +++ b/drivers/mtd/onenand/onenand_base.c
> @@ -20,6 +20,7 @@
> 
>  #include <linux/kernel.h>
>  #include <linux/module.h>
> +#include <linux/moduleparam.h>
>  #include <linux/init.h>
>  #include <linux/sched.h>
>  #include <linux/delay.h>
> @@ -31,6 +32,16 @@
> 
>  #include <asm/io.h>
> 
> +static char *flex_bdry_info;
> +
> +module_param(flex_bdry_info, charp, 0400);
> +MODULE_PARM_DESC(flex_bdry_info, "SLC Boundary information for Flex-OneNAND"
> +				 "Syntax:flex_bdry_info=DIE_BDRY,LOCK,..."
> +				 "DIE_BDRY: SLC boundary of the die"
> +				 "LOCK: Locking information for SLC boundary"
> +				 "    : 0->Set boundary in unlocked status"
> +				 "    : 1->Set boundary in locked status");
> +
>  /* Default Flex-OneNAND boundary and lock respectively */
>  static int flex_bdry[MAX_DIES * 2] = { -1, 0, -1, 0 };
> 
> @@ -3456,6 +3467,10 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
>  	if (onenand_probe(mtd))
>  		return -ENXIO;
> 
> +#ifdef MODULE
> +	flexonenand_setup(flex_bdry_info);
> +#endif

Why do you need this ifdef? What is the fundamental difference between
onenand.ko as a module and onenand compiled-in?

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-06-12 10:42           ` Artem Bityutskiy
@ 2009-06-12 11:57             ` Amul Saha
  2009-06-12 12:03               ` Artem Bityutskiy
  0 siblings, 1 reply; 36+ messages in thread
From: Amul Saha @ 2009-06-12 11:57 UTC (permalink / raw)
  To: dedekind
  Cc: vishak.g, apgmoorthy, kyungmin.park, linux-mtd, akpm, David Woodhouse

Hi Artem,

>> +#ifdef MODULE
>> + flexonenand_setup(flex_bdry_info);
>> +#endif
>
> Why do you need this ifdef? What is the fundamental difference between
> onenand.ko as a module and onenand compiled-in?
>

flexonenand_setup( ) need not be called, when OneNAND is built-in.
This function-call will cause overhead unwantedly on every boot, during OneNAND scan.

flexonenand_setup( ) call is needed only when it has been built as a module.

Regards,
Amul Kumar Saha 

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-06-12 11:57             ` Amul Saha
@ 2009-06-12 12:03               ` Artem Bityutskiy
  2009-06-12 12:52                 ` David Woodhouse
  2009-06-12 13:16                 ` Amul Saha
  0 siblings, 2 replies; 36+ messages in thread
From: Artem Bityutskiy @ 2009-06-12 12:03 UTC (permalink / raw)
  To: Amul Saha
  Cc: vishak.g, apgmoorthy, kyungmin.park, linux-mtd, akpm, David Woodhouse

On Fri, 2009-06-12 at 17:27 +0530, Amul Saha wrote:
> Hi Artem,
> 
> >> +#ifdef MODULE
> >> + flexonenand_setup(flex_bdry_info);
> >> +#endif
> >
> > Why do you need this ifdef? What is the fundamental difference between
> > onenand.ko as a module and onenand compiled-in?
> >
> 
> flexonenand_setup( ) need not be called, when OneNAND is built-in.
> This function-call will cause overhead unwantedly on every boot, during OneNAND scan.
> 
> flexonenand_setup( ) call is needed only when it has been built as a module.

Why?

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-06-12 12:03               ` Artem Bityutskiy
@ 2009-06-12 12:52                 ` David Woodhouse
  2009-06-12 13:16                 ` Amul Saha
  1 sibling, 0 replies; 36+ messages in thread
From: David Woodhouse @ 2009-06-12 12:52 UTC (permalink / raw)
  To: dedekind; +Cc: vishak.g, apgmoorthy, Amul Saha, kyungmin.park, linux-mtd, akpm

On Fri, 2009-06-12 at 15:03 +0300, Artem Bityutskiy wrote:
> 
> > flexonenand_setup( ) call is needed only when it has been built as a
> module.
> 
> Why?

Because they're adding a 'flex_bdry_info' module parameter which is a
string, that they then process just the same way as the original command
line option.

I think that's the wrong approach -- please use module_param_array()
instead, so it sets the contents of the flex_bdry[] array directly and
you can remove the flexonenand_setup() function completely.

Please ensure that your email addresses in the Signed-off-by: line are
correct, too. None of this 'user at domain' nonsense.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-06-12 12:03               ` Artem Bityutskiy
  2009-06-12 12:52                 ` David Woodhouse
@ 2009-06-12 13:16                 ` Amul Saha
  2009-06-12 13:32                   ` David Woodhouse
  1 sibling, 1 reply; 36+ messages in thread
From: Amul Saha @ 2009-06-12 13:16 UTC (permalink / raw)
  To: dedekind
  Cc: vishak.g, apgmoorthy, kyungmin.park, linux-mtd, akpm, David Woodhouse

>> >> +#ifdef MODULE
>> >> + flexonenand_setup(flex_bdry_info);
>> >> +#endif
>> >
>> > Why do you need this ifdef? What is the fundamental difference between
>> > onenand.ko as a module and onenand compiled-in?
>> >
>>
>> flexonenand_setup( ) need not be called, when OneNAND is built-in.
>> This function-call will cause overhead unwantedly on every boot, during OneNAND scan.
>>
>> flexonenand_setup( ) call is needed only when it has been built as a module.
>
> Why?
>

When Flex-OneNAND is built-in, the SLC boundary can be set by kernel command line.
During the boot up time, flexonenand_setup() gets invoked by kernel, on parsing the kernel
command line.

But when Flex-OneNAND is built as a module, SLC boundary information is passed as module
parameter.
So in this case flexonenand_setup() has to be called explicitly during insomd time
(module_init),  to set the desired boundary.
So without a compilation macro (#ifdef MODULE) flexonenand_setup() is invoked in onenand_scan,
even when it is built-in which is not needed.

I am not getting your point, could you please clarify?

Regards,
Amul Kumar Saha 

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-06-12 13:16                 ` Amul Saha
@ 2009-06-12 13:32                   ` David Woodhouse
  2009-06-12 13:49                     ` Amul Saha
                                       ` (2 more replies)
  0 siblings, 3 replies; 36+ messages in thread
From: David Woodhouse @ 2009-06-12 13:32 UTC (permalink / raw)
  To: Amul Saha; +Cc: vishak.g, apgmoorthy, kyungmin.park, linux-mtd, akpm

On Fri, 2009-06-12 at 18:46 +0530, Amul Saha wrote:
> >> >> +#ifdef MODULE
> >> >> + flexonenand_setup(flex_bdry_info);
> >> >> +#endif
> >> >
> >> > Why do you need this ifdef? What is the fundamental difference between
> >> > onenand.ko as a module and onenand compiled-in?
> >> >
> >>
> >> flexonenand_setup( ) need not be called, when OneNAND is built-in.
> >> This function-call will cause overhead unwantedly on every boot, during OneNAND scan.
> >>
> >> flexonenand_setup( ) call is needed only when it has been built as a module.
> >
> > Why?
> >
> 
> When Flex-OneNAND is built-in, the SLC boundary can be set by kernel command line.
> During the boot up time, flexonenand_setup() gets invoked by kernel, on parsing the kernel
> command line.
> 
> But when Flex-OneNAND is built as a module, SLC boundary information is passed as module
> parameter.
> So in this case flexonenand_setup() has to be called explicitly during insomd time
> (module_init),  to set the desired boundary.
> So without a compilation macro (#ifdef MODULE) flexonenand_setup() is invoked in onenand_scan,
> even when it is built-in which is not needed.
> 
> I am not getting your point, could you please clarify?

You can remove flexonenand_setup() and the __setup("onenand_brdy=")
completely, and use _only_ "module_param_array()". That will work both
for modules and for the built-in case.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-06-12 13:32                   ` David Woodhouse
@ 2009-06-12 13:49                     ` Amul Saha
  2009-06-16  5:54                     ` Amul Saha
       [not found]                     ` <42F6638D897B4BA7B729CBC244D9F6E4@sisodomain.com>
  2 siblings, 0 replies; 36+ messages in thread
From: Amul Saha @ 2009-06-12 13:49 UTC (permalink / raw)
  To: David Woodhouse; +Cc: vishak.g, apgmoorthy, kyungmin.park, linux-mtd, akpm

Hi David,

>
> You can remove flexonenand_setup() and the __setup("onenand_brdy=")
> completely, and use _only_ "module_param_array()". That will work both
> for modules and for the built-in case.
>

OK , Got your point.
Working towards it, will come up with the updated patch.

Regards
Amul Kumar Saha 

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

* Re: [patch 01/14] mtd: Flex-OneNAND support
  2009-06-12 13:32                   ` David Woodhouse
  2009-06-12 13:49                     ` Amul Saha
@ 2009-06-16  5:54                     ` Amul Saha
       [not found]                     ` <42F6638D897B4BA7B729CBC244D9F6E4@sisodomain.com>
  2 siblings, 0 replies; 36+ messages in thread
From: Amul Saha @ 2009-06-16  5:54 UTC (permalink / raw)
  To: David Woodhouse; +Cc: kyungmin.park, vishak.g, linux-mtd, apgmoorthy, akpm

This patch now adds support for Flex-OneNAND to be used as a module,
it also supports Boundary setting at module insertion time

Signed-off-by: Amul Kumar Saha <amul.saha@samsung.com>
Signed-off-by: Vishak G <vishak.g@samsung.com>
---
 onenand_base.c |   28 +++++++++-------------------
 1 file changed, 9 insertions(+), 19 deletions(-)

diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 8d4c9c2..5efb25b 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -20,6 +20,7 @@

 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
@@ -34,6 +35,14 @@
 /* Default Flex-OneNAND boundary and lock respectively */
 static int flex_bdry[MAX_DIES * 2] = { -1, 0, -1, 0 };

+module_param_array(flex_bdry, int, NULL, 0400);
+MODULE_PARM_DESC(flex_bdry,	"SLC Boundary information for Flex-OneNAND"
+				"Syntax:flex_bdry=DIE_BDRY,LOCK,..."
+				"DIE_BDRY: SLC boundary of the die"
+				"LOCK: Locking information for SLC boundary"
+				"    : 0->Set boundary in unlocked status"
+				"    : 1->Set boundary in locked status");
+
 /**
  *  onenand_oob_128 - oob info for Flex-Onenand with 4KB page
  *  For now, we expose only 64 out of 80 ecc bytes
@@ -3255,25 +3264,6 @@ out:
 }

 /**
- * flexonenand_setup - 	capture Flex-OneNAND boundary and lock
- * 			values  passed as kernel parameters
- * @param s	kernel parameter string
- */
-static int flexonenand_setup(char *s)
-{
-	int ints[5], i;
-
-	s = get_options(s, 5, ints);
-
-	for (i = 0; i < ints[0]; i++)
-		flex_bdry[i] = ints[i + 1];
-
-	return 1;
-}
-
-__setup("onenand.bdry=", flexonenand_setup);
-
-/**
  * onenand_probe - [OneNAND Interface] Probe the OneNAND device
  * @param mtd		MTD device structure
  *

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

* Re: MLC Support in JFFS2
       [not found]                     ` <42F6638D897B4BA7B729CBC244D9F6E4@sisodomain.com>
@ 2009-06-22 19:15                       ` David Woodhouse
  2009-06-23 12:52                         ` apgmoorthy
  2010-03-31  9:53                         ` Amul Kumar Saha
  0 siblings, 2 replies; 36+ messages in thread
From: David Woodhouse @ 2009-06-22 19:15 UTC (permalink / raw)
  To: apgmoorthy
  Cc: 'Amit Kumar Sharma', vishak.g, 'Amul Saha',
	kyungmin.park, linux-mtd

On Fri, 2009-06-19 at 12:20 +0530, apgmoorthy wrote:
> Hi David,
> 
> Currenlty , Is there a way to use JFFS2 with MLC Memories ( NOP == 1 )?
> 
> If not , Felt that any one of the following patch can be of use
> 
> 1. http://lists.infradead.org/pipermail/linux-mtd/2007-December/020047.html
>           - Which removes the Clean Marker.

There was a reason for the cleanmarker -- it saved us from using
partly-erased blocks for data. Do you have some other way to guarantee
that this won't happen?

(Sorry, I think we may have had this discussion before, but I've
forgotten the conclusion, if there was one. It was academic at the time,
since we didn't have any solution for the paired-page insanity anyway. I
was mostly just burying my head in the sand and hoping this stupid 'MLC'
crap would go away.)

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

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

* RE: MLC Support in JFFS2
  2009-06-22 19:15                       ` MLC Support in JFFS2 David Woodhouse
@ 2009-06-23 12:52                         ` apgmoorthy
  2009-06-23 13:19                           ` David Woodhouse
  2010-03-31  9:53                         ` Amul Kumar Saha
  1 sibling, 1 reply; 36+ messages in thread
From: apgmoorthy @ 2009-06-23 12:52 UTC (permalink / raw)
  To: 'David Woodhouse'
  Cc: 'Amit Kumar Sharma', vishak.g, 'Amul Saha',
	kyungmin.park, linux-mtd

Hi David,  

On Tuesday, June 23, 2009 12:45 AM David Woodhouse wrote :
 
>> If not , Felt that any one of the following patch can be of use
>> 
>> 1. http://lists.infradead.org/pipermail/linux-mtd/2007-December/020047.html
>>           - Which removes the Clean Marker.

>There was a reason for the cleanmarker -- it saved us from using partly-erased blocks for data. Do you have some other way to
guarantee that this won't 
>happen?
- How about the second One (Refer Below Links), which leaves 1page/block for Cleanmarker.
   http://lists.infradead.org/pipermail/linux-mtd/2008-September/023101.html
   http://lists.infradead.org/pipermail/linux-mtd/2008-September/023044.html 
  
>(Sorry, I think we may have had this discussion before, but I've forgotten the conclusion, if there was one. It was academic at the
time, since we didn't >have any solution for the paired-page insanity anyway. 
- Right , I dont see any detailed discussion on this regard in the list.
  

With Regards
 Moorthy

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

* RE: MLC Support in JFFS2
  2009-06-23 12:52                         ` apgmoorthy
@ 2009-06-23 13:19                           ` David Woodhouse
  2009-06-24  6:50                             ` apgmoorthy
  0 siblings, 1 reply; 36+ messages in thread
From: David Woodhouse @ 2009-06-23 13:19 UTC (permalink / raw)
  To: apgmoorthy
  Cc: 'Amit Kumar Sharma', vishak.g, 'Amul Saha',
	kyungmin.park, linux-mtd


Your mail program is behaving very strangely -- your quotes are quite
hard to read. Is there any chance you could use a better one? I've tried
to clean it up, but it tends to make your replies hard to read. Some of
your replies are lacking correct References: headers too, so the
threading is broken.

On Tue, 2009-06-23 at 18:22 +0530, apgmoorthy wrote:
> >There was a reason for the cleanmarker -- it saved us from using 
> > partly-erased blocks for data. Do you have some other way to
> > guarantee that this won't happen?
>
> - How about the second One (Refer Below Links), which leaves
> 1page/block for Cleanmarker.
> 
> http://lists.infradead.org/pipermail/linux-mtd/2008-September/023101.html   http://lists.infradead.org/pipermail/linux-mtd/2008-September/023044.html 

Using one page per block for the cleanmarker would work, but seems
wasteful. I can think of one more approach which we might take -- erase
blocks only as we need them.

So instead of erasing blocks without cleanmarker _immediately_ on
startup, we just put them on a 'to be erased' list. Whenever the
empty_list is getting short of blocks, we erase another block from the
'to be erased' list and move it to the empty list.

It does mean that if you keep rebooting over and over again, you're
probably going to increase your erase count. But with a long-lived
system, it's likely to be more efficient than the large cleanmarker?

What do you think?

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

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

* RE: MLC Support in JFFS2
  2009-06-23 13:19                           ` David Woodhouse
@ 2009-06-24  6:50                             ` apgmoorthy
  0 siblings, 0 replies; 36+ messages in thread
From: apgmoorthy @ 2009-06-24  6:50 UTC (permalink / raw)
  To: 'David Woodhouse'
  Cc: 'Amit Kumar Sharma', vishak.g, 'Amul Saha',
	kyungmin.park, linux-mtd

 
On Tuesday, June 23, 2009 6:50 PM David Woodhouse wrote:
 
> Your mail program is behaving very strangely -- your quotes are quite
> hard to read. Is there any chance you could use a better one? 

- Earlier Mailer had some issues , Now using a different one.
   
> So instead of erasing blocks without cleanmarker _immediately_ on
> startup, we just put them on a 'to be erased' list. Whenever the
> empty_list is getting short of blocks, we erase another block from the
> 'to be erased' list and move it to the empty list.
> 
> It does mean that if you keep rebooting over and over again, you're
> probably going to increase your erase count. But with a long-lived
> system, it's likely to be more efficient than the large cleanmarker?
> 
> What do you think?
> 

- Yes , the solution looks a better tradeoff.
  Will work in that direction and get a pacth.
  Later we can look into a way to optimize erase count. 

With Regards
 Moorthy

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

* Re: MLC Support in JFFS2
  2009-06-22 19:15                       ` MLC Support in JFFS2 David Woodhouse
  2009-06-23 12:52                         ` apgmoorthy
@ 2010-03-31  9:53                         ` Amul Kumar Saha
  2010-03-31 13:07                           ` massimo cirillo
  1 sibling, 1 reply; 36+ messages in thread
From: Amul Kumar Saha @ 2010-03-31  9:53 UTC (permalink / raw)
  To: David Woodhouse, linux-mtd, dedekind
  Cc: 'Amit Kumar Sharma',
	kyungmin.park, raghav.gupta, apgmoorthy, v.dalal

Hi David,

We have come up with an alternate solution to support MLC devices on JFFS2.

>>
>> Currenlty , Is there a way to use JFFS2 with MLC Memories ( NOP == 1 )?
>>
>> If not , Felt that any one of the following patch can be of use
>>
>> 1. http://lists.infradead.org/pipermail/linux-mtd/2007-December/020047.html
>>           - Which removes the Clean Marker.
>
> There was a reason for the cleanmarker -- it saved us from using
> partly-erased blocks for data. Do you have some other way to guarantee
> that this won't happen?
>
> (Sorry, I think we may have had this discussion before, but I've
> forgotten the conclusion, if there was one. It was academic at the time,
> since we didn't have any solution for the paired-page insanity anyway. I
> was mostly just burying my head in the sand and hoping this stupid 'MLC'
> crap would go away.)

New approach:-

We will have something known as the TOKEN_BLOCK.

TOKEN_BLOCK: A block used to store all the ready_to_use blocks related info.

ready_to_use blocks: These are blocks which are erased and ready to use,
 but don't have a usual CLEANMARKER on them. To save NOP for
 the 1st page of each block.

How it works:
1. Ask GC to provide a block, and use it as TOKEN_BLOCK on need basis.
2. In the provided block, we store all ready_to_use block info.
3. On remount; this info needs to be retreived.
    So, we shall make use of MAGIC_NUMBER signifying TOKEN_BLOCK,
    to identify the block containing the info.

Scan has to be modified, to identify the TOKEN_BLOCK and act accordingly.

Handling TOKEN_BLOCK
1. Make request for a block to be used as TOKEN_BLOCK.
2. List all the ready_to_use block info on the TOKEN_BLOCK contiguously.
3. Write the TOKEN_BLOCK's MAGIC_NUMBER in the OOB Area alongwith the
 ready_to_use info, in the Main Area.
4. On next update, ask GC to provide a fresh block.
5. Update this block accordingly as TOKEN_BLOCK.
6. Discard the previous TOKEN_BLOCK, and put it on dirty_list.

Let me know, about the feasibility of this design from your perspective.

This is just a base plan, and obvisouly there are a lot of things that have to be looked
into, before getting into the real imlpementation.

Regards,
Amul Kumar Saha

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

* Re: MLC Support in JFFS2
  2010-03-31  9:53                         ` Amul Kumar Saha
@ 2010-03-31 13:07                           ` massimo cirillo
  2010-04-05 11:10                             ` Amul Kumar Saha
  0 siblings, 1 reply; 36+ messages in thread
From: massimo cirillo @ 2010-03-31 13:07 UTC (permalink / raw)
  To: Amul Kumar Saha
  Cc: Amit Kumar Sharma, dedekind, apgmoorthy, kyungmin.park,
	linux-mtd, raghav.gupta, v.dalal, David Woodhouse

Hi Amul,

> 3. Write the TOKEN_BLOCK's MAGIC_NUMBER in the OOB Area alongwith the
>  ready_to_use info, in the Main Area.
I think you should protect each ready_to_use block info in the TOKEN_BLOCK
with a CRC - as it was a node of JFFS2 - against power loss corruption.

> 4. On next update, ask GC to provide a fresh block.
What do you mean ? Each time a block is erased do you
update the TOKEN_BLOCK by using a new one ?

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

* Re: MLC Support in JFFS2
  2010-03-31 13:07                           ` massimo cirillo
@ 2010-04-05 11:10                             ` Amul Kumar Saha
  2010-04-05 11:52                               ` massimo cirillo
  0 siblings, 1 reply; 36+ messages in thread
From: Amul Kumar Saha @ 2010-04-05 11:10 UTC (permalink / raw)
  To: massimo cirillo
  Cc: Amit Kumar Sharma, dedekind, kyungmin.park, apgmoorthy,
	linux-mtd, raghav.gupta, v.dalal, David Woodhouse

Hi,

>> 3. Write the TOKEN_BLOCK's MAGIC_NUMBER in the OOB Area alongwith the
>>  ready_to_use info, in the Main Area.
> I think you should protect each ready_to_use block info in the TOKEN_BLOCK
> with a CRC - as it was a node of JFFS2 - against power loss corruption.
>

Sure, I'll take that into account.

>> 4. On next update, ask GC to provide a fresh block.
> What do you mean ? Each time a block is erased do you
> update the TOKEN_BLOCK by using a new one ?
>

No.
That would be done only during a proper unmount or idle time.
As this block just contains ready_to_use block info,
that can be reconstructed, on remount.
Because any updation on fixed intervals will not be of use.
Neither will it be feasbale to update the TOKEN_BLOCK on every erase.
Please do comment.

Regards,
Amul 

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

* Re: MLC Support in JFFS2
  2010-04-05 11:10                             ` Amul Kumar Saha
@ 2010-04-05 11:52                               ` massimo cirillo
  2010-04-09  9:21                                 ` Amul Kumar Saha
  0 siblings, 1 reply; 36+ messages in thread
From: massimo cirillo @ 2010-04-05 11:52 UTC (permalink / raw)
  To: Amul Kumar Saha
  Cc: Amit Kumar Sharma, dedekind, kyungmin.park, apgmoorthy,
	linux-mtd, raghav.gupta, v.dalal, David Woodhouse

Ok,
but at the remount how do you verify if the TOKEN_BLOCK
is updated or not (in case of power loss) ? I suggest using
a commit mark (one page wasted) at the end of the update
procedure.
So you'll have in the TOKEN_BLOCK the following layout:

MAGIC_NUMBER of the TOKEN_BLOCK
ready_to_use info
commit mark

What do you think ?

2010/4/5 Amul Kumar Saha <amul.saha@samsung.com>:
> Hi,
>
>>> 3. Write the TOKEN_BLOCK's MAGIC_NUMBER in the OOB Area alongwith the
>>>  ready_to_use info, in the Main Area.
>> I think you should protect each ready_to_use block info in the TOKEN_BLOCK
>> with a CRC - as it was a node of JFFS2 - against power loss corruption.
>>
>
> Sure, I'll take that into account.
>
>>> 4. On next update, ask GC to provide a fresh block.
>> What do you mean ? Each time a block is erased do you
>> update the TOKEN_BLOCK by using a new one ?
>>
>
> No.
> That would be done only during a proper unmount or idle time.
> As this block just contains ready_to_use block info,
> that can be reconstructed, on remount.
> Because any updation on fixed intervals will not be of use.
> Neither will it be feasbale to update the TOKEN_BLOCK on every erase.
> Please do comment.
>
> Regards,
> Amul
>
>
>

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

* Re: MLC Support in JFFS2
  2010-04-05 11:52                               ` massimo cirillo
@ 2010-04-09  9:21                                 ` Amul Kumar Saha
  2010-04-13  9:45                                   ` massimo cirillo
  0 siblings, 1 reply; 36+ messages in thread
From: Amul Kumar Saha @ 2010-04-09  9:21 UTC (permalink / raw)
  To: massimo cirillo
  Cc: Amit Kumar Sharma, dedekind, apgmoorthy, kyungmin.park,
	linux-mtd, raghav.gupta, v.dalal, David Woodhouse

Hi,


>Ok,
>but at the remount how do you verify if the TOKEN_BLOCK
>is updated or not (in case of power loss) ? I suggest using
>a commit mark (one page wasted) at the end of the update
>procedure.
>So you'll have in the TOKEN_BLOCK the following layout:
>
>MAGIC_NUMBER of the TOKEN_BLOCK
>ready_to_use info
>commit mark
>
>What do you think ?
>

Yes.
However, the TOKEN_BLOCK update would then
only be limited to mount and unmount.
As writing a commit mark while the system is still running,
would validate an invalid block on abrupt power-off.

Regards,
Amul 

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

* Re: MLC Support in JFFS2
  2010-04-09  9:21                                 ` Amul Kumar Saha
@ 2010-04-13  9:45                                   ` massimo cirillo
       [not found]                                     ` <D4189C368A9B4BD986B7B98A0F05953B@sisodomain.com>
  0 siblings, 1 reply; 36+ messages in thread
From: massimo cirillo @ 2010-04-13  9:45 UTC (permalink / raw)
  To: Amul Kumar Saha
  Cc: Amit Kumar Sharma, dedekind, apgmoorthy, kyungmin.park,
	linux-mtd, raghav.gupta, v.dalal, David Woodhouse

Hi,
I agree with you, and the following is my thinking.
Let's suppose we have a flash with 2KB page, 128KB block,
4096 blocks (512MB as size of the flash).
The cleanmarker would take one page for every block, so the
wasted space is 2KB*4096=8MB. Instead if we put the erased
info in a single block (TOKEN_BLOCK) we waste only 128KB.
But we need to consider the overhead in the management of
such a block. We need to store information for 4096 blocks,
for example an array of 4096 bit (1=erased, 0=not erased),
protected by ECC (against read error) and CRC (against
power loss in writing the array on the block). We need 2 pages
for each instance of the array. The question is: how often do we
need to update this array? If we choose to update each time it is
needed (that is when a block is  just erased and just before a block
is taken from the free list), at the 32nd update we should erase the
TOKEN_BLOCK and allocate a new one. IMO this overhead is
unacceptable in terms of time performance. So we update the info
only at the unmount and when the system is idle.
Moreover, there is the problem of power loss between two updates:
how to recognize at the mount that the array info is updated? In my
opinion the solution is to write an invalidation mark (one page with
all zeros) just after the instance of the array when the instance
becomes invalid.

Bye

2010/4/9 Amul Kumar Saha <amul.saha@samsung.com>:
> Hi,
>
>
>>Ok,
>>but at the remount how do you verify if the TOKEN_BLOCK
>>is updated or not (in case of power loss) ? I suggest using
>>a commit mark (one page wasted) at the end of the update
>>procedure.
>>So you'll have in the TOKEN_BLOCK the following layout:
>>
>>MAGIC_NUMBER of the TOKEN_BLOCK
>>ready_to_use info
>>commit mark
>>
>>What do you think ?
>>
>
> Yes.
> However, the TOKEN_BLOCK update would then
> only be limited to mount and unmount.
> As writing a commit mark while the system is still running,
> would validate an invalid block on abrupt power-off.
>
> Regards,
> Amul
>
>
>

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

* Re: MLC Support in JFFS2
       [not found]                                     ` <D4189C368A9B4BD986B7B98A0F05953B@sisodomain.com>
@ 2010-04-15 21:03                                       ` massimo cirillo
  2010-04-15 21:26                                         ` massimo cirillo
  0 siblings, 1 reply; 36+ messages in thread
From: massimo cirillo @ 2010-04-15 21:03 UTC (permalink / raw)
  To: Raghav Gupta
  Cc: Amit Kumar Sharma, dedekind, apgmoorthy, Amul Kumar Saha,
	kyungmin.park, linux-mtd, raghav.gupta, v.dalal, David Woodhouse

yes,
the update only at the unmount and the usage of the commit
mark are ok for me.

2010/4/15 Raghav Gupta <raghav.gupta@partner.samsung.com>:
> Resending it due to formatting issues. My bad.
>
> Hi,
>
>> I agree with you, and the following is my thinking.
>> Let's suppose we have a flash with 2KB page, 128KB block,
>> 4096 blocks (512MB as size of the flash).
>> The cleanmarker would take one page for every block, so the
>> wasted space is 2KB*4096=8MB. Instead if we put the erased
>> info in a single block (TOKEN_BLOCK) we waste only 128KB.
>> But we need to consider the overhead in the management of
>> such a block. We need to store information for 4096 blocks,
>> for example an array of 4096 bit (1=erased, 0=not erased),
>> protected by ECC (against read error) and CRC (against
>> power loss in writing the array on the block). We need 2 pages
>> for each instance of the array. The question is: how often do we
>> need to update this array? If we choose to update each time it is
>> needed (that is when a block is  just erased and just before a block
>> is taken from the free list), at the 32nd update we should erase the
>> TOKEN_BLOCK and allocate a new one. IMO this overhead is
>> unacceptable in terms of time performance. So we update the info
>> only at the unmount and when the system is idle.
>> Moreover, there is the problem of power loss between two updates:
>> how to recognize at the mount that the array info is updated? In my
>> opinion the solution is to write an invalidation mark (one page with
>> all zeros) just after the instance of the array when the instance
>> becomes invalid.
>
>
> Yes, I agree with you. The overhead involved in updating the token block
> on every change in the "ready_to_use" list is unacceptable.
> So, we can update the TOKEN_BLOCK only at unmount.
>
> Also we can authenticate that the TOKEN_BLOCK as valid
> by using a "valid/invalid flag"(commit mark)
>
> And to guard against reading of an older version of
> a TOKEN_BLOCK (on power failure) as valid by immediately
> deleting the block on retrieval of the 'ready_to_use' list.
>
> Regards,
> Raghav Gupta
>
>
>

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

* Re: MLC Support in JFFS2
  2010-04-15 21:03                                       ` massimo cirillo
@ 2010-04-15 21:26                                         ` massimo cirillo
  0 siblings, 0 replies; 36+ messages in thread
From: massimo cirillo @ 2010-04-15 21:26 UTC (permalink / raw)
  To: Raghav Gupta
  Cc: Amit Kumar Sharma, dedekind, apgmoorthy, Amul Kumar Saha,
	kyungmin.park, linux-mtd, raghav.gupta, v.dalal, David Woodhouse

Resending the message due to a Mail Delivery
error returned by raghav.gupta@partner.samsung.com.

2010/4/15 massimo cirillo <maxcir@gmail.com>:
> yes,
> the update only at the unmount and the usage of the commit
> mark are ok for me.
>
> 2010/4/15 Raghav Gupta <raghav.gupta@partner.samsung.com>:
>> Resending it due to formatting issues. My bad.
>>
>> Hi,
>>
>>> I agree with you, and the following is my thinking.
>>> Let's suppose we have a flash with 2KB page, 128KB block,
>>> 4096 blocks (512MB as size of the flash).
>>> The cleanmarker would take one page for every block, so the
>>> wasted space is 2KB*4096=8MB. Instead if we put the erased
>>> info in a single block (TOKEN_BLOCK) we waste only 128KB.
>>> But we need to consider the overhead in the management of
>>> such a block. We need to store information for 4096 blocks,
>>> for example an array of 4096 bit (1=erased, 0=not erased),
>>> protected by ECC (against read error) and CRC (against
>>> power loss in writing the array on the block). We need 2 pages
>>> for each instance of the array. The question is: how often do we
>>> need to update this array? If we choose to update each time it is
>>> needed (that is when a block is  just erased and just before a block
>>> is taken from the free list), at the 32nd update we should erase the
>>> TOKEN_BLOCK and allocate a new one. IMO this overhead is
>>> unacceptable in terms of time performance. So we update the info
>>> only at the unmount and when the system is idle.
>>> Moreover, there is the problem of power loss between two updates:
>>> how to recognize at the mount that the array info is updated? In my
>>> opinion the solution is to write an invalidation mark (one page with
>>> all zeros) just after the instance of the array when the instance
>>> becomes invalid.
>>
>>
>> Yes, I agree with you. The overhead involved in updating the token block
>> on every change in the "ready_to_use" list is unacceptable.
>> So, we can update the TOKEN_BLOCK only at unmount.
>>
>> Also we can authenticate that the TOKEN_BLOCK as valid
>> by using a "valid/invalid flag"(commit mark)
>>
>> And to guard against reading of an older version of
>> a TOKEN_BLOCK (on power failure) as valid by immediately
>> deleting the block on retrieval of the 'ready_to_use' list.
>>
>> Regards,
>> Raghav Gupta
>>
>>
>>
>

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

* RE: MLC Support in JFFS2
  2009-06-22 13:33   ` apgmoorthy
@ 2009-06-22 13:41     ` Artem Bityutskiy
  0 siblings, 0 replies; 36+ messages in thread
From: Artem Bityutskiy @ 2009-06-22 13:41 UTC (permalink / raw)
  To: apgmoorthy
  Cc: 'Amit Kumar Sharma', vishak.g, 'Artem Bityutskiy',
	'Amul Saha',
	kyungmin.park, linux-mtd, 'David Woodhouse'

On Mon, 2009-06-22 at 19:03 +0530, apgmoorthy wrote:
> Yes it do that .
> There are two things in Handling MLCs
> 1.Paired Page Handling
> This is done in Flex-OneNAND Driver.
> flexonenand_lsb_page_recovery will handle that in MLC area. 

Ah, ok you do this at the driver level - good.

> 2.NOP==1
> This scenario has to be dealt in synchronization with JFFS2.
> This is what i asked about. 
> Pathces , in the links(above)are addressing this.

OK, I see.

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

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

* RE: MLC Support in JFFS2
  2009-06-22  7:47 ` Artem Bityutskiy
@ 2009-06-22 13:33   ` apgmoorthy
  2009-06-22 13:41     ` Artem Bityutskiy
  0 siblings, 1 reply; 36+ messages in thread
From: apgmoorthy @ 2009-06-22 13:33 UTC (permalink / raw)
  To: 'Artem Bityutskiy'
  Cc: 'Amit Kumar Sharma', vishak.g, 'Amul Saha',
	kyungmin.park, linux-mtd, 'David Woodhouse'

Hi Artem ,  

On Monday, June 22, 2009 1:18 PM Artem Bityutskiy wrote :
 
>> Currenlty , Is there a way to use JFFS2 with MLC Memories ?
>> 
>> If not , Felt that any one of the following patch can be of use
>> 
>> 1. http://lists.infradead.org/pipermail/linux-mtd/2007-December/020047.html
>>           - Which removes the Clean Marker.
>> 
>> 2. http://lists.infradead.org/pipermail/linux-mtd/2008-September/023101.html
>>    http://lists.infradead.org/pipermail/linux-mtd/2008-September/023044.html 
>>           - Leaving 1page/Block , for Clean Marker.
>> 
>> or some other solution, which solves the standoff.   
>> 
>> Without MLC Support , Flex-OneNAND is unsuable with JFFS2.

>Is JFFS2 usable with Flex-OneNAND by design? I thought it would have to be able to handle paired pages to become MLC-compatible. Does it do that?

Yes it do that .
There are two things in Handling MLCs
1.Paired Page Handling
This is done in Flex-OneNAND Driver.
flexonenand_lsb_page_recovery will handle that in MLC area. 

2.NOP==1
This scenario has to be dealt in synchronization with JFFS2.
This is what i asked about. 
Pathces , in the links(above)are addressing this.

With Regards
 Moorthy

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

* Re: MLC Support in JFFS2
  2009-06-22  5:56 apgmoorthy
@ 2009-06-22  7:47 ` Artem Bityutskiy
  2009-06-22 13:33   ` apgmoorthy
  0 siblings, 1 reply; 36+ messages in thread
From: Artem Bityutskiy @ 2009-06-22  7:47 UTC (permalink / raw)
  To: apgmoorthy
  Cc: 'Amit Kumar Sharma', vishak.g, 'Amul Saha',
	kyungmin.park, linux-mtd, 'David Woodhouse'

apgmoorthy wrote:
> Hi David,
> 
> Currenlty , Is there a way to use JFFS2 with MLC Memories ?
> 
> If not , Felt that any one of the following patch can be of use
> 
> 1. http://lists.infradead.org/pipermail/linux-mtd/2007-December/020047.html
>           - Which removes the Clean Marker.
> 
> 2. http://lists.infradead.org/pipermail/linux-mtd/2008-September/023101.html
>    http://lists.infradead.org/pipermail/linux-mtd/2008-September/023044.html 
>           - Leaving 1page/Block , for Clean Marker.
> 
> or some other solution, which solves the standoff.   
> 
> Without MLC Support , Flex-OneNAND is unsuable with JFFS2.

Is JFFS2 usable with Flex-OneNAND by design? I thought it would have
to be able to handle paired pages to become MLC-compatible. Does it
do that?

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

* MLC Support in JFFS2
@ 2009-06-22  5:56 apgmoorthy
  2009-06-22  7:47 ` Artem Bityutskiy
  0 siblings, 1 reply; 36+ messages in thread
From: apgmoorthy @ 2009-06-22  5:56 UTC (permalink / raw)
  To: 'David Woodhouse'
  Cc: 'Amit Kumar Sharma', vishak.g, 'Amul Saha',
	kyungmin.park, linux-mtd

Hi David,

Currenlty , Is there a way to use JFFS2 with MLC Memories ?

If not , Felt that any one of the following patch can be of use

1. http://lists.infradead.org/pipermail/linux-mtd/2007-December/020047.html
          - Which removes the Clean Marker.

2. http://lists.infradead.org/pipermail/linux-mtd/2008-September/023101.html
   http://lists.infradead.org/pipermail/linux-mtd/2008-September/023044.html 
          - Leaving 1page/Block , for Clean Marker.

or some other solution, which solves the standoff.   

Without MLC Support , Flex-OneNAND is unsuable with JFFS2.

With Regards
  Moorthy

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

* MLC Support in JFFS2
@ 2007-11-23 15:39 payagond
  0 siblings, 0 replies; 36+ messages in thread
From: payagond @ 2007-11-23 15:39 UTC (permalink / raw)
  To: linux-mtd



Hello,



Which is the better way for MLC support in JFFS2?

Is it removing the CLEANMARKER or

reserving the first page of every block for it



If I am using the 2nd option ie., reserving a page in every block -

What else I have to take care of, other than jeb->freesize and 
jeb->used_size?



regards

payagond


________________________________________________________________________
Email and AIM finally together. You've gotta check out free AOL Mail! - 
http://mail.aol.com

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

end of thread, other threads:[~2010-04-15 21:26 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-25 10:52 [patch 01/14] mtd: Flex-OneNAND support apgmoorthy
2009-05-25 11:41 ` Artem Bityutskiy
2009-05-25 12:14   ` apgmoorthy
2009-05-27 13:55 ` Artem Bityutskiy
2009-06-09 13:38   ` David Woodhouse
2009-06-10  7:46     ` Amit Kumar Sharma
2009-06-11  9:22     ` Amul Saha
2009-06-11  9:23     ` Amul Saha
2009-06-11  9:35       ` Artem Bityutskiy
2009-06-12 10:22         ` Amul Saha
2009-06-12 10:26         ` Amul Saha
2009-06-12 10:42           ` Artem Bityutskiy
2009-06-12 11:57             ` Amul Saha
2009-06-12 12:03               ` Artem Bityutskiy
2009-06-12 12:52                 ` David Woodhouse
2009-06-12 13:16                 ` Amul Saha
2009-06-12 13:32                   ` David Woodhouse
2009-06-12 13:49                     ` Amul Saha
2009-06-16  5:54                     ` Amul Saha
     [not found]                     ` <42F6638D897B4BA7B729CBC244D9F6E4@sisodomain.com>
2009-06-22 19:15                       ` MLC Support in JFFS2 David Woodhouse
2009-06-23 12:52                         ` apgmoorthy
2009-06-23 13:19                           ` David Woodhouse
2009-06-24  6:50                             ` apgmoorthy
2010-03-31  9:53                         ` Amul Kumar Saha
2010-03-31 13:07                           ` massimo cirillo
2010-04-05 11:10                             ` Amul Kumar Saha
2010-04-05 11:52                               ` massimo cirillo
2010-04-09  9:21                                 ` Amul Kumar Saha
2010-04-13  9:45                                   ` massimo cirillo
     [not found]                                     ` <D4189C368A9B4BD986B7B98A0F05953B@sisodomain.com>
2010-04-15 21:03                                       ` massimo cirillo
2010-04-15 21:26                                         ` massimo cirillo
  -- strict thread matches above, loose matches on Subject: below --
2009-06-22  5:56 apgmoorthy
2009-06-22  7:47 ` Artem Bityutskiy
2009-06-22 13:33   ` apgmoorthy
2009-06-22 13:41     ` Artem Bityutskiy
2007-11-23 15:39 payagond

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.