diff options
author | Peter Xu <peterx@redhat.com> | 2019-12-16 16:31:23 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2020-03-06 13:42:28 +0100 |
commit | 5a18ceca63502546d6c0cab1f3f79cb6900f947a (patch) | |
tree | ee7d4657d75a83bdd336a4a7be4e3cc90f901812 /drivers/hid/hid-prodikeys.c | |
parent | 8b614cb8f1dcac8ca77cf4dd85f46ef3055f8238 (diff) | |
download | linux-5a18ceca63502546d6c0cab1f3f79cb6900f947a.tar.bz2 |
smp: Allow smp_call_function_single_async() to insert locked csd
Previously we will raise an warning if we want to insert a csd object
which is with the LOCK flag set, and if it happens we'll also wait for
the lock to be released. However, this operation does not match
perfectly with how the function is named - the name with "_async"
suffix hints that this function should not block, while we will.
This patch changed this behavior by simply return -EBUSY instead of
waiting, at the meantime we allow this operation to happen without
warning the user to change this into a feature when the caller wants
to "insert a csd object, if it's there, just wait for that one".
This is pretty safe because in flush_smp_call_function_queue() for
async csd objects (where csd->flags&SYNC is zero) we'll first do the
unlock then we call the csd->func(). So if we see the csd->flags&LOCK
is true in smp_call_function_single_async(), then it's guaranteed that
csd->func() will be called after this smp_call_function_single_async()
returns -EBUSY.
Update the comment of the function too to refect this.
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20191216213125.9536-2-peterx@redhat.com
Diffstat (limited to 'drivers/hid/hid-prodikeys.c')
0 files changed, 0 insertions, 0 deletions