Skip to content

Commit

Permalink
powerpc/vas: Reduce polling interval for busy state
Browse files Browse the repository at this point in the history
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: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Sukadev Bhattiprolu authored and Michael Ellerman committed Nov 11, 2017
1 parent 36a288f commit dfe954e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions arch/powerpc/platforms/powernv/vas-window.c
Original file line number Diff line number Diff line change
Expand Up @@ -1060,21 +1060,23 @@ int vas_paste_crb(struct vas_window *txwin, int offset, bool re)
}
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)
{
int busy;
u64 val;

retry:
/*
* Poll Window Busy flag
*/
val = read_hvwc_reg(window, VREG(WIN_STATUS));
busy = GET_FIELD(VAS_WIN_BUSY, val);
if (busy) {
val = 0;
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(HZ);
schedule_timeout(msecs_to_jiffies(5));
goto retry;
}
}
Expand Down

0 comments on commit dfe954e

Please sign in to comment.