spi_bfin5xx: limit reaches -1
PATCH 1/1 spi_bfin5xx: limit reaches -1
bfin_spi_flush() returns limit, which reaches -1 upon timeout. but in function bfin_spi_pump_transfers() it is compared with 0.
---
drivers/spi/spi_bfin5xx.c +1 -1
@@ -169,7 +169,7 @@ static int bfin_spi_flush(struct driver_data *drv_data)unsigned long limit = loops_per_jiffy <<1 ;/* wait for stop and clear stat */ -while (!(read_STAT (drv_data) &BIT_STAT_SPIF ) && limit--) +while (!(read_STAT (drv_data) &BIT_STAT_SPIF ) && --limit)cpu_relax ();write_STAT (drv_data,BIT_STAT_CLR );
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p
David Brownell
Acked-byQuoted 4 lines · Roel Kluin
bfin_spi_flush()returns limit, which reaches -1 upon timeout. but in functionbfin_spi_pump_transfers()it is compared with 0.Signed-off-by Roel Kluin <[email protected]>
... although this could trigger a rarely-seen-before fault path in this driver, which I hope won't cause trouble. Bryan?
Quoted 8 lines
---
drivers/spi/spi_bfin5xx.c +0
-0
drivers/spi/spi_bfin5xx.c static int bfin_spi_flush(struct driver_data *drv_data) · line 175
Quoted 8 lines
drivers/spi/spi_bfin5xx.c +1
-1@@ -169,7 +169,7 @@ static int bfin_spi_flush(struct driver_data *drv_data)unsigned long limit = loops_per_jiffy <<1 ;/* wait for stop and clear stat */ -while (!(read_STAT (drv_data) &BIT_STAT_SPIF ) && limit--) +while (!(read_STAT (drv_data) &BIT_STAT_SPIF ) && --limit)cpu_relax ();write_STAT (drv_data,BIT_STAT_CLR );
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p