Message ID | 47F3F98010FF784EBEE6526EAAB078D10635EA18@tq-mailsrv.tq-net.de |
---|---|
State | Superseded |
Delegated to: | Stefan Roese |
Headers | show |
Hi Martin, On Monday 21 March 2011 13:42:00 Martin Krause wrote: > I encountered a problem with the cfi_flash driver on a board with > two flash banks with a different number of flash secotrs. > > It seems that the function find_sector() which tries to speed up > successive flash accesses does not take into account the current > flash bank correctly. > > I created a patch with a fix (see blow), but since I do not > work with current U-Boot, this patch likely will not apply cleanly > to TOT (but is neccessary, since the bug is still present there). First, the patch is line wrapped. Would it be possible for you to take the time to rebase it against TOT and send a non line wrapped version? Thanks. Cheers, Stefan -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office@denx.de
Hi Stefan, Stefan Roese wrote on Montag, 21. März 2011 14:10: > Hi Martin, > > On Monday 21 March 2011 13:42:00 Martin Krause wrote: >> I encountered a problem with the cfi_flash driver on a board with >> two flash banks with a different number of flash secotrs. >> >> It seems that the function find_sector() which tries to speed up >> successive flash accesses does not take into account the current >> flash bank correctly. >> >> I created a patch with a fix (see blow), but since I do not >> work with current U-Boot, this patch likely will not apply cleanly >> to TOT (but is neccessary, since the bug is still present there). > > First, the patch is line wrapped. Would it be possible for Oh, I forgot dumb M$ outlook. > you to take the > time to rebase it against TOT and send a non line wrapped version? I will do, if the patch otherwise is OK. Since the computer my git repo is installed on has no direct connection to the internet, this is not as easy as it could be. And I will not be able to test the patched TOT U-Boot apart from compiling without errors. Best regards, Martin
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 24eb33f..ff1457c 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -653,8 +653,12 @@ static void flash_add_byte (flash_info_t * info, cfiword_t * cword, uchar c) static flash_sect_t find_sector (flash_info_t * info, ulong addr) { static flash_sect_t saved_sector = 0; /* previously found sector */ + static flash_info_t *saved_info = 0; /* previously used flash bank */ flash_sect_t sector = saved_sector; + if ((info != saved_info) || (sector >= info->sector_count)) + sector = 0; +