linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug in MTD NAND ONFI chipsize detection
@ 2011-05-11 16:25 Nitin Garg
  2011-05-12  1:33 ` Andrew Morton
  0 siblings, 1 reply; 11+ messages in thread
From: Nitin Garg @ 2011-05-11 16:25 UTC (permalink / raw)
  To: linux-kernel

Hi All,

The nand_flash_detect_onfi function in mtd/nand detects the NAND flash
device size using the ONFI parameters:
	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;

The lun_count is not taken into consideration due to which we detect
wrong size for Micron MT29F8G08ADADAH4 as it has 2 logical units.

We should change the chipsize calculation to:
	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) *
(uint64_t)le32_to_cpu(p->lun_count) * mtd->erasesize;

Pls suggest.

Regards,
Nitin Garg

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

* Re: Bug in MTD NAND ONFI chipsize detection
  2011-05-11 16:25 Bug in MTD NAND ONFI chipsize detection Nitin Garg
@ 2011-05-12  1:33 ` Andrew Morton
  2011-05-12  6:54   ` Nitin Garg
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Morton @ 2011-05-12  1:33 UTC (permalink / raw)
  To: Nitin Garg; +Cc: linux-kernel, David Woodhouse, linux-mtd

On Wed, 11 May 2011 11:25:22 -0500 Nitin Garg <nitingarg98@gmail.com> wrote:

> Hi All,
> 
> The nand_flash_detect_onfi function in mtd/nand detects the NAND flash
> device size using the ONFI parameters:
> 	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
> 
> The lun_count is not taken into consideration due to which we detect
> wrong size for Micron MT29F8G08ADADAH4 as it has 2 logical units.
> 
> We should change the chipsize calculation to:
> 	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) *
> (uint64_t)le32_to_cpu(p->lun_count) * mtd->erasesize;
> 
> Pls suggest.
> 

Please send a tested, changelogged patch to fix it.  Be sure to cc the
relevant maintainer and mailing list.

Thanks.

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

* Re: Bug in MTD NAND ONFI chipsize detection
  2011-05-12  1:33 ` Andrew Morton
@ 2011-05-12  6:54   ` Nitin Garg
  2011-05-12  7:05     ` Nitin Garg
  0 siblings, 1 reply; 11+ messages in thread
From: Nitin Garg @ 2011-05-12  6:54 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, David Woodhouse, linux-mtd

[-- Attachment #1: Type: text/plain, Size: 2089 bytes --]

Here is the tested patch, pls apply.

Regards,
Nitin Garg

>From 1a73f1c3d066a491d0c806883788ab9abdc736f3 Mon Sep 17 00:00:00 2001
From: Nitin Garg <nitingarg98@gmail.com>
Date: Thu, 12 May 2011 01:31:53 -0500
Subject: [PATCH] Fix ONFI NAND flash size detection by using number of
Logical Units in device


Signed-off-by: Nitin Garg <nitingarg98@gmail.com>
---
 drivers/mtd/nand/nand_base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index c54a4cb..cdf6015 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2892,7 +2892,7 @@ static int nand_flash_detect_onfi(struct
mtd_info *mtd, struct nand_chip *chip,
 	mtd->writesize = le32_to_cpu(p->byte_per_page);
 	mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
 	mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
-	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
+	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) *
le32_to_cpu(p->lun_count) * mtd->erasesize;
 	busw = 0;
 	if (le16_to_cpu(p->features) & 1)
 		busw = NAND_BUSWIDTH_16;
-- 
1.5.5.6



On Wed, May 11, 2011 at 8:33 PM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Wed, 11 May 2011 11:25:22 -0500 Nitin Garg <nitingarg98@gmail.com> wrote:
>
>> Hi All,
>>
>> The nand_flash_detect_onfi function in mtd/nand detects the NAND flash
>> device size using the ONFI parameters:
>>       chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
>>
>> The lun_count is not taken into consideration due to which we detect
>> wrong size for Micron MT29F8G08ADADAH4 as it has 2 logical units.
>>
>> We should change the chipsize calculation to:
>>       chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) *
>> (uint64_t)le32_to_cpu(p->lun_count) * mtd->erasesize;
>>
>> Pls suggest.
>>
>
> Please send a tested, changelogged patch to fix it.  Be sure to cc the
> relevant maintainer and mailing list.
>
> Thanks.
>

[-- Attachment #2: 0001-Fix-ONFI-NAND-flash-size-detection-by-using-number-o.patch --]
[-- Type: application/octet-stream, Size: 1114 bytes --]

From 1a73f1c3d066a491d0c806883788ab9abdc736f3 Mon Sep 17 00:00:00 2001
From: Nitin Garg <nitingarg98@gmail.com>
Date: Thu, 12 May 2011 01:31:53 -0500
Subject: [PATCH] Fix ONFI NAND flash size detection by using number of Logical Units in device


Signed-off-by: Nitin Garg <nitingarg98@gmail.com>
---
 drivers/mtd/nand/nand_base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index c54a4cb..cdf6015 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2892,7 +2892,7 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
 	mtd->writesize = le32_to_cpu(p->byte_per_page);
 	mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
 	mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
-	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
+	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * le32_to_cpu(p->lun_count) * mtd->erasesize;
 	busw = 0;
 	if (le16_to_cpu(p->features) & 1)
 		busw = NAND_BUSWIDTH_16;
-- 
1.5.5.6


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

* Re: Bug in MTD NAND ONFI chipsize detection
  2011-05-12  6:54   ` Nitin Garg
@ 2011-05-12  7:05     ` Nitin Garg
  2011-05-12  7:16       ` Nitin Garg
  0 siblings, 1 reply; 11+ messages in thread
From: Nitin Garg @ 2011-05-12  7:05 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, David Woodhouse, linux-mtd

Here is the tested patch, pls apply.

>From 1a73f1c3d066a491d0c806883788ab9abdc736f3 Mon Sep 17 00:00:00 2001
From: Nitin Garg <nitingarg98@gmail.com>
Date: Thu, 12 May 2011 01:31:53 -0500
Subject: [PATCH] Fix ONFI NAND flash size detection by using number of
Logical Units in device

Signed-off-by: Nitin Garg <nitingarg98@gmail.com>
---
 drivers/mtd/nand/nand_base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index c54a4cb..cdf6015 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2892,7 +2892,7 @@ static int nand_flash_detect_onfi(struct
mtd_info *mtd, struct nand_chip *chip,
       mtd->writesize = le32_to_cpu(p->byte_per_page);
       mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
       mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
-       chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) *
mtd->erasesize;
+       chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) *
le32_to_cpu(p->lun_count) * mtd->erasesize;
       busw = 0;
       if (le16_to_cpu(p->features) & 1)
               busw = NAND_BUSWIDTH_16;
--
1.5.5.6

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

* Re: Bug in MTD NAND ONFI chipsize detection
  2011-05-12  7:05     ` Nitin Garg
@ 2011-05-12  7:16       ` Nitin Garg
  2011-05-12  7:47         ` Matthieu CASTET
  0 siblings, 1 reply; 11+ messages in thread
From: Nitin Garg @ 2011-05-12  7:16 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, David Woodhouse, linux-mtd

Why isn't my patch going through? re-sending again,

Signed-off-by: Nitin Garg <nitingarg98@xxxxxxxx>
---
 drivers/mtd/nand/nand_base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index c54a4cb..cdf6015 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2892,7 +2892,7 @@ static int nand_flash_detect_onfi(struct
mtd_info *mtd, struct nand_chip *chip,
 	mtd->writesize = le32_to_cpu(p->byte_per_page);
 	mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
 	mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
-	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
+	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) *
le32_to_cpu(p->lun_count) * mtd->erasesize;
 	busw = 0;
 	if (le16_to_cpu(p->features) & 1)
 		busw = NAND_BUSWIDTH_16;
-- 
1.5.5.6



On Thu, May 12, 2011 at 2:05 AM, Nitin Garg <nitingarg98@gmail.com> wrote:
> Here is the tested patch, pls apply.
>
> From 1a73f1c3d066a491d0c806883788ab9abdc736f3 Mon Sep 17 00:00:00 2001
> From: Nitin Garg <nitingarg98@gmail.com>
> Date: Thu, 12 May 2011 01:31:53 -0500
> Subject: [PATCH] Fix ONFI NAND flash size detection by using number of
> Logical Units in device
>
> Signed-off-by: Nitin Garg <nitingarg98@gmail.com>
> ---
>  drivers/mtd/nand/nand_base.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index c54a4cb..cdf6015 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -2892,7 +2892,7 @@ static int nand_flash_detect_onfi(struct
> mtd_info *mtd, struct nand_chip *chip,
>        mtd->writesize = le32_to_cpu(p->byte_per_page);
>        mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
>        mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
> -       chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) *
> mtd->erasesize;
> +       chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) *
> le32_to_cpu(p->lun_count) * mtd->erasesize;
>        busw = 0;
>        if (le16_to_cpu(p->features) & 1)
>                busw = NAND_BUSWIDTH_16;
> --
> 1.5.5.6
>

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

* Re: Bug in MTD NAND ONFI chipsize detection
  2011-05-12  7:16       ` Nitin Garg
@ 2011-05-12  7:47         ` Matthieu CASTET
  2011-05-12 12:34           ` Nitin Garg
  0 siblings, 1 reply; 11+ messages in thread
From: Matthieu CASTET @ 2011-05-12  7:47 UTC (permalink / raw)
  To: Nitin Garg; +Cc: Andrew Morton, linux-mtd, David Woodhouse, linux-kernel

Hi,


What's the difference between one lun and multiple lun for mtd ?

Aren't any command to select the current lun ?

Matthieu


Nitin Garg a écrit :
> Why isn't my patch going through? re-sending again,
> 
> Signed-off-by: Nitin Garg <nitingarg98@xxxxxxxx>
> ---
>  drivers/mtd/nand/nand_base.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index c54a4cb..cdf6015 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -2892,7 +2892,7 @@ static int nand_flash_detect_onfi(struct
> mtd_info *mtd, struct nand_chip *chip,
>  	mtd->writesize = le32_to_cpu(p->byte_per_page);
>  	mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
>  	mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
> -	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
> +	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) *
> le32_to_cpu(p->lun_count) * mtd->erasesize;
>  	busw = 0;
>  	if (le16_to_cpu(p->features) & 1)
>  		busw = NAND_BUSWIDTH_16;

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

* Re: Bug in MTD NAND ONFI chipsize detection
  2011-05-12  7:47         ` Matthieu CASTET
@ 2011-05-12 12:34           ` Nitin Garg
  2011-05-12 13:53             ` Artem Bityutskiy
  2011-05-12 15:39             ` Matthieu CASTET
  0 siblings, 2 replies; 11+ messages in thread
From: Nitin Garg @ 2011-05-12 12:34 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: Andrew Morton, linux-mtd, David Woodhouse, linux-kernel

I do not see any diff for mtd.

Regards,
Nitin

On Thu, May 12, 2011 at 2:47 AM, Matthieu CASTET
<matthieu.castet@parrot.com> wrote:
> Hi,
>
>
> What's the difference between one lun and multiple lun for mtd ?
>
> Aren't any command to select the current lun ?
>
> Matthieu
>
>
> Nitin Garg a écrit :
>> Why isn't my patch going through? re-sending again,
>>
>> Signed-off-by: Nitin Garg <nitingarg98@xxxxxxxx>
>> ---
>>  drivers/mtd/nand/nand_base.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
>> index c54a4cb..cdf6015 100644
>> --- a/drivers/mtd/nand/nand_base.c
>> +++ b/drivers/mtd/nand/nand_base.c
>> @@ -2892,7 +2892,7 @@ static int nand_flash_detect_onfi(struct
>> mtd_info *mtd, struct nand_chip *chip,
>>       mtd->writesize = le32_to_cpu(p->byte_per_page);
>>       mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
>>       mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
>> -     chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
>> +     chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) *
>> le32_to_cpu(p->lun_count) * mtd->erasesize;
>>       busw = 0;
>>       if (le16_to_cpu(p->features) & 1)
>>               busw = NAND_BUSWIDTH_16;
>

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

* Re: Bug in MTD NAND ONFI chipsize detection
  2011-05-12 12:34           ` Nitin Garg
@ 2011-05-12 13:53             ` Artem Bityutskiy
  2011-05-12 13:53               ` Artem Bityutskiy
  2011-05-12 15:39             ` Matthieu CASTET
  1 sibling, 1 reply; 11+ messages in thread
From: Artem Bityutskiy @ 2011-05-12 13:53 UTC (permalink / raw)
  To: Nitin Garg
  Cc: Matthieu CASTET, David Woodhouse, Andrew Morton, linux-mtd, linux-kernel

On Thu, 2011-05-12 at 07:34 -0500, Nitin Garg wrote:
> I do not see any diff for mtd.

Please, send a patch with a better commit message clearly explaining
which problem the bug fixes, and make sure the commit message is
understandable even by people who have not read the ONFI standard.

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


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

* Re: Bug in MTD NAND ONFI chipsize detection
  2011-05-12 13:53             ` Artem Bityutskiy
@ 2011-05-12 13:53               ` Artem Bityutskiy
  2011-05-12 15:19                 ` Nitin Garg
  0 siblings, 1 reply; 11+ messages in thread
From: Artem Bityutskiy @ 2011-05-12 13:53 UTC (permalink / raw)
  To: Nitin Garg
  Cc: Matthieu CASTET, David Woodhouse, Andrew Morton, linux-mtd, linux-kernel

On Thu, 2011-05-12 at 16:53 +0300, Artem Bityutskiy wrote:
> which problem the bug fixes, and make sure the commit message is

Sorry, s/the bug fixes/the patch fixes/

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


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

* Re: Bug in MTD NAND ONFI chipsize detection
  2011-05-12 13:53               ` Artem Bityutskiy
@ 2011-05-12 15:19                 ` Nitin Garg
  0 siblings, 0 replies; 11+ messages in thread
From: Nitin Garg @ 2011-05-12 15:19 UTC (permalink / raw)
  To: dedekind1
  Cc: Matthieu CASTET, David Woodhouse, Andrew Morton, linux-mtd, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1401 bytes --]

I hope this is better and acceptable, pls review.

As per ONFI standard, the size of NAND Flash device is Number of
data bytes per page * Number of pages per block * Number of blocks
per logical unit * Number of logical units. The nand_flash_detect_onfi
function is missing the Number of logical units due to which the kernel
detects wrong size of Micron MT29F8G08ADADAH4 NAND Flash as
it has 2 logical units. This patch fixes this issue by multiplying
p->lun_count for chipsize.

Signed-off-by: Nitin Garg <nitingarg98@gmail.com>
---
 drivers/mtd/nand/nand_base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index c54a4cb..cdf6015 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2892,7 +2892,7 @@ static int nand_flash_detect_onfi(struct
mtd_info *mtd, struct nand_chip *chip,
        mtd->writesize = le32_to_cpu(p->byte_per_page);
        mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
        mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
-       chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) *
mtd->erasesize;
+       chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) *
le32_to_cpu(p->lun_count) * mtd->erasesize;
        busw = 0;
        if (le16_to_cpu(p->features) & 1)
                busw = NAND_BUSWIDTH_16;
--
1.5.5.6

[-- Attachment #2: onfi_nand_flash_chipsize.patch --]
[-- Type: application/octet-stream, Size: 1465 bytes --]

From 28d929d6695fd629c6f6ecd700044ca75ecef00f Mon Sep 17 00:00:00 2001
From: Nitin Garg <nitingarg98@gmail.com>
Date: Thu, 12 May 2011 10:00:04 -0500
Subject: [PATCH] As per ONFI standard, the size of NAND Flash device is Number of data bytes per page * Number of pages per block * Number of blocks per logical unit * Number of logical units. The nand_flash_detect_onfi function is missing the Number of logical units due to which the kernel detects wrong size of Micron MT29F8G08ADADAH4 NAND Flash as it has 2 logical units. This patch fixes this issue by multiplying p->lun_count for chipsize.


Signed-off-by: Nitin Garg <nitingarg98@gmail.com>
---
 drivers/mtd/nand/nand_base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index c54a4cb..cdf6015 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2892,7 +2892,7 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
 	mtd->writesize = le32_to_cpu(p->byte_per_page);
 	mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
 	mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
-	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
+	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * le32_to_cpu(p->lun_count) * mtd->erasesize;
 	busw = 0;
 	if (le16_to_cpu(p->features) & 1)
 		busw = NAND_BUSWIDTH_16;
-- 
1.5.5.6


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

* Re: Bug in MTD NAND ONFI chipsize detection
  2011-05-12 12:34           ` Nitin Garg
  2011-05-12 13:53             ` Artem Bityutskiy
@ 2011-05-12 15:39             ` Matthieu CASTET
  1 sibling, 0 replies; 11+ messages in thread
From: Matthieu CASTET @ 2011-05-12 15:39 UTC (permalink / raw)
  To: Nitin Garg; +Cc: Andrew Morton, linux-mtd, David Woodhouse, linux-kernel

Nitin Garg a écrit :
> I do not see any diff for mtd.
> 
ONFI spec say [1].

Why this doesn't apply to mtd ?


[1]
    3.1.2. Logical Unit Selection
Logical units within one target share a single data bus with the host. The host
shall ensure that
only one LUN is selected for data output to the host at any particular point in
time to avoid bus
contention.
The host selects a LUN for future data output by issuing a Read Status Enhanced
command to
that LUN. The Read Status Enhanced command shall deselect the output path for
all LUNs that
are not addressed by the command. The page register selected for output within
the LUN is
determined by the previous Read (Cache) commands issued, and is not impacted by Read
Status Enhanced.



> Regards,
> Nitin
> 
> On Thu, May 12, 2011 at 2:47 AM, Matthieu CASTET
> <matthieu.castet@parrot.com> wrote:
>> Hi,
>>
>>
>> What's the difference between one lun and multiple lun for mtd ?
>>
>> Aren't any command to select the current lun ?
>>
>> Matthieu
>>
>>
>> Nitin Garg a écrit :
>>> Why isn't my patch going through? re-sending again,
>>>
>>> Signed-off-by: Nitin Garg <nitingarg98@xxxxxxxx>
>>> ---
>>>  drivers/mtd/nand/nand_base.c |    2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
>>> index c54a4cb..cdf6015 100644
>>> --- a/drivers/mtd/nand/nand_base.c
>>> +++ b/drivers/mtd/nand/nand_base.c
>>> @@ -2892,7 +2892,7 @@ static int nand_flash_detect_onfi(struct
>>> mtd_info *mtd, struct nand_chip *chip,
>>>       mtd->writesize = le32_to_cpu(p->byte_per_page);
>>>       mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
>>>       mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
>>> -     chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
>>> +     chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) *
>>> le32_to_cpu(p->lun_count) * mtd->erasesize;
>>>       busw = 0;
>>>       if (le16_to_cpu(p->features) & 1)
>>>               busw = NAND_BUSWIDTH_16;
> 

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

end of thread, other threads:[~2011-05-12 15:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-11 16:25 Bug in MTD NAND ONFI chipsize detection Nitin Garg
2011-05-12  1:33 ` Andrew Morton
2011-05-12  6:54   ` Nitin Garg
2011-05-12  7:05     ` Nitin Garg
2011-05-12  7:16       ` Nitin Garg
2011-05-12  7:47         ` Matthieu CASTET
2011-05-12 12:34           ` Nitin Garg
2011-05-12 13:53             ` Artem Bityutskiy
2011-05-12 13:53               ` Artem Bityutskiy
2011-05-12 15:19                 ` Nitin Garg
2011-05-12 15:39             ` Matthieu CASTET

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).