aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/power/runtime_pm.txt3
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c1
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c1
-rw-r--r--arch/arm/mach-shmobile/clock-sh7372.c2
-rw-r--r--arch/arm/plat-omap/omap_device.c3
-rw-r--r--drivers/base/power/clock_ops.c40
-rw-r--r--drivers/tty/serial/sh-sci.c1
7 files changed, 30 insertions, 21 deletions
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
index 4ce5450ab6e8..6066e3a6b9a9 100644
--- a/Documentation/power/runtime_pm.txt
+++ b/Documentation/power/runtime_pm.txt
@@ -431,8 +431,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
431 431
432 void pm_runtime_irq_safe(struct device *dev); 432 void pm_runtime_irq_safe(struct device *dev);
433 - set the power.irq_safe flag for the device, causing the runtime-PM 433 - set the power.irq_safe flag for the device, causing the runtime-PM
434 suspend and resume callbacks (but not the idle callback) to be invoked 434 callbacks to be invoked with interrupts off
435 with interrupts disabled
436 435
437 void pm_runtime_mark_last_busy(struct device *dev); 436 void pm_runtime_mark_last_busy(struct device *dev);
438 - set the power.last_busy field to the current time 437 - set the power.last_busy field to the current time
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 9e0856b2f9e9..523f608eb8cf 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -1412,6 +1412,7 @@ static void __init ap4evb_init(void)
1412 fsi_init_pm_clock(); 1412 fsi_init_pm_clock();
1413 sh7372_pm_init(); 1413 sh7372_pm_init();
1414 pm_clk_add(&fsi_device.dev, "spu2"); 1414 pm_clk_add(&fsi_device.dev, "spu2");
1415 pm_clk_add(&lcdc1_device.dev, "hdmi");
1415} 1416}
1416 1417
1417static void __init ap4evb_timer_init(void) 1418static void __init ap4evb_timer_init(void)
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index d41c01f83f15..0ea71f8d4b89 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -1588,6 +1588,7 @@ static void __init mackerel_init(void)
1588 hdmi_init_pm_clock(); 1588 hdmi_init_pm_clock();
1589 sh7372_pm_init(); 1589 sh7372_pm_init();
1590 pm_clk_add(&fsi_device.dev, "spu2"); 1590 pm_clk_add(&fsi_device.dev, "spu2");
1591 pm_clk_add(&hdmi_lcdc_device.dev, "hdmi");
1591} 1592}
1592 1593
1593static void __init mackerel_timer_init(void) 1594static void __init mackerel_timer_init(void)
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
index 6b1619a65dba..e6e11e4e2d43 100644
--- a/arch/arm/mach-shmobile/clock-sh7372.c
+++ b/arch/arm/mach-shmobile/clock-sh7372.c
@@ -655,6 +655,8 @@ static struct clk_lookup lookups[] = {
655 CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[MSTP406]), /* USB1 */ 655 CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[MSTP406]), /* USB1 */
656 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */ 656 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
657 657
658 CLKDEV_ICK_ID("hdmi", "sh_mobile_lcdc_fb.1",
659 &div6_reparent_clks[DIV6_HDMI]),
658 CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]), 660 CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]),
659 CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]), 661 CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]),
660 CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]), 662 CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]),
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index b6b409744954..9a6a53854911 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -622,7 +622,8 @@ static struct dev_pm_domain omap_device_pm_domain = {
622 SET_RUNTIME_PM_OPS(_od_runtime_suspend, _od_runtime_resume, 622 SET_RUNTIME_PM_OPS(_od_runtime_suspend, _od_runtime_resume,
623 _od_runtime_idle) 623 _od_runtime_idle)
624 USE_PLATFORM_PM_SLEEP_OPS 624 USE_PLATFORM_PM_SLEEP_OPS
625 SET_SYSTEM_SLEEP_PM_OPS(_od_suspend_noirq, _od_resume_noirq) 625 .suspend_noirq = _od_suspend_noirq,
626 .resume_noirq = _od_resume_noirq,
626 } 627 }
627}; 628};
628 629
diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
index a846b2f95cfb..2c18d584066d 100644
--- a/drivers/base/power/clock_ops.c
+++ b/drivers/base/power/clock_ops.c
@@ -19,7 +19,7 @@
19 19
20struct pm_clk_data { 20struct pm_clk_data {
21 struct list_head clock_list; 21 struct list_head clock_list;
22 struct mutex lock; 22 spinlock_t lock;
23}; 23};
24 24
25enum pce_status { 25enum pce_status {
@@ -73,9 +73,9 @@ int pm_clk_add(struct device *dev, const char *con_id)
73 } 73 }
74 } 74 }
75 75
76 mutex_lock(&pcd->lock); 76 spin_lock_irq(&pcd->lock);
77 list_add_tail(&ce->node, &pcd->clock_list); 77 list_add_tail(&ce->node, &pcd->clock_list);
78 mutex_unlock(&pcd->lock); 78 spin_unlock_irq(&pcd->lock);
79 return 0; 79 return 0;
80} 80}
81 81
@@ -83,8 +83,8 @@ int pm_clk_add(struct device *dev, const char *con_id)
83 * __pm_clk_remove - Destroy PM clock entry. 83 * __pm_clk_remove - Destroy PM clock entry.
84 * @ce: PM clock entry to destroy. 84 * @ce: PM clock entry to destroy.
85 * 85 *
86 * This routine must be called under the mutex protecting the PM list of clocks 86 * This routine must be called under the spinlock protecting the PM list of
87 * corresponding the the @ce's device. 87 * clocks corresponding the the @ce's device.
88 */ 88 */
89static void __pm_clk_remove(struct pm_clock_entry *ce) 89static void __pm_clk_remove(struct pm_clock_entry *ce)
90{ 90{
@@ -123,7 +123,7 @@ void pm_clk_remove(struct device *dev, const char *con_id)
123 if (!pcd) 123 if (!pcd)
124 return; 124 return;
125 125
126 mutex_lock(&pcd->lock); 126 spin_lock_irq(&pcd->lock);
127 127
128 list_for_each_entry(ce, &pcd->clock_list, node) { 128 list_for_each_entry(ce, &pcd->clock_list, node) {
129 if (!con_id && !ce->con_id) { 129 if (!con_id && !ce->con_id) {
@@ -137,7 +137,7 @@ void pm_clk_remove(struct device *dev, const char *con_id)
137 } 137 }
138 } 138 }
139 139
140 mutex_unlock(&pcd->lock); 140 spin_unlock_irq(&pcd->lock);
141} 141}
142 142
143/** 143/**
@@ -158,7 +158,7 @@ int pm_clk_init(struct device *dev)
158 } 158 }
159 159
160 INIT_LIST_HEAD(&pcd->clock_list); 160 INIT_LIST_HEAD(&pcd->clock_list);
161 mutex_init(&pcd->lock); 161 spin_lock_init(&pcd->lock);
162 dev->power.subsys_data = pcd; 162 dev->power.subsys_data = pcd;
163 return 0; 163 return 0;
164} 164}
@@ -181,12 +181,12 @@ void pm_clk_destroy(struct device *dev)
181 181
182 dev->power.subsys_data = NULL; 182 dev->power.subsys_data = NULL;
183 183
184 mutex_lock(&pcd->lock); 184 spin_lock_irq(&pcd->lock);
185 185
186 list_for_each_entry_safe_reverse(ce, c, &pcd->clock_list, node) 186 list_for_each_entry_safe_reverse(ce, c, &pcd->clock_list, node)
187 __pm_clk_remove(ce); 187 __pm_clk_remove(ce);
188 188
189 mutex_unlock(&pcd->lock); 189 spin_unlock_irq(&pcd->lock);
190 190
191 kfree(pcd); 191 kfree(pcd);
192} 192}
@@ -220,13 +220,14 @@ int pm_clk_suspend(struct device *dev)
220{ 220{
221 struct pm_clk_data *pcd = __to_pcd(dev); 221 struct pm_clk_data *pcd = __to_pcd(dev);
222 struct pm_clock_entry *ce; 222 struct pm_clock_entry *ce;
223 unsigned long flags;
223 224
224 dev_dbg(dev, "%s()\n", __func__); 225 dev_dbg(dev, "%s()\n", __func__);
225 226
226 if (!pcd) 227 if (!pcd)
227 return 0; 228 return 0;
228 229
229 mutex_lock(&pcd->lock); 230 spin_lock_irqsave(&pcd->lock, flags);
230 231
231 list_for_each_entry_reverse(ce, &pcd->clock_list, node) { 232 list_for_each_entry_reverse(ce, &pcd->clock_list, node) {
232 if (ce->status == PCE_STATUS_NONE) 233 if (ce->status == PCE_STATUS_NONE)
@@ -238,7 +239,7 @@ int pm_clk_suspend(struct device *dev)
238 } 239 }
239 } 240 }
240 241
241 mutex_unlock(&pcd->lock); 242 spin_unlock_irqrestore(&pcd->lock, flags);
242 243
243 return 0; 244 return 0;
244} 245}
@@ -251,13 +252,14 @@ int pm_clk_resume(struct device *dev)
251{ 252{
252 struct pm_clk_data *pcd = __to_pcd(dev); 253 struct pm_clk_data *pcd = __to_pcd(dev);
253 struct pm_clock_entry *ce; 254 struct pm_clock_entry *ce;
255 unsigned long flags;
254 256
255 dev_dbg(dev, "%s()\n", __func__); 257 dev_dbg(dev, "%s()\n", __func__);
256 258
257 if (!pcd) 259 if (!pcd)
258 return 0; 260 return 0;
259 261
260 mutex_lock(&pcd->lock); 262 spin_lock_irqsave(&pcd->lock, flags);
261 263
262 list_for_each_entry(ce, &pcd->clock_list, node) { 264 list_for_each_entry(ce, &pcd->clock_list, node) {
263 if (ce->status == PCE_STATUS_NONE) 265 if (ce->status == PCE_STATUS_NONE)
@@ -269,7 +271,7 @@ int pm_clk_resume(struct device *dev)
269 } 271 }
270 } 272 }
271 273
272 mutex_unlock(&pcd->lock); 274 spin_unlock_irqrestore(&pcd->lock, flags);
273 275
274 return 0; 276 return 0;
275} 277}
@@ -344,6 +346,7 @@ int pm_clk_suspend(struct device *dev)
344{ 346{
345 struct pm_clk_data *pcd = __to_pcd(dev); 347 struct pm_clk_data *pcd = __to_pcd(dev);
346 struct pm_clock_entry *ce; 348 struct pm_clock_entry *ce;
349 unsigned long flags;
347 350
348 dev_dbg(dev, "%s()\n", __func__); 351 dev_dbg(dev, "%s()\n", __func__);
349 352
@@ -351,12 +354,12 @@ int pm_clk_suspend(struct device *dev)
351 if (!pcd || !dev->driver) 354 if (!pcd || !dev->driver)
352 return 0; 355 return 0;
353 356
354 mutex_lock(&pcd->lock); 357 spin_lock_irqsave(&pcd->lock, flags);
355 358
356 list_for_each_entry_reverse(ce, &pcd->clock_list, node) 359 list_for_each_entry_reverse(ce, &pcd->clock_list, node)
357 clk_disable(ce->clk); 360 clk_disable(ce->clk);
358 361
359 mutex_unlock(&pcd->lock); 362 spin_unlock_irqrestore(&pcd->lock, flags);
360 363
361 return 0; 364 return 0;
362} 365}
@@ -369,6 +372,7 @@ int pm_clk_resume(struct device *dev)
369{ 372{
370 struct pm_clk_data *pcd = __to_pcd(dev); 373 struct pm_clk_data *pcd = __to_pcd(dev);
371 struct pm_clock_entry *ce; 374 struct pm_clock_entry *ce;
375 unsigned long flags;
372 376
373 dev_dbg(dev, "%s()\n", __func__); 377 dev_dbg(dev, "%s()\n", __func__);
374 378
@@ -376,12 +380,12 @@ int pm_clk_resume(struct device *dev)
376 if (!pcd || !dev->driver) 380 if (!pcd || !dev->driver)
377 return 0; 381 return 0;
378 382
379 mutex_lock(&pcd->lock); 383 spin_lock_irqsave(&pcd->lock, flags);
380 384
381 list_for_each_entry(ce, &pcd->clock_list, node) 385 list_for_each_entry(ce, &pcd->clock_list, node)
382 clk_enable(ce->clk); 386 clk_enable(ce->clk);
383 387
384 mutex_unlock(&pcd->lock); 388 spin_unlock_irqrestore(&pcd->lock, flags);
385 389
386 return 0; 390 return 0;
387} 391}
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 2ec57b2fb278..a9414facda47 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1913,6 +1913,7 @@ static int __devinit sci_init_single(struct platform_device *dev,
1913 1913
1914 port->dev = &dev->dev; 1914 port->dev = &dev->dev;
1915 1915
1916 pm_runtime_irq_safe(&dev->dev);
1916 pm_runtime_enable(&dev->dev); 1917 pm_runtime_enable(&dev->dev);
1917 } 1918 }
1918 1919