powerpc/vas: Free send window in VAS instance after credits returned
authorHaren Myneni <haren@linux.ibm.com>
Thu, 16 Apr 2020 06:07:36 +0000 (23:07 -0700)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 20 Apr 2020 06:53:01 +0000 (16:53 +1000)
NX may be processing requests while trying to close window. Wait until
all credits are returned and then free send window from VAS instance.

Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1587017256.2275.1076.camel@hbabu-laptop
arch/powerpc/platforms/powernv/vas-window.c

index d0c07cf03f68054eeaec80c490202bb6ba176c37..e15b40596746eb6e7d3be70a4f43f95c5c0e1a9c 100644 (file)
@@ -1316,14 +1316,14 @@ int vas_win_close(struct vas_window *window)
 
        unmap_paste_region(window);
 
-       clear_vinst_win(window);
-
        poll_window_busy_state(window);
 
        unpin_close_window(window);
 
        poll_window_credits(window);
 
+       clear_vinst_win(window);
+
        poll_window_castout(window);
 
        /* if send window, drop reference to matching receive window */