Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: pxa2xx: limit reaches -1

On line 944 the return value of flush() is considered as a boolean,
but limit reaches -1 upon timeout which evaluates to true.

On 540, 594, 720 the same occurs for wait_ssp_rx_stall()
On 536 the same occurs for wait_dma_channel_stop()

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Eric Miao <eric.miao@marvell.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Roel Kluin and committed by
Linus Torvalds
306c68aa dc8c7f89

+3 -3
+3 -3
drivers/spi/pxa2xx_spi.c
··· 213 213 while (read_SSSR(reg) & SSSR_RNE) { 214 214 read_SSDR(reg); 215 215 } 216 - } while ((read_SSSR(reg) & SSSR_BSY) && limit--); 216 + } while ((read_SSSR(reg) & SSSR_BSY) && --limit); 217 217 write_SSSR(SSSR_ROR, reg); 218 218 219 219 return limit; ··· 484 484 { 485 485 unsigned long limit = loops_per_jiffy << 1; 486 486 487 - while ((read_SSSR(ioaddr) & SSSR_BSY) && limit--) 487 + while ((read_SSSR(ioaddr) & SSSR_BSY) && --limit) 488 488 cpu_relax(); 489 489 490 490 return limit; ··· 494 494 { 495 495 unsigned long limit = loops_per_jiffy << 1; 496 496 497 - while (!(DCSR(channel) & DCSR_STOPSTATE) && limit--) 497 + while (!(DCSR(channel) & DCSR_STOPSTATE) && --limit) 498 498 cpu_relax(); 499 499 500 500 return limit;