Skip to content

Commit 8897c18

Browse files
committed
Merge branches 'release', 'APERF', 'ARAT', 'misc', 'kelvin', 'device-lock' and 'bjorn.notify' into release
6 parents 18b2646 + db954b5 + fdbdc7f + 13614e3 + 33b5715 + f61bb93 commit 8897c18

File tree

18 files changed

+102
-222
lines changed

18 files changed

+102
-222
lines changed

arch/x86/include/asm/cpufeature.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
* CPUID levels like 0x6, 0xA etc
155155
*/
156156
#define X86_FEATURE_IDA (7*32+ 0) /* Intel Dynamic Acceleration */
157+
#define X86_FEATURE_ARAT (7*32+ 1) /* Always Running APIC Timer */
157158

158159
/* Virtualization flags: Linux defined */
159160
#define X86_FEATURE_TPR_SHADOW (8*32+ 0) /* Intel TPR Shadow */

arch/x86/kernel/apic/apic.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,12 @@ static void __cpuinit setup_APIC_timer(void)
431431
{
432432
struct clock_event_device *levt = &__get_cpu_var(lapic_events);
433433

434+
if (cpu_has(&current_cpu_data, X86_FEATURE_ARAT)) {
435+
lapic_clockevent.features &= ~CLOCK_EVT_FEAT_C3STOP;
436+
/* Make LAPIC timer preferrable over percpu HPET */
437+
lapic_clockevent.rating = 150;
438+
}
439+
434440
memcpy(levt, &lapic_clockevent, sizeof(*levt));
435441
levt->cpumask = cpumask_of(smp_processor_id());
436442

arch/x86/kernel/cpu/addon_cpuid_features.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
3131

3232
static const struct cpuid_bit __cpuinitconst cpuid_bits[] = {
3333
{ X86_FEATURE_IDA, CR_EAX, 1, 0x00000006 },
34+
{ X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006 },
3435
{ 0, 0, 0, 0 }
3536
};
3637

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>

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},

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;

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

drivers/acpi/processor_idle.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ static void acpi_timer_check_state(int state, struct acpi_processor *pr,
145145
struct acpi_processor_power *pwr = &pr->power;
146146
u8 type = local_apic_timer_c2_ok ? ACPI_STATE_C3 : ACPI_STATE_C2;
147147

148+
if (cpu_has(&cpu_data(pr->id), X86_FEATURE_ARAT))
149+
return;
150+
148151
/*
149152
* Check, if one of the previous states already marked the lapic
150153
* unstable

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

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)