Commit eca590f4 authored by Anton Blanchard's avatar Anton Blanchard Committed by Benjamin Herrenschmidt

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: default avatarAnton Blanchard <anton@samba.org>
Acked-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent a7b8ad40
...@@ -494,7 +494,7 @@ unsigned int rtas_busy_delay(int status) ...@@ -494,7 +494,7 @@ unsigned int rtas_busy_delay(int status)
might_sleep(); might_sleep();
ms = rtas_busy_delay_time(status); ms = rtas_busy_delay_time(status);
if (ms) if (ms && need_resched())
msleep(ms); msleep(ms);
return ms; return ms;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment