]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/rtas: Only sleep in rtas_busy_delay if we have useful work to do
authorAnton Blanchard <anton@samba.org>
Thu, 7 Apr 2011 01:54:07 +0000 (01:54 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 27 Apr 2011 04:18:50 +0000 (14:18 +1000)
commitb3564e770b80c19d003a49ab80b812a94feb8232
tree1dc942f6c0983ae59cfe2692d2d339345a995a1d
parent660878ac91876545426b45f989949f3999c8d2b0
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>
arch/powerpc/kernel/rtas.c