Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262052AbVAOAZc (ORCPT ); Fri, 14 Jan 2005 19:25:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262053AbVAOAZb (ORCPT ); Fri, 14 Jan 2005 19:25:31 -0500 Received: from moutng.kundenserver.de ([212.227.126.190]:7130 "EHLO moutng.kundenserver.de") by vger.kernel.org with ESMTP id S262052AbVAOAYY (ORCPT ); Fri, 14 Jan 2005 19:24:24 -0500 From: Christian Borntraeger To: linux-kernel@vger.kernel.org, len.brown@intel.com Subject: [PATCH] fixup debug warnings during ACPI S3 resume from ram Date: Sat, 15 Jan 2005 01:24:16 +0100 User-Agent: KMail/1.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501150124.16589.linux-kernel@borntraeger.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:5a8b66f42810086ecd21595c2d6103b9 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4405 Lines: 128 During the wakeup from suspend-to-ram I get several warnings (see below). This patch fixes the warnings for me, but I am not an expert in ACPI. Please read the patch and consider to apply it. Signed-off-by: Christian Borntraeger --- a/drivers/acpi/osl.c 2004-12-23 14:09:11 +01:00 +++ b/drivers/acpi/osl.c 2005-01-15 01:06:35 +01:00 @@ -145,7 +145,7 @@ void * acpi_os_allocate(acpi_size size) { - return kmalloc(size, GFP_KERNEL); + return kmalloc(size, GFP_ATOMIC); } void @@ -905,7 +905,7 @@ ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n", handle, units, timeout)); - if (in_atomic()) + if (in_atomic() || irqs_disabled()) timeout = 0; switch (timeout) --- a/drivers/acpi/pci_link.c 2004-12-22 04:08:55 +01:00 +++ b/drivers/acpi/pci_link.c 2005-01-15 00:50:06 +01:00 @@ -315,7 +315,7 @@ if (!link || !irq) return_VALUE(-EINVAL); - resource = kmalloc( sizeof(*resource)+1, GFP_KERNEL); + resource = kmalloc( sizeof(*resource)+1, GFP_ATOMIC); if(!resource) return_VALUE(-ENOMEM); ------------------- Warning messages: Debug: sleeping function called from invalid context at /usr/src/bk/linux-bk/mm/slab.c:2085 in_atomic():0, irqs_disabled():1 [] dump_stack+0x17/0x20 [] __might_sleep+0xa6/0xb0 [] kmem_cache_alloc+0x82/0x90 [] acpi_pci_link_set+0x7a/0x24e [] acpi_pci_link_resume+0x47/0x7d [] irqrouter_resume+0x45/0x6d [] sysdev_resume+0xe7/0xec [] device_power_up+0x8/0xe [] suspend_enter+0x33/0x50 [] enter_state+0x3f/0x70 [] state_store+0xa3/0xaa [] subsys_attr_store+0x35/0x40 [] flush_write_buffer+0x2e/0x40 [] sysfs_write_file+0x67/0x80 [] vfs_write+0xbf/0x140 [] sys_write+0x41/0x70 [] syscall_call+0x7/0xb Debug: sleeping function called from invalid context at /usr/src/bk/linux-bk/mm/slab.c:2085 in_atomic():0, irqs_disabled():1 [] dump_stack+0x17/0x20 [] __might_sleep+0xa6/0xb0 [] __kmalloc+0xb3/0xc0 [] acpi_os_allocate+0xd/0xf [] acpi_ut_callocate+0x6b/0xd4 [] acpi_ut_callocate_and_track+0x1c/0x7d [] acpi_ut_initialize_buffer+0x4e/0x98 [] acpi_rs_create_byte_stream+0x93/0xfb [] acpi_rs_set_srs_method_data+0x44/0xf4 [] acpi_set_current_resources+0x67/0x81 [] acpi_pci_link_set+0x165/0x24e [] acpi_pci_link_resume+0x47/0x7d [] irqrouter_resume+0x45/0x6d [] sysdev_resume+0xe7/0xec [] device_power_up+0x8/0xe [] suspend_enter+0x33/0x50 [] enter_state+0x3f/0x70 [] state_store+0xa3/0xaa [] subsys_attr_store+0x35/0x40 [] flush_write_buffer+0x2e/0x40 [] sysfs_write_file+0x67/0x80 [] vfs_write+0xbf/0x140 [] sys_write+0x41/0x70 [] syscall_call+0x7/0xb Debug: sleeping function called from invalid context at include2/asm/semaphore.h:107 in_atomic():0, irqs_disabled():1 [] dump_stack+0x17/0x20 [] __might_sleep+0xa6/0xb0 [] acpi_os_wait_semaphore+0xef/0x1b7 [] acpi_ut_acquire_mutex+0xc3/0x159 [] acpi_ut_track_allocation+0x6c/0x14a [] acpi_ut_callocate_and_track+0x51/0x7d [] acpi_ut_initialize_buffer+0x4e/0x98 [] acpi_rs_create_byte_stream+0x93/0xfb [] acpi_rs_set_srs_method_data+0x44/0xf4 [] acpi_set_current_resources+0x67/0x81 [] acpi_pci_link_set+0x165/0x24e [] acpi_pci_link_resume+0x47/0x7d [] irqrouter_resume+0x45/0x6d [] sysdev_resume+0xe7/0xec [] device_power_up+0x8/0xe [] suspend_enter+0x33/0x50 [] enter_state+0x3f/0x70 [] state_store+0xa3/0xaa [] subsys_attr_store+0x35/0x40 [] flush_write_buffer+0x2e/0x40 [] sysfs_write_file+0x67/0x80 [] vfs_write+0xbf/0x140 [] sys_write+0x41/0x70 [] syscall_call+0x7/0xb - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/