Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: add pr_debug & kerneldoc around clk notifiers

Both the pr_err and the additional kerneldoc aim to help when debugging
errors thrown from within a clock rate-change notifier callback.

Reported-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>

+18 -1
+4 -1
drivers/clk/clk.c
··· 1339 1339 if (clk->notifier_count) 1340 1340 ret = __clk_notify(clk, PRE_RATE_CHANGE, clk->rate, new_rate); 1341 1341 1342 - if (ret & NOTIFY_STOP_MASK) 1342 + if (ret & NOTIFY_STOP_MASK) { 1343 + pr_debug("%s: clk notifier callback for clock %s aborted with error %d\n", 1344 + __func__, clk->name, ret); 1343 1345 goto out; 1346 + } 1344 1347 1345 1348 hlist_for_each_entry(child, &clk->children, child_node) { 1346 1349 ret = __clk_speculate_rates(child, new_rate);
+14
include/linux/clk.h
··· 78 78 unsigned long new_rate; 79 79 }; 80 80 81 + /** 82 + * clk_notifier_register: register a clock rate-change notifier callback 83 + * @clk: clock whose rate we are interested in 84 + * @nb: notifier block with callback function pointer 85 + * 86 + * ProTip: debugging across notifier chains can be frustrating. Make sure that 87 + * your notifier callback function prints a nice big warning in case of 88 + * failure. 89 + */ 81 90 int clk_notifier_register(struct clk *clk, struct notifier_block *nb); 82 91 92 + /** 93 + * clk_notifier_unregister: unregister a clock rate-change notifier callback 94 + * @clk: clock whose rate we are no longer interested in 95 + * @nb: notifier block which will be unregistered 96 + */ 83 97 int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb); 84 98 85 99 /**