Commit dfe954e4 authored by Sukadev Bhattiprolu's avatar Sukadev Bhattiprolu Committed by Michael Ellerman

powerpc/vas: Reduce polling interval for busy state

A VAS window is normally in "busy" state for only a short duration.
Reduce the time we wait for the window to go to "not-busy" state to
speed-up vas_win_close() a bit.
Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 36a288fe
...@@ -1060,21 +1060,23 @@ int vas_paste_crb(struct vas_window *txwin, int offset, bool re) ...@@ -1060,21 +1060,23 @@ int vas_paste_crb(struct vas_window *txwin, int offset, bool re)
} }
EXPORT_SYMBOL_GPL(vas_paste_crb); EXPORT_SYMBOL_GPL(vas_paste_crb);
/*
* Wait for the window to go to "not-busy" state. It should only take a
* short time to queue a CRB, so window should not be busy for too long.
* Trying 5ms intervals.
*/
static void poll_window_busy_state(struct vas_window *window) static void poll_window_busy_state(struct vas_window *window)
{ {
int busy; int busy;
u64 val; u64 val;
retry: retry:
/*
* Poll Window Busy flag
*/
val = read_hvwc_reg(window, VREG(WIN_STATUS)); val = read_hvwc_reg(window, VREG(WIN_STATUS));
busy = GET_FIELD(VAS_WIN_BUSY, val); busy = GET_FIELD(VAS_WIN_BUSY, val);
if (busy) { if (busy) {
val = 0; val = 0;
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(HZ); schedule_timeout(msecs_to_jiffies(5));
goto retry; goto retry;
} }
} }
......
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