From 4d2fafd17a325b3f4f5f9edb1211bc7f4c311269 Mon Sep 17 00:00:00 2001 From: Tear Date: Wed, 23 May 2007 14:12:30 -0700 Subject: [PATCH 01/10] ACPI: Remove Dell Optiplex GX240 from the ACPI blacklist I have a Dell Optiplex GX240 and when I boot Linux, ACPI gets set up by only acpi=ht. dmesg shows the following line: DELL GX240 detected: force use of acpi=ht Everything seemed to be fine. However, I discovered that everything is not fine. The USB controller works so slowly that copying a few (uncached) 1 megabyte large photos from a USB-enabled digital camera takes many minutes instead of a couple of seconds. I am using Linux 2.6.21.1 on a Debian 4.0 ("Etch") system. I thought that this might be related to ACPI. So I tried to boot with _only_ "acpi=force" appended to the kernel command line. Voila, the USB controller started to work at full speed and copying photos from my digital camera took only seconds. I tested the system with "acpi=force" and could not find anything which did not work. I thought that this might be related to interrupts and APIC as well. (Note that this is APIC, not ACPI.) I tried booting with _only_ "noapic" and "nolapic" appended to the command line. Again, the USB controller started to work at full speed. Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- arch/i386/kernel/acpi/boot.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index 280898b045b2..a2c8b9efd700 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c @@ -969,14 +969,6 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "PRIMERGY T850"), }, }, - { - .callback = force_acpi_ht, - .ident = "DELL GX240", - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Dell Computer Corporation"), - DMI_MATCH(DMI_BOARD_NAME, "OptiPlex GX240"), - }, - }, { .callback = force_acpi_ht, .ident = "HP VISUALIZE NT Workstation", From e4d49531dcc2f334205d99614164ea900216b1cb Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Thu, 8 Mar 2007 17:57:31 +0100 Subject: [PATCH 02/10] ACPI: asus_acpi: Do not load if no device has been found asus_acpi_init() has a hack to prevent the driver from loading when asus_hotk_add() fails. However, it was returning the successful return value of acpi_bug_registger_driver() on failure. This caused an oops on unload. Instead it should return -ENODEV. Signed-off-by: Thomas Renninger Signed-off-by: Len Brown --- drivers/acpi/asus_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c index 6d7d4157e049..45360dfab2c6 100644 --- a/drivers/acpi/asus_acpi.c +++ b/drivers/acpi/asus_acpi.c @@ -1398,7 +1398,7 @@ static int __init asus_acpi_init(void) if (!asus_hotk_found) { acpi_bus_unregister_driver(&asus_hotk_driver); remove_proc_entry(PROC_ASUS, acpi_root_dir); - return result; + return -ENODEV; } asus_backlight_device = backlight_device_register("asus",NULL,NULL, From 1c1558ec50618c4a179e0684037d9f7bb0c1a326 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 3 Jul 2007 01:28:49 -0400 Subject: [PATCH 03/10] ACPI: delete cmdline documentation for deleted hotkey code This looks like left over text in the kernel parameters documentation. Signed-off-by: Stephen Hemminger Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- Documentation/kernel-parameters.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index ce91560229f5..7ce5ea949d1a 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -220,11 +220,6 @@ and is between 256 and 4096 characters. It is defined in the file acpi_fake_ecdt [HW,ACPI] Workaround failure due to BIOS lacking ECDT - acpi_generic_hotkey [HW,ACPI] - Allow consolidated generic hotkey driver to - override platform specific driver. - See also Documentation/acpi-hotkey.txt. - acpi_pm_good [IA-32,X86-64] Override the pmtimer bug detection: force the kernel to assume that this machine's pmtimer latches its value From 3f2c48c9b48423d1411695da066d525cca2a27db Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 3 Jul 2007 01:40:59 -0400 Subject: [PATCH 04/10] ACPI: Use menuconfig objects Use menuconfigs instead of menus, so the whole menu can be disabled at once instead of going through all options. Signed-off-by: Jan Engelhardt Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- drivers/acpi/Kconfig | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 139f41f033d8..a02e2f58219c 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -2,16 +2,12 @@ # ACPI Configuration # -menu "ACPI (Advanced Configuration and Power Interface) Support" +menuconfig ACPI + bool "ACPI Support (Advanced Configuration and Power Interface) Support" depends on !X86_NUMAQ depends on !X86_VISWS depends on !IA64_HP_SIM depends on IA64 || X86 - depends on PM - -config ACPI - bool "ACPI Support" - depends on IA64 || X86 depends on PCI depends on PM select PNP @@ -49,7 +45,6 @@ if ACPI config ACPI_SLEEP bool "Sleep States" depends on X86 && (!SMP || SUSPEND_SMP) - depends on PM default y ---help--- This option adds support for ACPI suspend states. @@ -82,7 +77,6 @@ config ACPI_SLEEP_PROC_SLEEP config ACPI_PROCFS bool "Procfs interface (deprecated)" - depends on ACPI default y ---help--- The Procfs interface for ACPI is made optional for backward compatibility. @@ -330,7 +324,6 @@ config ACPI_CONTAINER config ACPI_HOTPLUG_MEMORY tristate "Memory Hotplug" - depends on ACPI depends on MEMORY_HOTPLUG default n help @@ -359,5 +352,3 @@ config ACPI_SBS to today's ACPI "Control Method" battery. endif # ACPI - -endmenu From 33ce2033433195ccc1fbad00d26ad854b2ab68d0 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Tue, 3 Jul 2007 01:45:44 -0400 Subject: [PATCH 05/10] ACPI: suspend: delete toshiba S1 quirk If we have quirk "init... after standby", we should not be calling it while resuming from hibernation. And... that quirk is only ever needed on toshiba 4030cdt... and... noone should be using standby these days, anyway. That quirk was certainly _not_ meant to be ran after hibernation. Signed-off-by: Pavel Machek Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- drivers/acpi/sleep/main.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index bc7e16ec8393..56afb1c1a494 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c @@ -210,11 +210,6 @@ static void acpi_hibernation_finish(void) /* reset firmware waking vector */ acpi_set_firmware_waking_vector((acpi_physical_address) 0); - - if (init_8259A_after_S1) { - printk("Broken toshiba laptop -> kicking interrupts\n"); - init_8259A(0); - } } static struct hibernation_ops acpi_hibernation_ops = { From 18eab8550397f1f3d4b8b2c5257c88dae25d58ed Mon Sep 17 00:00:00 2001 From: Venkatesh Pallipadi Date: Fri, 15 Jun 2007 19:37:00 -0400 Subject: [PATCH 06/10] ACPI: Enable C3 even when PM2_control is zero On systems that do not have pm2_control_block, we cannot really use ARB_DISABLE before C3. We used to disable C3 totally on such systems. To be compatible with Windows, we need to enable C3 on such systems now. We just skip ARB_DISABLE step before entering the C3-state and assume hardware is handling things correctly. Also, ACPI spec is not clear about pm2_control is _needed_ for C3 or not. We have atleast one system that need this to enable C3. Signed-off-by: Venkatesh Pallipadi Signed-off-by: Len Brown --- drivers/acpi/processor_idle.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index ee5759bef945..36dc1d26520a 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -488,7 +488,17 @@ static void acpi_processor_idle(void) case ACPI_STATE_C3: - if (pr->flags.bm_check) { + /* + * disable bus master + * bm_check implies we need ARB_DIS + * !bm_check implies we need cache flush + * bm_control implies whether we can do ARB_DIS + * + * That leaves a case where bm_check is set and bm_control is + * not set. In that case we cannot do much, we enter C3 + * without doing anything. + */ + if (pr->flags.bm_check && pr->flags.bm_control) { if (atomic_inc_return(&c3_cpu_count) == num_online_cpus()) { /* @@ -497,7 +507,7 @@ static void acpi_processor_idle(void) */ acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1); } - } else { + } else if (!pr->flags.bm_check) { /* SMP with no shared cache... Invalidate cache */ ACPI_FLUSH_CPU_CACHE(); } @@ -509,7 +519,7 @@ static void acpi_processor_idle(void) acpi_cstate_enter(cx); /* Get end time (ticks) */ t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); - if (pr->flags.bm_check) { + if (pr->flags.bm_check && pr->flags.bm_control) { /* Enable bus master arbitration */ atomic_dec(&c3_cpu_count); acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0); @@ -959,9 +969,9 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, if (pr->flags.bm_check) { /* bus mastering control is necessary */ if (!pr->flags.bm_control) { + /* In this case we enter C3 without bus mastering */ ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "C3 support requires bus mastering control\n")); - return; + "C3 support without bus mastering control\n")); } } else { /* From 0dc070bb0242481a6100c95e5deaa07b267399a8 Mon Sep 17 00:00:00 2001 From: Dan Aloni Date: Mon, 9 Jul 2007 11:33:18 -0700 Subject: [PATCH 07/10] ACPI: drivers/acpi/pci_link.c: lower printk severity Signed-off-by: Dan Aloni Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- drivers/acpi/pci_link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index acc594771379..3448edd61dc4 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -733,7 +733,7 @@ static int acpi_pci_link_add(struct acpi_device *device) /* query and set link->irq.active */ acpi_pci_link_get_current(link); - printk(PREFIX "%s [%s] (IRQs", acpi_device_name(device), + printk(KERN_INFO PREFIX "%s [%s] (IRQs", acpi_device_name(device), acpi_device_bid(device)); for (i = 0; i < link->irq.possible_count; i++) { if (link->irq.active == link->irq.possible[i]) { From 4ebf83c8cf89ab13bc23e46b0fcb6178ca23b43c Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Mon, 9 Jul 2007 11:33:14 -0700 Subject: [PATCH 08/10] ACPI: fix empty macros found by -Wextra ACPI has a ton of macros which make a bunch of empty if's when configured in non-debug mode. [lenb: The code it complaines about is functionally correct, so this patch is just to make -Wextra happier] #define DBG() if(...) DBG(); next_c_statement which turns into if(...) ; next_c_statement Signed-off-by: Dave Jones Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- drivers/acpi/glue.c | 2 +- include/acpi/acmacros.h | 40 ++++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index 41427a41f620..4893e256e399 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c @@ -16,7 +16,7 @@ #if ACPI_GLUE_DEBUG #define DBG(x...) printk(PREFIX x) #else -#define DBG(x...) +#define DBG(x...) do { } while(0) #endif static LIST_HEAD(bus_type_list); static DECLARE_RWSEM(bus_type_sem); diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 8948a6461834..e64a748bdd2e 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -599,26 +599,26 @@ #define ACPI_DEBUG_EXEC(a) #define ACPI_NORMAL_EXEC(a) a; -#define ACPI_DEBUG_DEFINE(a) -#define ACPI_DEBUG_ONLY_MEMBERS(a) -#define ACPI_FUNCTION_NAME(a) -#define ACPI_FUNCTION_TRACE(a) -#define ACPI_FUNCTION_TRACE_PTR(a,b) -#define ACPI_FUNCTION_TRACE_U32(a,b) -#define ACPI_FUNCTION_TRACE_STR(a,b) -#define ACPI_FUNCTION_EXIT -#define ACPI_FUNCTION_STATUS_EXIT(s) -#define ACPI_FUNCTION_VALUE_EXIT(s) -#define ACPI_FUNCTION_ENTRY() -#define ACPI_DUMP_STACK_ENTRY(a) -#define ACPI_DUMP_OPERANDS(a,b,c,d,e) -#define ACPI_DUMP_ENTRY(a,b) -#define ACPI_DUMP_TABLES(a,b) -#define ACPI_DUMP_PATHNAME(a,b,c,d) -#define ACPI_DUMP_RESOURCE_LIST(a) -#define ACPI_DUMP_BUFFER(a,b) -#define ACPI_DEBUG_PRINT(pl) -#define ACPI_DEBUG_PRINT_RAW(pl) +#define ACPI_DEBUG_DEFINE(a) do { } while(0) +#define ACPI_DEBUG_ONLY_MEMBERS(a) do { } while(0) +#define ACPI_FUNCTION_NAME(a) do { } while(0) +#define ACPI_FUNCTION_TRACE(a) do { } while(0) +#define ACPI_FUNCTION_TRACE_PTR(a,b) do { } while(0) +#define ACPI_FUNCTION_TRACE_U32(a,b) do { } while(0) +#define ACPI_FUNCTION_TRACE_STR(a,b) do { } while(0) +#define ACPI_FUNCTION_EXIT do { } while(0) +#define ACPI_FUNCTION_STATUS_EXIT(s) do { } while(0) +#define ACPI_FUNCTION_VALUE_EXIT(s) do { } while(0) +#define ACPI_FUNCTION_ENTRY() do { } while(0) +#define ACPI_DUMP_STACK_ENTRY(a) do { } while(0) +#define ACPI_DUMP_OPERANDS(a,b,c,d,e) do { } while(0) +#define ACPI_DUMP_ENTRY(a,b) do { } while(0) +#define ACPI_DUMP_TABLES(a,b) do { } while(0) +#define ACPI_DUMP_PATHNAME(a,b,c,d) do { } while(0) +#define ACPI_DUMP_RESOURCE_LIST(a) do { } while(0) +#define ACPI_DUMP_BUFFER(a,b) do { } while(0) +#define ACPI_DEBUG_PRINT(pl) do { } while(0) +#define ACPI_DEBUG_PRINT_RAW(pl) do { } while(0) #define return_VOID return #define return_ACPI_STATUS(s) return(s) From 7a9b9068b8c7b526894904c0b9b90354825b8fbd Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Fri, 13 Jul 2007 13:42:47 +0800 Subject: [PATCH 09/10] ACPI: update feature-removal-schedule.txt, /sys/firmware/acpi/namespace is gone The /sys/firmware/acpi/namespace has already been removed in 2.6.21. Signed-off-by: Zhang Rui Signed-off-by: Len Brown --- Documentation/feature-removal-schedule.txt | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 49ae1ea9e868..22fe37eca48d 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -227,20 +227,6 @@ Who: Venkatesh Pallipadi --------------------------- -What: /sys/firmware/acpi/namespace -When: 2.6.21 -Why: The ACPI namespace is effectively the symbol list for - the BIOS. The device names are completely arbitrary - and have no place being exposed to user-space. - - For those interested in the BIOS ACPI namespace, - the BIOS can be extracted and disassembled with acpidump - and iasl as documented in the pmtools package here: - http://ftp.kernel.org/pub/linux/kernel/people/lenb/acpi/utils -Who: Len Brown - ---------------------------- - What: ACPI procfs interface When: July 2007 Why: After ACPI sysfs conversion, ACPI attributes will be duplicated From 8b8eb7d8cfc6cd95ed00cd58754e8493322505bd Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Wed, 18 Jul 2007 17:23:24 +0800 Subject: [PATCH 10/10] ACPI: update ACPI proc I/F removal schedule ACPI sysfs conversion is not finished yet and some user space tools still depend on the ACPI proc I/F. We plan to finish all the sysfs conversion by January 2008 and remove the ACPI proc I/F in July 2008. Signed-off-by: Zhang Rui Signed-off-by: Len Brown --- Documentation/feature-removal-schedule.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 22fe37eca48d..769862197ac8 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -228,9 +228,10 @@ Who: Venkatesh Pallipadi --------------------------- What: ACPI procfs interface -When: July 2007 -Why: After ACPI sysfs conversion, ACPI attributes will be duplicated - in sysfs and the ACPI procfs interface should be removed. +When: July 2008 +Why: ACPI sysfs conversion should be finished by January 2008. + ACPI procfs interface will be removed in July 2008 so that + there is enough time for the user space to catch up. Who: Zhang Rui ---------------------------