Re: [U-Boot] [PATCH 7/7] sf: stmicro: use common page timeout define

2009-04-02 Thread Haavard Skinnemoen
Mike Frysinger wrote:
> On Thursday 02 April 2009 07:20:13 Haavard Skinnemoen wrote:
> > Mike Frysinger wrote:
> > > - /* Up to 2 seconds */
> > > - ret = stmicro_wait_ready(flash, 2 * CONFIG_SYS_HZ);
> > > + ret = stmicro_wait_ready(flash, SPI_FLASH_PAGE_ERASE_TIMEOUT);
> >
> > 50 ms is an awful lot less than 2 seconds. Sure this is safe?
> 
> the 2 sec mark was copied in all spi flash drivers based on the original port 
> rather than referring to a datasheet, and it works on my Blackfin boards that 
> have stmicro parts.

Ok, that's good enough for me.

> personally i think the timeouts in the current spi flash common code is too 
> low in general, so i'd propose we raise them.  after all, the timeouts only 
> matter in when something goes wrong, so they wouldnt be reached.  and the low 
> threshold seems like it makes the presumption of faster SPI bus speeds.
> 
> i.e. how about raising the timeout values 50x or 100x ?

I think that sounds like a good idea.

Haavard
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 7/7] sf: stmicro: use common page timeout define

2009-04-02 Thread Mike Frysinger
On Thursday 02 April 2009 07:20:13 Haavard Skinnemoen wrote:
> Mike Frysinger wrote:
> > -   /* Up to 2 seconds */
> > -   ret = stmicro_wait_ready(flash, 2 * CONFIG_SYS_HZ);
> > +   ret = stmicro_wait_ready(flash, SPI_FLASH_PAGE_ERASE_TIMEOUT);
>
> 50 ms is an awful lot less than 2 seconds. Sure this is safe?

the 2 sec mark was copied in all spi flash drivers based on the original port 
rather than referring to a datasheet, and it works on my Blackfin boards that 
have stmicro parts.

personally i think the timeouts in the current spi flash common code is too 
low in general, so i'd propose we raise them.  after all, the timeouts only 
matter in when something goes wrong, so they wouldnt be reached.  and the low 
threshold seems like it makes the presumption of faster SPI bus speeds.

i.e. how about raising the timeout values 50x or 100x ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 7/7] sf: stmicro: use common page timeout define

2009-04-02 Thread Haavard Skinnemoen
Mike Frysinger wrote:
> - /* Up to 2 seconds */
> - ret = stmicro_wait_ready(flash, 2 * CONFIG_SYS_HZ);
> + ret = stmicro_wait_ready(flash, SPI_FLASH_PAGE_ERASE_TIMEOUT);

50 ms is an awful lot less than 2 seconds. Sure this is safe?

Haavard
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 7/7] sf: stmicro: use common page timeout define

2009-04-02 Thread Mike Frysinger
Signed-off-by: Mike Frysinger 
CC: Haavard Skinnemoen 
---
 drivers/mtd/spi/stmicro.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c
index e401cd0..b43e9f4 100644
--- a/drivers/mtd/spi/stmicro.c
+++ b/drivers/mtd/spi/stmicro.c
@@ -295,8 +295,7 @@ int stmicro_erase(struct spi_flash *flash, u32 offset, 
size_t len)
break;
}
 
-   /* Up to 2 seconds */
-   ret = stmicro_wait_ready(flash, 2 * CONFIG_SYS_HZ);
+   ret = stmicro_wait_ready(flash, SPI_FLASH_PAGE_ERASE_TIMEOUT);
if (ret < 0) {
debug("SF: STMicro page erase timed out\n");
break;
-- 
1.6.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot