Skip to content

Commit c11a7e2

Browse files
committed
Merge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ARM: mach-shmobile: sh7372 LCDC1 suspend fix V2 (incremental) OMAP: omap_device: only override _noirq methods, not normal suspend/resume PM / Runtime: Correct documentation of pm_runtime_irq_safe() ARM: mach-shmobile: sh7372 LCDC1 suspend fix sh-sci / PM: Use power.irq_safe PM: Use spinlock instead of mutex in clock management functions
2 parents 219f358 + d0168fd commit c11a7e2

File tree

7 files changed

+30
-21
lines changed

7 files changed

+30
-21
lines changed

Documentation/power/runtime_pm.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
431431

432432
void pm_runtime_irq_safe(struct device *dev);
433433
- 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
435-
with interrupts disabled
434+
callbacks to be invoked with interrupts off
436435

437436
void pm_runtime_mark_last_busy(struct device *dev);
438437
- set the power.last_busy field to the current time

arch/arm/mach-shmobile/board-ap4evb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,7 @@ static void __init ap4evb_init(void)
14121412
fsi_init_pm_clock();
14131413
sh7372_pm_init();
14141414
pm_clk_add(&fsi_device.dev, "spu2");
1415+
pm_clk_add(&lcdc1_device.dev, "hdmi");
14151416
}
14161417

14171418
static void __init ap4evb_timer_init(void)

arch/arm/mach-shmobile/board-mackerel.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,6 +1588,7 @@ static void __init mackerel_init(void)
15881588
hdmi_init_pm_clock();
15891589
sh7372_pm_init();
15901590
pm_clk_add(&fsi_device.dev, "spu2");
1591+
pm_clk_add(&hdmi_lcdc_device.dev, "hdmi");
15911592
}
15921593

15931594
static void __init mackerel_timer_init(void)

arch/arm/mach-shmobile/clock-sh7372.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,8 @@ static struct clk_lookup lookups[] = {
655655
CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[MSTP406]), /* USB1 */
656656
CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
657657

658+
CLKDEV_ICK_ID("hdmi", "sh_mobile_lcdc_fb.1",
659+
&div6_reparent_clks[DIV6_HDMI]),
658660
CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]),
659661
CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]),
660662
CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]),

arch/arm/plat-omap/omap_device.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,8 @@ static struct dev_pm_domain omap_device_pm_domain = {
622622
SET_RUNTIME_PM_OPS(_od_runtime_suspend, _od_runtime_resume,
623623
_od_runtime_idle)
624624
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,
626627
}
627628
};
628629

drivers/base/power/clock_ops.c

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
struct pm_clk_data {
2121
struct list_head clock_list;
22-
struct mutex lock;
22+
spinlock_t lock;
2323
};
2424

2525
enum pce_status {
@@ -73,18 +73,18 @@ int pm_clk_add(struct device *dev, const char *con_id)
7373
}
7474
}
7575

76-
mutex_lock(&pcd->lock);
76+
spin_lock_irq(&pcd->lock);
7777
list_add_tail(&ce->node, &pcd->clock_list);
78-
mutex_unlock(&pcd->lock);
78+
spin_unlock_irq(&pcd->lock);
7979
return 0;
8080
}
8181

8282
/**
8383
* __pm_clk_remove - Destroy PM clock entry.
8484
* @ce: PM clock entry to destroy.
8585
*
86-
* This routine must be called under the mutex protecting the PM list of clocks
87-
* corresponding the the @ce's device.
86+
* This routine must be called under the spinlock protecting the PM list of
87+
* clocks corresponding the the @ce's device.
8888
*/
8989
static void __pm_clk_remove(struct pm_clock_entry *ce)
9090
{
@@ -123,7 +123,7 @@ void pm_clk_remove(struct device *dev, const char *con_id)
123123
if (!pcd)
124124
return;
125125

126-
mutex_lock(&pcd->lock);
126+
spin_lock_irq(&pcd->lock);
127127

128128
list_for_each_entry(ce, &pcd->clock_list, node) {
129129
if (!con_id && !ce->con_id) {
@@ -137,7 +137,7 @@ void pm_clk_remove(struct device *dev, const char *con_id)
137137
}
138138
}
139139

140-
mutex_unlock(&pcd->lock);
140+
spin_unlock_irq(&pcd->lock);
141141
}
142142

143143
/**
@@ -158,7 +158,7 @@ int pm_clk_init(struct device *dev)
158158
}
159159

160160
INIT_LIST_HEAD(&pcd->clock_list);
161-
mutex_init(&pcd->lock);
161+
spin_lock_init(&pcd->lock);
162162
dev->power.subsys_data = pcd;
163163
return 0;
164164
}
@@ -181,12 +181,12 @@ void pm_clk_destroy(struct device *dev)
181181

182182
dev->power.subsys_data = NULL;
183183

184-
mutex_lock(&pcd->lock);
184+
spin_lock_irq(&pcd->lock);
185185

186186
list_for_each_entry_safe_reverse(ce, c, &pcd->clock_list, node)
187187
__pm_clk_remove(ce);
188188

189-
mutex_unlock(&pcd->lock);
189+
spin_unlock_irq(&pcd->lock);
190190

191191
kfree(pcd);
192192
}
@@ -220,13 +220,14 @@ int pm_clk_suspend(struct device *dev)
220220
{
221221
struct pm_clk_data *pcd = __to_pcd(dev);
222222
struct pm_clock_entry *ce;
223+
unsigned long flags;
223224

224225
dev_dbg(dev, "%s()\n", __func__);
225226

226227
if (!pcd)
227228
return 0;
228229

229-
mutex_lock(&pcd->lock);
230+
spin_lock_irqsave(&pcd->lock, flags);
230231

231232
list_for_each_entry_reverse(ce, &pcd->clock_list, node) {
232233
if (ce->status == PCE_STATUS_NONE)
@@ -238,7 +239,7 @@ int pm_clk_suspend(struct device *dev)
238239
}
239240
}
240241

241-
mutex_unlock(&pcd->lock);
242+
spin_unlock_irqrestore(&pcd->lock, flags);
242243

243244
return 0;
244245
}
@@ -251,13 +252,14 @@ int pm_clk_resume(struct device *dev)
251252
{
252253
struct pm_clk_data *pcd = __to_pcd(dev);
253254
struct pm_clock_entry *ce;
255+
unsigned long flags;
254256

255257
dev_dbg(dev, "%s()\n", __func__);
256258

257259
if (!pcd)
258260
return 0;
259261

260-
mutex_lock(&pcd->lock);
262+
spin_lock_irqsave(&pcd->lock, flags);
261263

262264
list_for_each_entry(ce, &pcd->clock_list, node) {
263265
if (ce->status == PCE_STATUS_NONE)
@@ -269,7 +271,7 @@ int pm_clk_resume(struct device *dev)
269271
}
270272
}
271273

272-
mutex_unlock(&pcd->lock);
274+
spin_unlock_irqrestore(&pcd->lock, flags);
273275

274276
return 0;
275277
}
@@ -344,19 +346,20 @@ int pm_clk_suspend(struct device *dev)
344346
{
345347
struct pm_clk_data *pcd = __to_pcd(dev);
346348
struct pm_clock_entry *ce;
349+
unsigned long flags;
347350

348351
dev_dbg(dev, "%s()\n", __func__);
349352

350353
/* If there is no driver, the clocks are already disabled. */
351354
if (!pcd || !dev->driver)
352355
return 0;
353356

354-
mutex_lock(&pcd->lock);
357+
spin_lock_irqsave(&pcd->lock, flags);
355358

356359
list_for_each_entry_reverse(ce, &pcd->clock_list, node)
357360
clk_disable(ce->clk);
358361

359-
mutex_unlock(&pcd->lock);
362+
spin_unlock_irqrestore(&pcd->lock, flags);
360363

361364
return 0;
362365
}
@@ -369,19 +372,20 @@ int pm_clk_resume(struct device *dev)
369372
{
370373
struct pm_clk_data *pcd = __to_pcd(dev);
371374
struct pm_clock_entry *ce;
375+
unsigned long flags;
372376

373377
dev_dbg(dev, "%s()\n", __func__);
374378

375379
/* If there is no driver, the clocks should remain disabled. */
376380
if (!pcd || !dev->driver)
377381
return 0;
378382

379-
mutex_lock(&pcd->lock);
383+
spin_lock_irqsave(&pcd->lock, flags);
380384

381385
list_for_each_entry(ce, &pcd->clock_list, node)
382386
clk_enable(ce->clk);
383387

384-
mutex_unlock(&pcd->lock);
388+
spin_unlock_irqrestore(&pcd->lock, flags);
385389

386390
return 0;
387391
}

drivers/tty/serial/sh-sci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,6 +1913,7 @@ static int __devinit sci_init_single(struct platform_device *dev,
19131913

19141914
port->dev = &dev->dev;
19151915

1916+
pm_runtime_irq_safe(&dev->dev);
19161917
pm_runtime_enable(&dev->dev);
19171918
}
19181919

0 commit comments

Comments
 (0)