Skip to contentSkip to conversation

ACPI patches for 2.6.25-rc7

PATCH In review Len Brown 2 participants 9 messages Mar 26, 2008

Subsystems (4)
lore
Share & tools
lore

Len Brown

author reviewer
#0 lore raw

Here is the queue for 2.6.25-rc7

thanks,
-Len

author reviewer
#1 lore raw

PATCH 1/6 ACPI: SBS: remove typo from sbchc.c

From: Alexey Starikovskiy <[email protected]>

---
 drivers/acpi/sbshc.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/acpi/sbshc.c +0 -1
index a2cf300..bcf2c70 100644
@@ -130,7 +130,6 @@ static int acpi_smbus_transaction(struct acpi_smb_hc *hc, u8 protocol,
 		goto end;
 	}
 	smb_hc_write(hc, ACPI_SMB_COMMAND, command);
-	smb_hc_write(hc, ACPI_SMB_COMMAND, command);
 	if (!(protocol & 0x01)) {
 		smb_hc_write(hc, ACPI_SMB_BLOCK_COUNT, length);
 		for (i = 0; i < length; ++i)
Signature · 1 line
1.5.5.rc1.6.g5cc8f
author reviewer
#2 lore raw

PATCH 2/6 ACPI: fix Medion _PRT quirk (use "ISA_", not "ISA")

In reply to Len Brown

From: Bjorn Helgaas <[email protected]>

This fixes the builtin RTL8139 NIC on the Medion MD9580-F laptop. The BIOS reports the interrupt routing incorrectly. I recently added a quirk to work around this, and this patch fixes a typo in the quirk.

We pad every ACPI pathname component to four characters, so ".ISA." will never match anything. We need ".ISA_." instead.

Thank you Johann-Nikolaus Andreae for patiently testing this patch.

See http://bugzilla.kernel.org/show_bug.cgi?id=4773

---
 drivers/acpi/pci_irq.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/pci_irq.c +2 -2
index 7af414a..89022a7 100644
@@ -131,8 +131,8 @@ struct prt_quirk {
  */
 static struct prt_quirk prt_quirks[] = {
 	{ medion_md9580, 0, 0, 9, 'A',
-		"\\_SB_.PCI0.ISA.LNKA",
-		"\\_SB_.PCI0.ISA.LNKB"},
+		"\\_SB_.PCI0.ISA_.LNKA",
+		"\\_SB_.PCI0.ISA_.LNKB"},
 	{ dell_optiplex, 0, 0, 0xd, 'A',
 		"\\_SB_.LNKB",
 		"\\_SB_.LNKA"},
Signature · 1 line
1.5.5.rc1.6.g5cc8f
#3 lore raw

Re: [PATCH 2/6] ACPI: fix Medion _PRT quirk (use "ISA_", not "ISA")

Quoted 6 lines · Len Brown

From: Bjorn Helgaas <[email protected]>

This fixes the builtin RTL8139 NIC on the Medion MD9580-F laptop. The BIOS reports the interrupt routing incorrectly. I recently added a quirk to work around this, and this patch fixes a typo in the quirk.

Quoted 6 lines

We pad every ACPI pathname component to four characters, so ".ISA." will never match anything. We need ".ISA_." instead.

Thank you Johann-Nikolaus Andreae for patiently testing this patch.

See http://bugzilla.kernel.org/show_bug.cgi?id=4773

This seems to have been applied already:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b97d4803400a4442b0e4ae14d0bd8e83994b9004

Quoted 13 lines
---
 drivers/acpi/pci_irq.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/pci_irq.c +0 -0
index 7af414a..89022a7 100644

drivers/acpi/pci_irq.c struct prt_quirk { · line 138

Quoted 10 lines
drivers/acpi/pci_irq.c +2 -2
@@ -131,8 +131,8 @@ struct prt_quirk {
  */
 static struct prt_quirk prt_quirks[] = {
 	{ medion_md9580, 0, 0, 9, 'A',
-		"\\_SB_.PCI0.ISA.LNKA",
-		"\\_SB_.PCI0.ISA.LNKB"},
+		"\\_SB_.PCI0.ISA_.LNKA",
+		"\\_SB_.PCI0.ISA_.LNKB"},
 	{ dell_optiplex, 0, 0, 0xd, 'A',
 		"\\_SB_.LNKB",
 		"\\_SB_.LNKA"},

Thanks,
Rafael

author reviewer
#4 lore raw

PATCH 3/6 ACPI: fix a regression of ACPI device driver autoloading

In reply to Len Brown

From: Zhang Rui <[email protected]>

commit 3620f2f2f39e7870cf1a4fb2e34063a142f28716 sets the cid of ACPI video/dock/bay device and leaves the hid empty. As a result, "modalias" should export the cid for devices which don't have a hid.

ACPI Video driver is not autoloaded with
commit 3620f2f2f39e7870cf1a4fb2e34063a142f28716 applied. "cat /sys/.../device:03(acpi video bus)/modalias" shows nothing.

ACPI Video driver is autoloaded after revert that commit. "cat /sys/.../LNXVIDEO:0x/modalias" shows "acpi:LNXVIDEO:"

ACPI Video driver is autoloaded with commit 3620f2f2f39e7870cf1a4fb2e34063a142f28716 and this patch applied. "cat /sys/.../device:03(acpi video bus)/modalias" shows "acpi:LNXVIDEO:"

---
 drivers/acpi/scan.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
drivers/acpi/scan.c +12 -6
index 57570ac..e6ce262 100644
@@ -39,20 +39,26 @@ static int create_modalias(struct acpi_device *acpi_dev, char *modalias,
 			   int size)
 {
 	int len;
+	int count;
 
-	if (!acpi_dev->flags.hardware_id)
+	if (!acpi_dev->flags.hardware_id && !acpi_dev->flags.compatible_ids)
 		return -ENODEV;
 
-	len = snprintf(modalias, size, "acpi:%s:",
-		       acpi_dev->pnp.hardware_id);
-	if (len < 0 || len >= size)
-		return -EINVAL;
+	len = snprintf(modalias, size, "acpi:");
 	size -= len;
 
+	if (acpi_dev->flags.hardware_id) {
+		count = snprintf(&modalias[len], size, "%s:",
+				 acpi_dev->pnp.hardware_id);
+		if (count < 0 || count >= size)
+			return -EINVAL;
+		len += count;
+		size -= count;
+	}
+
 	if (acpi_dev->flags.compatible_ids) {
 		struct acpi_compatible_id_list *cid_list;
 		int i;
-		int count;
 
 		cid_list = acpi_dev->pnp.cid_list;
 		for (i = 0; i < cid_list->count; i++) {
Signature · 1 line
1.5.5.rc1.6.g5cc8f
author reviewer
#5 lore raw

PATCH 4/6 ACPI: fix mis-merge -- invoke acpi_unlazy_tlb() only on C3 entry

In reply to Len Brown

From: Venki Pallipadi <[email protected]>

This original patch
http://ussg.iu.edu/hypermail/linux/kernel/0712.2/1451.html
was intending to add acpi_unlazy_tlb() to acpi_idle_enter_bm(), which is used for C3 entry.

But it was merged incorrectly as commmit

bde6f5f59c2b2b48a7a849c129d5b48838fe77ee
'x86: voluntary leave_mm before entering ACPI C3'

so the call was instead added to acpi_idle_enter_simple() (which is C2 entry routine), probably due to identical context in that function.

Move the call back to acpi_idle_enter_bm().

---
 drivers/acpi/processor_idle.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/acpi/processor_idle.c +2 -1
index e8e2d88..1468f1e 100644
@@ -1487,7 +1487,6 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
 		return 0;
 	}
 
-	acpi_unlazy_tlb(smp_processor_id());
 	/*
 	 * Must be done before busmaster disable as we might need to
 	 * access HPET !
@@ -1577,6 +1576,8 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
 		return 0;
 	}
 
+	acpi_unlazy_tlb(smp_processor_id());
+
 	/* Tell the scheduler that we are going deep-idle: */
 	sched_clock_idle_sleep_event();
 	/*
Signature · 1 line
1.5.5.rc1.6.g5cc8f
author reviewer
#6 lore raw

PATCH 5/6 cpuidle: fix cpuidle time and usage overflow

In reply to Len Brown

From: Yi Yang <[email protected]>

cpuidle C-state sysfs node time and usage are very easy to overflow because they are all of unsigned int type, time will overflow within about two hours, usage will take longer time to overflow, but they are increasing for ever.

This patch will convert them to unsigned long long.

---
 drivers/cpuidle/cpuidle.c |    2 +-
 drivers/cpuidle/sysfs.c   |   10 ++++++++--
 include/linux/cpuidle.h   |    4 ++--
 3 files changed, 11 insertions(+), 5 deletions(-)
drivers/cpuidle/cpuidle.c +1 -1
index d73663a..d42deb3 100644
@@ -67,7 +67,7 @@ static void cpuidle_idle_call(void)
 	/* enter the state and update stats */
 	dev->last_residency = target_state->enter(dev, target_state);
 	dev->last_state = target_state;
-	target_state->time += dev->last_residency;
+	target_state->time += (unsigned long long)dev->last_residency;
 	target_state->usage++;
 
 	/* give the governor an opportunity to reflect on the outcome */
drivers/cpuidle/sysfs.c +8 -2
index 69102ca..e949618 100644
@@ -218,6 +218,12 @@ static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
 	return sprintf(buf, "%u\n", state->_name);\
 }
 
+#define define_show_state_ull_function(_name) \
+static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
+{ \
+	return sprintf(buf, "%llu\n", state->_name);\
+}
+
 #define define_show_state_str_function(_name) \
 static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
 { \
@@ -228,8 +234,8 @@ static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
 
 define_show_state_function(exit_latency)
 define_show_state_function(power_usage)
-define_show_state_function(usage)
-define_show_state_function(time)
+define_show_state_ull_function(usage)
+define_show_state_ull_function(time)
 define_show_state_str_function(name)
 define_show_state_str_function(desc)
 
include/linux/cpuidle.h +2 -2
index 6b72a45..51e6b1e 100644
@@ -38,8 +38,8 @@ struct cpuidle_state {
 	unsigned int	power_usage; /* in mW */
 	unsigned int	target_residency; /* in US */
 
-	unsigned int	usage;
-	unsigned int	time; /* in US */
+	unsigned long long	usage;
+	unsigned long long	time; /* in US */
 
 	int (*enter)	(struct cpuidle_device *dev,
 			 struct cpuidle_state *state);
Signature · 1 line
1.5.5.rc1.6.g5cc8f
author reviewer
#7 lore raw

PATCH 6/6 cpuidle: fix 100% C0 statistics regression

In reply to Len Brown

From: Venki Pallipadi <[email protected]>

commit 9b12e18cdc1553de62d931e73443c806347cd974
'ACPI: cpuidle: Support C1 idle time accounting'
was implicated in a 100% C0 idle regression.
http://bugzilla.kernel.org/show_bug.cgi?id=10076

It pointed out a potential problem where the menu governor may get confused by the C-state residency time from poll idle or C1 idle, where this timing info is not accurate. This inaccuracy is due to interrupts being handled before we account for C-state exit.

Do not mark TIME_VALID for CO poll state.
Mark C1 time as valid only with the MWAIT (CSTATE_FFH) entry method.

This makes governors use the timing information only when it is correct and eliminates any wrong policy decisions that may result from invalid timing information.

---
 drivers/acpi/processor_idle.c |    4 +++-
 drivers/cpuidle/cpuidle.c     |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/acpi/processor_idle.c +3 -1
index 1468f1e..788da97 100644
@@ -1693,7 +1693,9 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
 		switch (cx->type) {
 			case ACPI_STATE_C1:
 			state->flags |= CPUIDLE_FLAG_SHALLOW;
-			state->flags |= CPUIDLE_FLAG_TIME_VALID;
+			if (cx->entry_method == ACPI_CSTATE_FFH)
+				state->flags |= CPUIDLE_FLAG_TIME_VALID;
+
 			state->enter = acpi_idle_enter_c1;
 			dev->safe_state = state;
 			break;
drivers/cpuidle/cpuidle.c +1 -1
index d42deb3..fc555a9 100644
@@ -224,7 +224,7 @@ static void poll_idle_init(struct cpuidle_device *dev)
 	state->exit_latency = 0;
 	state->target_residency = 0;
 	state->power_usage = -1;
-	state->flags = CPUIDLE_FLAG_POLL | CPUIDLE_FLAG_TIME_VALID;
+	state->flags = CPUIDLE_FLAG_POLL;
 	state->enter = poll_idle;
 }
 #else
Signature · 1 line
1.5.5.rc1.6.g5cc8f
author reviewer
#8 lore raw

[PATCH 7/6] pnpacpi: reduce printk severity for "pnpacpi: exceeded the max number of ..."

In reply to Len Brown

From: Len Brown <[email protected]>

We have been printing these messages at KERN_ERR since 2.6.24, per http://bugzilla.kernel.org/show_bug.cgi?id=9535

But KERN_ERR pops up on a console booted with "quiet" and causes users to get alarmed and file bugs about the message itself:
https://bugzilla.redhat.com/show_bug.cgi?id=436589

So reduce the severity of these messages to KERN_WARNING, which is not printed by "quiet".

This message will still be seen without "quiet", but a lot of messages are printed in that mode and it will be less likely to cause undue alarm.

We could go all the way to KERN_DEBUG, but this is a real warning after all, so it seems prudent not to require "debug" to see it.

---
 drivers/pnp/pnpacpi/rsparser.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/pnp/pnpacpi/rsparser.c +4 -4
index 6aa231e..2dcd196 100644
@@ -85,7 +85,7 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res,
 	       i < PNP_MAX_IRQ)
 		i++;
 	if (i >= PNP_MAX_IRQ && !warned) {
-		printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ "
+		printk(KERN_WARNING "pnpacpi: exceeded the max number of IRQ "
 				"resources: %d \n", PNP_MAX_IRQ);
 		warned = 1;
 		return;
@@ -187,7 +187,7 @@ static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res,
 		res->dma_resource[i].start = dma;
 		res->dma_resource[i].end = dma;
 	} else if (!warned) {
-		printk(KERN_ERR "pnpacpi: exceeded the max number of DMA "
+		printk(KERN_WARNING "pnpacpi: exceeded the max number of DMA "
 				"resources: %d \n", PNP_MAX_DMA);
 		warned = 1;
 	}
@@ -213,7 +213,7 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res,
 		res->port_resource[i].start = io;
 		res->port_resource[i].end = io + len - 1;
 	} else if (!warned) {
-		printk(KERN_ERR "pnpacpi: exceeded the max number of IO "
+		printk(KERN_WARNING "pnpacpi: exceeded the max number of IO "
 				"resources: %d \n", PNP_MAX_PORT);
 		warned = 1;
 	}
@@ -241,7 +241,7 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res,
 		res->mem_resource[i].start = mem;
 		res->mem_resource[i].end = mem + len - 1;
 	} else if (!warned) {
-		printk(KERN_ERR "pnpacpi: exceeded the max number of mem "
+		printk(KERN_WARNING "pnpacpi: exceeded the max number of mem "
 				"resources: %d\n", PNP_MAX_MEM);
 		warned = 1;
 	}
Signature · 1 line
1.5.5.rc1.6.g5cc8f