Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756689AbdCUKQl (ORCPT ); Tue, 21 Mar 2017 06:16:41 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:6228 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754338AbdCUKQj (ORCPT ); Tue, 21 Mar 2017 06:16:39 -0400 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 21 Mar 2017 03:16:38 -0700 From: Peter De Schrijver To: Peter De Schrijver , Michael Turquette , Stephen Boyd , , Subject: [PATCH] clk: aggregate return codes of notify chains Date: Tue, 21 Mar 2017 12:16:26 +0200 Message-ID: <1490091386-4014-1-git-send-email-pdeschrijver@nvidia.com> X-Mailer: git-send-email 1.9.1 X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.21.24.170] X-ClientProxiedBy: DRUKMAIL101.nvidia.com (10.25.59.19) To UKMAIL101.nvidia.com (10.26.138.13) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 777 Lines: 25 In case there are multiple notify chains for the same clocks (because they were registered by different users), we need to propagate potential failure of any single one of them to the caller. Otherwise we eg risk violating the V/f curve when a notifier is used for DVFS. Signed-off-by: Peter De Schrijver --- drivers/clk/clk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 67201f6..f5f2bcd 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -966,6 +966,8 @@ static int __clk_notify(struct clk_core *core, unsigned long msg, cnd.clk = cn->clk; ret = srcu_notifier_call_chain(&cn->notifier_head, msg, &cnd); + if (ret & NOTIFY_STOP_MASK) + return ret; } } -- 1.9.1