summaryrefslogtreecommitdiffstats
path: root/include/linux/clk.h
diff options
context:
space:
mode:
authorSoren Brinkmann <soren.brinkmann@xilinx.com>2013-04-03 12:17:12 -0700
committerMike Turquette <mturquette@linaro.org>2013-04-10 16:33:53 -0700
commitfb72a0590b770f7da6a02bde6b8a147a3d9f6168 (patch)
treeb842b02beb3a44b0d595f0b6020b8ed71c8f448e /include/linux/clk.h
parent312f0f0b9a4e3e2cc8ad1bbc4577a6dff025cdf6 (diff)
downloadop-kernel-dev-fb72a0590b770f7da6a02bde6b8a147a3d9f6168.zip
op-kernel-dev-fb72a0590b770f7da6a02bde6b8a147a3d9f6168.tar.gz
clk: Properly handle notifier return values
Notifiers may return NOTIFY_(OK|DONE|STOP|BAD). The CCF uses an inconsistent mix of checking against NOTIFY_STOP or NOTIFY_BAD. This inconsistency leaves errors undetected in some cases: clk_set_parent() calls __clk_speculate_rates(), which stops when it hits a NOTIFIER_BAD (STOP is ignored), and passes this value back to the caller. clk_set_parent() compares this return value against NOTIFY_STOP only, ignoring NOTIFY_BAD returns. Use NOTIFY_STOP_MASK to detect a negative notifier return value and document all four return value options. Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'include/linux/clk.h')
-rw-r--r--include/linux/clk.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h
index b3ac22d..9a6d045 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -28,16 +28,16 @@ struct clk;
* PRE_RATE_CHANGE - called immediately before the clk rate is changed,
* to indicate that the rate change will proceed. Drivers must
* immediately terminate any operations that will be affected by the
- * rate change. Callbacks may either return NOTIFY_DONE or
- * NOTIFY_STOP.
+ * rate change. Callbacks may either return NOTIFY_DONE, NOTIFY_OK,
+ * NOTIFY_STOP or NOTIFY_BAD.
*
* ABORT_RATE_CHANGE: called if the rate change failed for some reason
* after PRE_RATE_CHANGE. In this case, all registered notifiers on
* the clk will be called with ABORT_RATE_CHANGE. Callbacks must
- * always return NOTIFY_DONE.
+ * always return NOTIFY_DONE or NOTIFY_OK.
*
* POST_RATE_CHANGE - called after the clk rate change has successfully
- * completed. Callbacks must always return NOTIFY_DONE.
+ * completed. Callbacks must always return NOTIFY_DONE or NOTIFY_OK.
*
*/
#define PRE_RATE_CHANGE BIT(0)
OpenPOWER on IntegriCloud