Skip to content

Commit

Permalink
librtas: return CALL_AGAIN on RC_BUSY status in handle_delay()
Browse files Browse the repository at this point in the history
There is no need to delay before retrying on RC_BUSY return status. The
kernel used to get this wrong too.

torvalds/linux@38f7b70

Excerpt referenced from above commit:

RTAS_BUSY (-2): RTAS has suspended a potentially long-running operation in
order to meet its latency obligation and give the OS the opportunity to
perform other work. RTAS can resume making progress as soon as the OS
reattempts the call.

To avoid uselessly sleeping update handle_delay() to return CALL_AGAIN
immediately when it is passed RC_BUSY.

Suggested-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
  • Loading branch information
tyreld committed Feb 7, 2024
1 parent d4348be commit 238bf04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions librtas_src/syscall_calls.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ unsigned int handle_delay(int status, uint64_t * elapsed)
for (ms = 1; order > 0; order--)
ms = ms * 10;
} else if (status == RC_BUSY) {
/* Regular Delay */
ms = 1;
/* Retry */
return CALL_AGAIN;
} else {
/* Not a delay return code */
return 0;
Expand Down

0 comments on commit 238bf04

Please sign in to comment.