Skip to contentSkip to conversation

PM / clk: don't leave clocks enabled when driver not bound

PATCH Applied Andy Shevchenko 2 participants 2 messages Jan 7, 2016 – Jan 8, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PM / clk: don't leave clocks enabled when driver not bound

There is a new notification BUS_NOTIFY_DRIVER_NOT_BOUND that is issued when driver fails during binding. In such case pm_clk_notify(), when PM_CLK=n, leaves clocks enabled. Undo operations that has been done in BUS_NOTIFY_BIND_DRIVER case.

---
 drivers/base/power/clock_ops.c | 1 +
 1 file changed, 1 insertion(+)
drivers/base/power/clock_ops.c +1 -0
index 60ee559..c39b861 100644
@@ -473,6 +473,7 @@ static int pm_clk_notify(struct notifier_block *nb,
 			enable_clock(dev, NULL);
 		}
 		break;
+	case BUS_NOTIFY_DRIVER_NOT_BOUND:
 	case BUS_NOTIFY_UNBOUND_DRIVER:
 		if (clknb->con_ids[0]) {
 			for (con_id = clknb->con_ids; *con_id; con_id++)
Signature · 1 line
2.6.4
#1 lore raw
Quoted 15 lines · Andy Shevchenko

There is a new notification BUS_NOTIFY_DRIVER_NOT_BOUND that is issued when driver fails during binding. In such case pm_clk_notify(), when PM_CLK=n, leaves clocks enabled. Undo operations that has been done in BUS_NOTIFY_BIND_DRIVER case.

---
 drivers/base/power/clock_ops.c | 1 +
 1 file changed, 1 insertion(+)
drivers/base/power/clock_ops.c +0 -0
index 60ee559..c39b861 100644

drivers/base/power/clock_ops.c static int pm_clk_notify(struct notifier_block *nb, · line 479

Quoted 7 lines
drivers/base/power/clock_ops.c +1 -0
@@ -473,6 +473,7 @@ static int pm_clk_notify(struct notifier_block *nb,
 			enable_clock(dev, NULL);
 		}
 		break;
+	case BUS_NOTIFY_DRIVER_NOT_BOUND:
 	case BUS_NOTIFY_UNBOUND_DRIVER:
 		if (clknb->con_ids[0]) {
 			for (con_id = clknb->con_ids; *con_id; con_id++)

Applied, thanks!

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.