Skip to content

Commit 35ec421

Browse files
committed
Merge branch 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6
* 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6: intel_idle: Voluntary leave_mm before entering deeper acpi_idle: add missing \n to printk intel_idle: add missing __percpu markup intel_idle: Change mode 755 => 644 cpuidle: Fix typos intel_idle: PCI quirk to prevent Lenovo Ideapad s10-3 boot hang
2 parents 3c72908 + 6110a1f commit 35ec421

File tree

5 files changed

+38
-7
lines changed

5 files changed

+38
-7
lines changed

drivers/acpi/processor_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ static int __init acpi_processor_init(void)
850850
printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n",
851851
acpi_idle_driver.name);
852852
} else {
853-
printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s",
853+
printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s\n",
854854
cpuidle_get_driver()->name);
855855
}
856856

drivers/cpuidle/governors/menu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
* Limiting Performance Impact
8181
* ---------------------------
8282
* C states, especially those with large exit latencies, can have a real
83-
* noticable impact on workloads, which is not acceptable for most sysadmins,
83+
* noticeable impact on workloads, which is not acceptable for most sysadmins,
8484
* and in addition, less performance has a power price of its own.
8585
*
8686
* As a general rule of thumb, menu assumes that the following heuristic

drivers/idle/intel_idle.c

100755100644
Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static unsigned int mwait_substates;
8383
/* Reliable LAPIC Timer States, bit 1 for C1 etc. */
8484
static unsigned int lapic_timer_reliable_states;
8585

86-
static struct cpuidle_device *intel_idle_cpuidle_devices;
86+
static struct cpuidle_device __percpu *intel_idle_cpuidle_devices;
8787
static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state);
8888

8989
static struct cpuidle_state *cpuidle_state_table;
@@ -108,7 +108,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
108108
.name = "NHM-C3",
109109
.desc = "MWAIT 0x10",
110110
.driver_data = (void *) 0x10,
111-
.flags = CPUIDLE_FLAG_TIME_VALID,
111+
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
112112
.exit_latency = 20,
113113
.power_usage = 500,
114114
.target_residency = 80,
@@ -117,7 +117,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
117117
.name = "NHM-C6",
118118
.desc = "MWAIT 0x20",
119119
.driver_data = (void *) 0x20,
120-
.flags = CPUIDLE_FLAG_TIME_VALID,
120+
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
121121
.exit_latency = 200,
122122
.power_usage = 350,
123123
.target_residency = 800,
@@ -149,7 +149,7 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
149149
.name = "ATM-C4",
150150
.desc = "MWAIT 0x30",
151151
.driver_data = (void *) 0x30,
152-
.flags = CPUIDLE_FLAG_TIME_VALID,
152+
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
153153
.exit_latency = 100,
154154
.power_usage = 250,
155155
.target_residency = 400,
@@ -159,7 +159,7 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
159159
.name = "ATM-C6",
160160
.desc = "MWAIT 0x40",
161161
.driver_data = (void *) 0x40,
162-
.flags = CPUIDLE_FLAG_TIME_VALID,
162+
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
163163
.exit_latency = 200,
164164
.power_usage = 150,
165165
.target_residency = 800,
@@ -185,6 +185,16 @@ static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state)
185185

186186
local_irq_disable();
187187

188+
/*
189+
* If the state flag indicates that the TLB will be flushed or if this
190+
* is the deepest c-state supported, do a voluntary leave mm to avoid
191+
* costly and mostly unnecessary wakeups for flushing the user TLB's
192+
* associated with the active mm.
193+
*/
194+
if (state->flags & CPUIDLE_FLAG_TLB_FLUSHED ||
195+
(&dev->states[dev->state_count - 1] == state))
196+
leave_mm(cpu);
197+
188198
if (!(lapic_timer_reliable_states & (1 << (cstate))))
189199
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
190200

drivers/pci/quirks.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,26 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_1, quirk_isa_d
162162
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_2, quirk_isa_dma_hangs);
163163
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs);
164164

165+
/*
166+
* Intel NM10 "TigerPoint" LPC PM1a_STS.BM_STS must be clear
167+
* for some HT machines to use C4 w/o hanging.
168+
*/
169+
static void __devinit quirk_tigerpoint_bm_sts(struct pci_dev *dev)
170+
{
171+
u32 pmbase;
172+
u16 pm1a;
173+
174+
pci_read_config_dword(dev, 0x40, &pmbase);
175+
pmbase = pmbase & 0xff80;
176+
pm1a = inw(pmbase);
177+
178+
if (pm1a & 0x10) {
179+
dev_info(&dev->dev, FW_BUG "TigerPoint LPC.BM_STS cleared\n");
180+
outw(0x10, pmbase);
181+
}
182+
}
183+
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGP_LPC, quirk_tigerpoint_bm_sts);
184+
165185
/*
166186
* Chipsets where PCI->PCI transfers vanish or hang
167187
*/

include/linux/cpuidle.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ struct cpuidle_state {
5353
#define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */
5454
#define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */
5555
#define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */
56+
#define CPUIDLE_FLAG_TLB_FLUSHED (0x200) /* tlb will be flushed */
5657

5758
#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
5859

0 commit comments

Comments
 (0)