diff options
author | Dave Martin <dave.martin@linaro.org> | 2013-05-22 18:08:16 (GMT) |
---|---|---|
committer | Nicolas Pitre <nicolas.pitre@linaro.org> | 2013-09-23 22:39:19 (GMT) |
commit | 0577fee283fb385afbcdb78d1f4c398d7326b68f (patch) | |
tree | 76219feca51038c85b1f5cc076a1907ffc30bd01 /security/smack | |
parent | 491990e29f5d285a1b75e74785e3160716b79040 (diff) | |
download | linux-fsl-qoriq-0577fee283fb385afbcdb78d1f4c398d7326b68f.tar.xz |
ARM: bL_switcher: Add switch completion callback for bL_switch_request()
There is no explicit way to know when a switch started via
bL_switch_request() is complete. This can lead to unpredictable
behaviour when the switcher is controlled by a subsystem which
makes dynamic decisions (such as cpufreq).
The CPU PM notifier is not really suitable for signalling
completion, because the CPU could get suspended and resumed for
other, independent reasons while a switch request is in flight.
Adding a whole new notifier for this seems excessive, and may tempt
people to put heavyweight code on this path.
This patch implements a new bL_switch_request_cb() function that
allows for a per-request lightweight callback, private between the
switcher and the caller of bL_switch_request_cb().
Overlapping switches on a single CPU are considered incorrect if
they are requested via bL_switch_request_cb() with a callback (they
will lead to an unpredictable final state without explicit external
synchronisation to force the requests into a particular order).
Queuing requests robustly would be overkill because only one
subsystem should be attempting to control the switcher at any time.
Overlapping requests of this kind will be failed with -EBUSY to
indicate that the second request won't take effect and the
completer will never be called for it.
bL_switch_request() is retained as a wrapper round the new function,
with the old, fire-and-forget semantics. In this case the last request
will always win. The request may still be denied if a previous request
with a completer is still pending.
Signed-off-by: Dave Martin <dave.martin@linaro.org>
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Diffstat (limited to 'security/smack')
0 files changed, 0 insertions, 0 deletions