From e4d49531dcc2f334205d99614164ea900216b1cb Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Thu, 8 Mar 2007 17:57:31 +0100 Subject: 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(-) (limited to 'drivers') diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c index 6d7d4157e04..45360dfab2c 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, -- cgit v1.2.3-70-g09d2 From 3f2c48c9b48423d1411695da066d525cca2a27db Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 3 Jul 2007 01:40:59 -0400 Subject: 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(-) (limited to 'drivers') diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 139f41f033d..a02e2f58219 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 -- cgit v1.2.3-70-g09d2 From 33ce2033433195ccc1fbad00d26ad854b2ab68d0 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Tue, 3 Jul 2007 01:45:44 -0400 Subject: 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(-) (limited to 'drivers') diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index bc7e16ec839..56afb1c1a49 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 = { -- cgit v1.2.3-70-g09d2 From 18eab8550397f1f3d4b8b2c5257c88dae25d58ed Mon Sep 17 00:00:00 2001 From: Venkatesh Pallipadi Date: Fri, 15 Jun 2007 19:37:00 -0400 Subject: 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(-) (limited to 'drivers') diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index ee5759bef94..36dc1d26520 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 { /* -- cgit v1.2.3-70-g09d2 From 0dc070bb0242481a6100c95e5deaa07b267399a8 Mon Sep 17 00:00:00 2001 From: Dan Aloni Date: Mon, 9 Jul 2007 11:33:18 -0700 Subject: 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(-) (limited to 'drivers') diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index acc59477137..3448edd61dc 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]) { -- cgit v1.2.3-70-g09d2 From 4ebf83c8cf89ab13bc23e46b0fcb6178ca23b43c Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Mon, 9 Jul 2007 11:33:14 -0700 Subject: 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(-) (limited to 'drivers') diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index 41427a41f62..4893e256e39 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 8948a646183..e64a748bdd2 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) -- cgit v1.2.3-70-g09d2