lkml.org 
[lkml]   [2011]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateWed, 11 May 2011 18:33:22 -0700
FromAndrew Morton <>
SubjectRe: Bug in MTD NAND ONFI chipsize detection
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.


\
 
 \ /
  Last update: 2011-05-12 03:29    [from the cache]
©2003-2010