Bug 140254 - sleeping function called from invalid context
Summary: sleeping function called from invalid context
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 4
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Dave Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-11-21 20:10 UTC by Ben Liblit
Modified: 2015-01-04 22:12 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-08-31 23:01:02 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
/var/log/messages excerpt discussed in comment #8 (3.81 KB, text/plain)
2005-07-18 05:56 UTC, Ben Liblit
no flags Details

Description Ben Liblit 2004-11-21 20:10:17 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20040922 Epiphany/1.2.7

Description of problem:
With ACPI enabled, I can put my ThinkPad X24 laptop to sleep (S3) and
wake it back up again.  However, after resuming I find diagnostic
information indicating that the kernel called a sleeping function from
an invalid context.

I cannot really tell whether this happens as the laptop is going to
sleep or as it is waking up.  But it happens every time, and
presumably shouldn't happen at all.

Version-Release number of selected component (if applicable):
kernel-2.6.9-1.3_FC2

How reproducible:
Always

Steps to Reproduce:
1. echo 3 >/proc/acpi/sleep
2. resume, e.g. by pressing the ThinkPad's "Fn" button
    

Actual Results:  After resuming I find the following diagnostic
information in /var/log/messages:

    Debug: sleeping function called from invalid context at mm/slab.c:2063
    in_atomic():0[expected: 0], irqs_disabled():1
     [<0211c967>] __might_sleep+0x82/0x8c
     [<0214c429>] __kmalloc+0x42/0x7d
     [<021f5301>] acpi_os_allocate+0xa/0xb
     [<02208ea7>] acpi_ut_allocate+0x34/0x57
     [<02208e38>] acpi_ut_initialize_buffer+0x42/0x7d
     [<02205ce6>] acpi_rs_create_byte_stream+0x23/0x39
     [<022070a6>] acpi_rs_set_srs_method_data+0x1b/0x9d
     [<0211ae9a>] recalc_task_prio+0x128/0x133
     [<0220e80d>] acpi_pci_link_set+0xde/0x155
     [<0220eb91>] irqrouter_resume+0x1c/0x30
     [<02243d66>] sysdev_resume+0x3e/0xc7
     [<02246d8c>] device_power_up+0x5/0xa
     [<0213de2e>] suspend_enter+0x25/0x2d
     [<0213de9c>] enter_state+0x3f/0x5e
     [<0220b3f4>] acpi_suspend+0x25/0x35
     [<0215f326>] get_user_size+0x2e/0x55
     [<0220be8b>] acpi_system_write_sleep+0x5f/0x70
     [<02179c7a>] locate_fd+0x5c/0x78
     [<0216610e>] vfs_write+0xb8/0xe4
     [<021661d8>] sys_write+0x3c/0x62

Expected Results:  No debug messages generated by the kernel.

Additional info:

Comment 1 Dave Jones 2005-04-16 04:45:07 UTC
Fedora Core 2 has now reached end of life, and no further updates will be
provided by Red Hat.  The Fedora legacy project will be producing further kernel
updates for security problems only.

If this bug has not been fixed in the latest Fedora Core 2 update kernel, please
try to reproduce it under Fedora Core 3, and reopen if necessary, changing the
product version accordingly.

Thank you.


Comment 2 Ben Liblit 2005-04-18 00:12:50 UTC
The bug still occurs using Fedora Core 3 and kernel-2.6.11-1.14_FC3.  This bug
should be reopened.  Unfortunately I do not have permission to do that myself. 
I'll update what fields I can, but ultimately someone more powerful will need to
change the bug status back to open.

The diagnostic information now appears as follows:

Debug: sleeping function called from invalid context at mm/slab.c:2088
in_atomic():0, irqs_disabled():1
 [<c011cfbe>] __might_sleep+0x9c/0xa4
 [<c0155fc6>] kmem_cache_alloc+0x3c/0x49
 [<c023892c>] acpi_pci_link_set+0x4a/0x1a2
 [<c0238d92>] irqrouter_resume+0x1c/0x24
 [<c0282d86>] sysdev_resume+0x5d/0xb1
 [<c0286d3b>] device_power_up+0x5/0xa
 [<c014463c>] suspend_enter+0x2a/0x32
 [<c01446b4>] enter_state+0x39/0x55
 [<c0235dcb>] acpi_suspend+0x28/0x35
 [<c0235e9a>] acpi_system_write_sleep+0x5a/0x6b
 [<c018b64a>] do_fcntl+0x1a0/0x293
 [<c01751e5>] vfs_write+0xaf/0x10a
 [<c01752eb>] sys_write+0x41/0x6a


Comment 3 Ben Liblit 2005-04-18 00:19:21 UTC
Oops, I *do* have the ability to reopen the bug, which I'm doing right now.

Comment 4 redhat-bugs2eran 2005-06-10 13:56:28 UTC
Identical problem here, with a ThinkPad T21 and kernel 2.6.11-1.27_FC3.


Comment 5 Dave Jones 2005-07-15 18:35:39 UTC
An update has been released for Fedora Core 3 (kernel-2.6.12-1.1372_FC3) which
may contain a fix for your problem.   Please update to this new kernel, and
report whether or not it fixes your problem.

If you have updated to Fedora Core 4 since this bug was opened, and the problem
still occurs with the latest updates for that release, please change the version
field of this bug to 'fc4'.

Thank you.

Comment 6 Ben Liblit 2005-07-17 17:03:32 UTC
The problem still occurs using the latest 2.6.12-1.1398_FC4 kernel on my
ThinkPad X40.  The diagnostic information now appears as follows:

Debug: sleeping function called from invalid context at mm/slab.c:2126
in_atomic():0, irqs_disabled():1
 [<c015c376>] kmem_cache_alloc+0x3c/0x49
 [<c0248562>] acpi_pci_link_set+0x3f/0x17f
 [<c02489ac>] irqrouter_resume+0x14/0x28
 [<c0287c5e>] sysdev_resume+0x3d/0xb5
 [<c028bd57>] device_power_up+0x5/0xa
 [<c014a8cb>] suspend_enter+0x44/0x46
 [<c014a859>] suspend_prepare+0x57/0x85
 [<c014a93e>] enter_state+0x49/0x54
 [<c0245a26>] acpi_system_write_sleep+0x5a/0x6c
 [<c02459cc>] acpi_system_write_sleep+0x0/0x6c
 [<c017b9e4>] vfs_write+0x9e/0x110
 [<c017bb01>] sys_write+0x41/0x6a
 [<c0103a51>] syscall_call+0x7/0xb

This bug should be reopened.

Comment 7 Dan Carpenter 2005-07-18 04:36:19 UTC
Are there any lines before this or after this in dmesg?  

Basically something is calling kmem_cache_alloc() with locks held, but
unfortunately there are a lot of places that call that function.  If you look in
/var/log/messages you can tell what time the bug happened and that will show
whether it was in going to sleep on in waking up.





Comment 8 Ben Liblit 2005-07-18 05:55:02 UTC
I will attach a /var/log/messages excerpt to this report.  The only thing I see
of possible interest is "eth0: Going into suspend...".  In my case, eth0 is an
ipw2200 wireless driver.

I should point out that the timestamps in this excerpt are misleading.  I
suspended the laptop at 00:42, then woke it back up again at 00:47.  However,
all messages are stamped 00:47.  So I'm afraid this may not help you determine
whether the bug happens when going to sleep or waking back up again.  :-(

Comment 9 Ben Liblit 2005-07-18 05:56:14 UTC
Created attachment 116857 [details]
/var/log/messages excerpt discussed in comment #8

Comment 10 petrosyan 2005-08-06 17:56:46 UTC
Here are my debug messages on Thinkpad X40, Fedora Core 4, kernel-2.6.12-1.1398_FC4

Debug: sleeping function called from invalid context at mm/slab.c:2126
in_atomic():0, irqs_disabled():1
 [<c015c376>] kmem_cache_alloc+0x3c/0x49
 [<c0248562>] acpi_pci_link_set+0x3f/0x17f
 [<c02489ac>] irqrouter_resume+0x14/0x28
 [<c0287c5e>] sysdev_resume+0x3d/0xb5
 [<c028bd57>] device_power_up+0x5/0xa
 [<c014a8cb>] suspend_enter+0x44/0x46
 [<c014a859>] suspend_prepare+0x57/0x85
 [<c014a93e>] enter_state+0x49/0x54
 [<c014aa39>] state_store+0x81/0x8f
 [<c014a9b8>] state_store+0x0/0x8f
 [<c01ce194>] subsys_attr_store+0x1b/0x1f
 [<c01ce39d>] flush_write_buffer+0x22/0x28
 [<c01ce3ec>] sysfs_write_file+0x49/0x6e
 [<c01ce3a3>] sysfs_write_file+0x0/0x6e
 [<c017b9e4>] vfs_write+0x9e/0x110
 [<c017bb01>] sys_write+0x41/0x6a
 [<c0103a51>] syscall_call+0x7/0xb


Comment 11 Dan Carpenter 2005-08-06 21:04:39 UTC
This is the same as bug 154046

There is a fix in the works.


Comment 12 Bertho 2005-08-21 17:42:33 UTC
Same problem on Thinkpad T42p. FC4 fully updated and latest kernel
2.6.12-1.1398_FC4. Acpi is set up as described in
http://www.thinkwiki.org/wiki/How_to_configure_acpid. Dmesg output says
(identical with comment #10):
Stopping tasks: =============================================|
Back to C!
Debug: sleeping function called from invalid context at mm/slab.c:2126
in_atomic():0, irqs_disabled():1
 [<c015c376>] kmem_cache_alloc+0x3c/0x49
 [<c0248562>] acpi_pci_link_set+0x3f/0x17f
[snip]
 [<c0103a51>] syscall_call+0x7/0xb

Comment 13 Dan Carpenter 2005-08-24 04:21:10 UTC
comment 11 was based on a report that the bug was fixed but I believe that
turned out to be false.



Comment 14 Dave Jones 2005-08-26 06:20:24 UTC
This should be fixed in the errata kernel currently in updates-testing


Comment 15 Julian C. Dunn 2005-08-31 04:43:06 UTC
On a Thinkpad T40 with 2.6.12-1.447_FC4 this no longer seems to occur.


Note You need to log in before you can comment on or make changes to this bug.