Skip to content

Commit 1726806

Browse files
committed
---
yaml --- r: 143293 b: "refs/heads/rpi-3.2.27+kamal-st7735fb" c: 8897c18 h: "refs/heads/rpi-3.2.27+kamal-st7735fb" i: 143291: e71cba8 v: v3
1 parent 0ba3759 commit 1726806

File tree

16 files changed

+121
-249
lines changed

16 files changed

+121
-249
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
"refs/heads/rpi-3.2.27+kamal-st7735fb": db954b5898dd3ef3ef93f4144158ea8f97deb058
2+
"refs/heads/rpi-3.2.27+kamal-st7735fb": 8897c1859521cf33077256725b2377164b130c75

trunk/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ struct acpi_cpufreq_data {
6868
unsigned int max_freq;
6969
unsigned int resume;
7070
unsigned int cpu_feature;
71+
u64 saved_aperf, saved_mperf;
7172
};
7273

7374
static DEFINE_PER_CPU(struct acpi_cpufreq_data *, drv_data);
@@ -241,26 +242,23 @@ static u32 get_cur_val(const struct cpumask *mask)
241242
return cmd.val;
242243
}
243244

244-
struct perf_cur {
245+
struct perf_pair {
245246
union {
246247
struct {
247248
u32 lo;
248249
u32 hi;
249250
} split;
250251
u64 whole;
251-
} aperf_cur, mperf_cur;
252+
} aperf, mperf;
252253
};
253254

254255

255256
static long read_measured_perf_ctrs(void *_cur)
256257
{
257-
struct perf_cur *cur = _cur;
258+
struct perf_pair *cur = _cur;
258259

259-
rdmsr(MSR_IA32_APERF, cur->aperf_cur.split.lo, cur->aperf_cur.split.hi);
260-
rdmsr(MSR_IA32_MPERF, cur->mperf_cur.split.lo, cur->mperf_cur.split.hi);
261-
262-
wrmsr(MSR_IA32_APERF, 0, 0);
263-
wrmsr(MSR_IA32_MPERF, 0, 0);
260+
rdmsr(MSR_IA32_APERF, cur->aperf.split.lo, cur->aperf.split.hi);
261+
rdmsr(MSR_IA32_MPERF, cur->mperf.split.lo, cur->mperf.split.hi);
264262

265263
return 0;
266264
}
@@ -281,52 +279,57 @@ static long read_measured_perf_ctrs(void *_cur)
281279
static unsigned int get_measured_perf(struct cpufreq_policy *policy,
282280
unsigned int cpu)
283281
{
284-
struct perf_cur cur;
282+
struct perf_pair readin, cur;
285283
unsigned int perf_percent;
286284
unsigned int retval;
287285

288-
if (!work_on_cpu(cpu, read_measured_perf_ctrs, &cur))
286+
if (!work_on_cpu(cpu, read_measured_perf_ctrs, &readin))
289287
return 0;
290288

289+
cur.aperf.whole = readin.aperf.whole -
290+
per_cpu(drv_data, cpu)->saved_aperf;
291+
cur.mperf.whole = readin.mperf.whole -
292+
per_cpu(drv_data, cpu)->saved_mperf;
293+
per_cpu(drv_data, cpu)->saved_aperf = readin.aperf.whole;
294+
per_cpu(drv_data, cpu)->saved_mperf = readin.mperf.whole;
295+
291296
#ifdef __i386__
292297
/*
293298
* We dont want to do 64 bit divide with 32 bit kernel
294299
* Get an approximate value. Return failure in case we cannot get
295300
* an approximate value.
296301
*/
297-
if (unlikely(cur.aperf_cur.split.hi || cur.mperf_cur.split.hi)) {
302+
if (unlikely(cur.aperf.split.hi || cur.mperf.split.hi)) {
298303
int shift_count;
299304
u32 h;
300305

301-
h = max_t(u32, cur.aperf_cur.split.hi, cur.mperf_cur.split.hi);
306+
h = max_t(u32, cur.aperf.split.hi, cur.mperf.split.hi);
302307
shift_count = fls(h);
303308

304-
cur.aperf_cur.whole >>= shift_count;
305-
cur.mperf_cur.whole >>= shift_count;
309+
cur.aperf.whole >>= shift_count;
310+
cur.mperf.whole >>= shift_count;
306311
}
307312

308-
if (((unsigned long)(-1) / 100) < cur.aperf_cur.split.lo) {
313+
if (((unsigned long)(-1) / 100) < cur.aperf.split.lo) {
309314
int shift_count = 7;
310-
cur.aperf_cur.split.lo >>= shift_count;
311-
cur.mperf_cur.split.lo >>= shift_count;
315+
cur.aperf.split.lo >>= shift_count;
316+
cur.mperf.split.lo >>= shift_count;
312317
}
313318

314-
if (cur.aperf_cur.split.lo && cur.mperf_cur.split.lo)
315-
perf_percent = (cur.aperf_cur.split.lo * 100) /
316-
cur.mperf_cur.split.lo;
319+
if (cur.aperf.split.lo && cur.mperf.split.lo)
320+
perf_percent = (cur.aperf.split.lo * 100) / cur.mperf.split.lo;
317321
else
318322
perf_percent = 0;
319323

320324
#else
321-
if (unlikely(((unsigned long)(-1) / 100) < cur.aperf_cur.whole)) {
325+
if (unlikely(((unsigned long)(-1) / 100) < cur.aperf.whole)) {
322326
int shift_count = 7;
323-
cur.aperf_cur.whole >>= shift_count;
324-
cur.mperf_cur.whole >>= shift_count;
327+
cur.aperf.whole >>= shift_count;
328+
cur.mperf.whole >>= shift_count;
325329
}
326330

327-
if (cur.aperf_cur.whole && cur.mperf_cur.whole)
328-
perf_percent = (cur.aperf_cur.whole * 100) /
329-
cur.mperf_cur.whole;
331+
if (cur.aperf.whole && cur.mperf.whole)
332+
perf_percent = (cur.aperf.whole * 100) / cur.mperf.whole;
330333
else
331334
perf_percent = 0;
332335

trunk/arch/x86/kernel/cpu/cpufreq/longhaul.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include <linux/timex.h>
3434
#include <linux/io.h>
3535
#include <linux/acpi.h>
36-
#include <linux/kernel.h>
3736

3837
#include <asm/msr.h>
3938
#include <acpi/processor.h>

trunk/drivers/acpi/acpica/hwvalid.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ static const struct acpi_port_info acpi_protected_ports[] = {
9090
{"PIT2", 0x0048, 0x004B, ACPI_OSI_WIN_XP},
9191
{"RTC", 0x0070, 0x0071, ACPI_OSI_WIN_XP},
9292
{"CMOS", 0x0074, 0x0076, ACPI_OSI_WIN_XP},
93-
{"DMA1", 0x0081, 0x0083, ACPI_OSI_WIN_XP},
9493
{"DMA1L", 0x0087, 0x0087, ACPI_OSI_WIN_XP},
9594
{"DMA2", 0x0089, 0x008B, ACPI_OSI_WIN_XP},
9695
{"DMA2L", 0x008F, 0x008F, ACPI_OSI_WIN_XP},

trunk/drivers/acpi/battery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ static struct acpi_driver acpi_battery_driver = {
903903
},
904904
};
905905

906-
static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie)
906+
static void acpi_battery_init_async(void *unused, async_cookie_t cookie)
907907
{
908908
if (acpi_disabled)
909909
return;

trunk/drivers/acpi/proc.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -343,25 +343,21 @@ acpi_system_write_alarm(struct file *file,
343343
}
344344
#endif /* HAVE_ACPI_LEGACY_ALARM */
345345

346-
extern struct list_head acpi_wakeup_device_list;
347-
extern spinlock_t acpi_device_lock;
348-
349346
static int
350347
acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset)
351348
{
352349
struct list_head *node, *next;
353350

354351
seq_printf(seq, "Device\tS-state\t Status Sysfs node\n");
355352

356-
spin_lock(&acpi_device_lock);
353+
mutex_lock(&acpi_device_lock);
357354
list_for_each_safe(node, next, &acpi_wakeup_device_list) {
358355
struct acpi_device *dev =
359356
container_of(node, struct acpi_device, wakeup_list);
360357
struct device *ldev;
361358

362359
if (!dev->wakeup.flags.valid)
363360
continue;
364-
spin_unlock(&acpi_device_lock);
365361

366362
ldev = acpi_get_physical_device(dev->handle);
367363
seq_printf(seq, "%s\t S%d\t%c%-8s ",
@@ -376,9 +372,8 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset)
376372
seq_printf(seq, "\n");
377373
put_device(ldev);
378374

379-
spin_lock(&acpi_device_lock);
380375
}
381-
spin_unlock(&acpi_device_lock);
376+
mutex_unlock(&acpi_device_lock);
382377
return 0;
383378
}
384379

@@ -409,7 +404,7 @@ acpi_system_write_wakeup_device(struct file *file,
409404
strbuf[len] = '\0';
410405
sscanf(strbuf, "%s", str);
411406

412-
spin_lock(&acpi_device_lock);
407+
mutex_lock(&acpi_device_lock);
413408
list_for_each_safe(node, next, &acpi_wakeup_device_list) {
414409
struct acpi_device *dev =
415410
container_of(node, struct acpi_device, wakeup_list);
@@ -446,7 +441,7 @@ acpi_system_write_wakeup_device(struct file *file,
446441
}
447442
}
448443
}
449-
spin_unlock(&acpi_device_lock);
444+
mutex_unlock(&acpi_device_lock);
450445
return count;
451446
}
452447

trunk/drivers/acpi/scan.c

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ extern struct acpi_device *acpi_root;
2424

2525
static LIST_HEAD(acpi_device_list);
2626
static LIST_HEAD(acpi_bus_id_list);
27-
DEFINE_SPINLOCK(acpi_device_lock);
27+
DEFINE_MUTEX(acpi_device_lock);
2828
LIST_HEAD(acpi_wakeup_device_list);
2929

3030
struct acpi_device_bus_id{
@@ -491,7 +491,6 @@ static int acpi_device_register(struct acpi_device *device,
491491
*/
492492
INIT_LIST_HEAD(&device->children);
493493
INIT_LIST_HEAD(&device->node);
494-
INIT_LIST_HEAD(&device->g_list);
495494
INIT_LIST_HEAD(&device->wakeup_list);
496495

497496
new_bus_id = kzalloc(sizeof(struct acpi_device_bus_id), GFP_KERNEL);
@@ -500,7 +499,7 @@ static int acpi_device_register(struct acpi_device *device,
500499
return -ENOMEM;
501500
}
502501

503-
spin_lock(&acpi_device_lock);
502+
mutex_lock(&acpi_device_lock);
504503
/*
505504
* Find suitable bus_id and instance number in acpi_bus_id_list
506505
* If failed, create one and link it into acpi_bus_id_list
@@ -521,14 +520,12 @@ static int acpi_device_register(struct acpi_device *device,
521520
}
522521
dev_set_name(&device->dev, "%s:%02x", acpi_device_bus_id->bus_id, acpi_device_bus_id->instance_no);
523522

524-
if (device->parent) {
523+
if (device->parent)
525524
list_add_tail(&device->node, &device->parent->children);
526-
list_add_tail(&device->g_list, &device->parent->g_list);
527-
} else
528-
list_add_tail(&device->g_list, &acpi_device_list);
525+
529526
if (device->wakeup.flags.valid)
530527
list_add_tail(&device->wakeup_list, &acpi_wakeup_device_list);
531-
spin_unlock(&acpi_device_lock);
528+
mutex_unlock(&acpi_device_lock);
532529

533530
if (device->parent)
534531
device->dev.parent = &parent->dev;
@@ -549,28 +546,22 @@ static int acpi_device_register(struct acpi_device *device,
549546
device->removal_type = ACPI_BUS_REMOVAL_NORMAL;
550547
return 0;
551548
end:
552-
spin_lock(&acpi_device_lock);
553-
if (device->parent) {
549+
mutex_lock(&acpi_device_lock);
550+
if (device->parent)
554551
list_del(&device->node);
555-
list_del(&device->g_list);
556-
} else
557-
list_del(&device->g_list);
558552
list_del(&device->wakeup_list);
559-
spin_unlock(&acpi_device_lock);
553+
mutex_unlock(&acpi_device_lock);
560554
return result;
561555
}
562556

563557
static void acpi_device_unregister(struct acpi_device *device, int type)
564558
{
565-
spin_lock(&acpi_device_lock);
566-
if (device->parent) {
559+
mutex_lock(&acpi_device_lock);
560+
if (device->parent)
567561
list_del(&device->node);
568-
list_del(&device->g_list);
569-
} else
570-
list_del(&device->g_list);
571562

572563
list_del(&device->wakeup_list);
573-
spin_unlock(&acpi_device_lock);
564+
mutex_unlock(&acpi_device_lock);
574565

575566
acpi_detach_data(device->handle, acpi_bus_data_handler);
576567

trunk/drivers/acpi/sleep.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ extern int acpi_suspend (u32 state);
55
extern void acpi_enable_wakeup_device_prep(u8 sleep_state);
66
extern void acpi_enable_wakeup_device(u8 sleep_state);
77
extern void acpi_disable_wakeup_device(u8 sleep_state);
8+
9+
extern struct list_head acpi_wakeup_device_list;
10+
extern struct mutex acpi_device_lock;

0 commit comments

Comments
 (0)