diff options
author | Anton Blanchard <anton@samba.org> | 2011-04-06 21:54:07 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-04-27 00:18:50 -0400 |
commit | eca590f402332ab873d13f2d8d00fa0b91cfff36 (patch) | |
tree | 1dc942f6c0983ae59cfe2692d2d339345a995a1d | |
parent | a7b8ad405862fb10e496ce839d423dfc94ac821b (diff) |
powerpc/rtas: Only sleep in rtas_busy_delay if we have useful work to do
RTAS returns extended error codes as a hint of how long the
OS might want to wait before retrying a call. If we have nothing
else useful to do we may as well call back straight away.
This was found when testing the new dynamic dma window feature.
Firmware split the zeroing of the TCE table into 32k chunks but
returned 9901 (which is a suggested wait of 10ms). All up this took
about 10 minutes to complete since msleep is jiffies based and will
round 10ms up to 20ms.
With the patch below we take 3 seconds to complete the same test.
The hint firmware is returning in the RTAS call should definitely
be decreased, but even if we slept 1ms each iteration this would
take 32s.
Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/kernel/rtas.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index 2097f2b3cba8..f48446635c89 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c | |||
@@ -494,7 +494,7 @@ unsigned int rtas_busy_delay(int status) | |||
494 | 494 | ||
495 | might_sleep(); | 495 | might_sleep(); |
496 | ms = rtas_busy_delay_time(status); | 496 | ms = rtas_busy_delay_time(status); |
497 | if (ms) | 497 | if (ms && need_resched()) |
498 | msleep(ms); | 498 | msleep(ms); |
499 | 499 | ||
500 | return ms; | 500 | return ms; |