lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1406313096-29761-3-git-send-email-grygorii.strashko@ti.com>
Date:	Fri, 25 Jul 2014 21:31:35 +0300
From:	Grygorii Strashko <grygorii.strashko@...com>
To:	<santosh.shilimkar@...com>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>, <khilman@...aro.org>,
	Geert Uytterhoeven <geert+renesas@...der.be>,
	<linux-pm@...r.kernel.org>
CC:	<ben.dooks@...ethink.co.uk>, <laurent.pinchart@...asonboard.com>,
	<grant.likely@...retlab.ca>, <ulf.hansson@...aro.org>,
	<linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>, <linux-sh@...r.kernel.org>,
	Grygorii Strashko <grygorii.strashko@...com>
Subject: [RFC PATCH 2/3] PM / clock_ops: allow to specify custom pm_clk_notifier callback

The CLK PM domain assumes that platform code should always provide
list of Connection IDs of the clock (con_id) in
pm_clk_notifier_block structure. Then CLK PM domain uses these con_ids
to setup list of clocks per device.

Such approach is inconvenient when devices can have different number
of clocks. For example, if maximum number of clocks used by
device is 4 the pm_clk_notifier_block structure will look like:

static struct pm_clk_notifier_block platform_domain_notifier = {
	.pm_domain = &keystone_pm_domain,
	.con_ids = { "fck", "opt1", "opt2", "opt3", NULL },
};

More over, clocks in DT have to be named using only con_ids:
	clocks = <&paclk13>, <&clkcpgmac>, <&chipclk12>;
	clock-names = "fck", "opt1", "opt2";

This patch allow to specify custom pm_clk_notifier callback from
platform code and in such way makes CLK PM domain initialization
more flexible. For example, Keystone 2 will provide custom callback
to fill list of clocks for Device with all clocks assigned to this
Device in DT.

Signed-off-by: Grygorii Strashko <grygorii.strashko@...com>
---
 drivers/base/power/clock_ops.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
index 2d5c9c1..c103598 100644
--- a/drivers/base/power/clock_ops.c
+++ b/drivers/base/power/clock_ops.c
@@ -520,6 +520,7 @@ void pm_clk_add_notifier(struct bus_type *bus,
 	if (!bus || !clknb)
 		return;
 
-	clknb->nb.notifier_call = pm_clk_notify;
+	if (!clknb->nb.notifier_call)
+		clknb->nb.notifier_call = pm_clk_notify;
 	bus_register_notifier(bus, &clknb->nb);
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ