summaryrefslogtreecommitdiffstats
path: root/mm/usercopy.c
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2017-09-22 16:58:00 -0700
committerMichael Ellerman <mpe@ellerman.id.au>2017-11-06 20:17:41 +1100
commit71e24d7731a2903b1ae2bba2b2971c654d9c2aa6 (patch)
treeeef3cdca847dc555a9a3921a72cf1a6f586c13f1 /mm/usercopy.c
parentedfd17ff39bce59886e8249e645d6ecfc3e3829c (diff)
downloadlinux-stable-71e24d7731a2903b1ae2bba2b2971c654d9c2aa6.tar.gz
linux-stable-71e24d7731a2903b1ae2bba2b2971c654d9c2aa6.tar.bz2
linux-stable-71e24d7731a2903b1ae2bba2b2971c654d9c2aa6.zip
powerpc/opal: Fix EBUSY bug in acquiring tokens
The current code checks the completion map to look for the first token that is complete. In some cases, a completion can come in but the token can still be on lease to the caller processing the completion. If this completed but unreleased token is the first token found in the bitmap by another tasks trying to acquire a token, then the __test_and_set_bit call will fail since the token will still be on lease. The acquisition will then fail with an EBUSY. This patch reorganizes the acquisition code to look at the opal_async_token_map for an unleased token. If the token has no lease it must have no outstanding completions so we should never see an EBUSY, unless we have leased out too many tokens. Since opal_async_get_token_inrerruptible is protected by a semaphore, we will practically never see EBUSY anymore. Fixes: 8d7248232208 ("powerpc/powernv: Infrastructure to support OPAL async completion") Signed-off-by: William A. Kennington III <wak@google.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'mm/usercopy.c')
0 files changed, 0 insertions, 0 deletions