Bug 643758

Summary: hostap_cs: sleeping function called from invalid context at kernel/mutex.c:94
Product: [Fedora] Fedora Reporter: rbugz
Component: kernelAssignee: Stanislaw Gruszka <sgruszka>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: dougsland, fabrice, gansalmon, itamar, jonathan, kernel-maint, madhu.chinakonda, sgruszka, tiagomatos
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: kernel-2.6.34.7-66.fc13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-05 21:04:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
0001-hostap_cs-fix-sleeping-function-called-from-invalid-.patch
none
0001-hostap_cs-fix-sleeping-function-called-from-invalid-.patch none

Description rbugz 2010-10-17 21:39:05 UTC
Description of problem:
The following output, from dmesg, is produced.

hostap_cs: Registered netdevice wifi0
BUG: sleeping function called from invalid context at kernel/mutex.c:94
in_atomic(): 0, irqs_disabled(): 1, pid: 552, name: modprobe
Pid: 552, comm: modprobe Not tainted 2.6.34.7-56.fc13.i686.PAE #1
Call Trace:
 [<c0431243>] __might_sleep+0xca/0xd1
 [<c07a2438>] mutex_lock+0x1f/0x3e
 [<f8089fe7>] ? hostap_tx_callback_register+0xa8/0xb5 [hostap]
 [<c06944fd>] pcmcia_request_irq+0x22/0x31b
 [<f80840be>] ? hostap_init_data+0x183/0x1dc [hostap]
 [<f7fc497d>] hostap_cs_probe+0x650/0x907 [hostap_cs]
 [<c0692015>] pcmcia_device_probe+0x123/0x208
 [<c051e23e>] ? sysfs_do_create_link+0xb8/0x105
 [<c0653500>] ? driver_sysfs_add+0x31/0x53
 [<c065368b>] driver_probe_device+0xca/0x1d2
 [<c06537db>] __driver_attach+0x48/0x64
 [<c0652c98>] bus_for_each_dev+0x42/0x6c
 [<c065347b>] driver_attach+0x19/0x1b
 [<c0653793>] ? __driver_attach+0x0/0x64
 [<c0652f24>] bus_add_driver+0xfe/0x244
 [<c05ae23a>] ? kset_find_obj+0x12/0x4e
 [<c0653a46>] driver_register+0x81/0xe8
 [<c06932c7>] pcmcia_register_driver+0xdd/0x11e
 [<f82c4000>] ? init_prism2_pccard+0x0/0xf [hostap_cs]
 [<f82c400d>] init_prism2_pccard+0xd/0xf [hostap_cs]
 [<c040305b>] do_one_initcall+0x51/0x13f
 [<c0468fc1>] sys_init_module+0xac/0x1e3
 [<c07a3364>] syscall_call+0x7/0xb
wifi0: Interrupt, but dev not configured
hostap_cs: index 0x01: , irq 5, io 0x0100-0x013f

Version-Release number of selected component (if applicable):
2.6.34.7-56.fc13.i686.PAE

How reproducible:
Boot with prism pcmcia card

Steps to Reproduce:
1. Boot with PRISM family pcmcia card(Zyxel Zyair B-100) card in place or
2. Insert above card into booted system
3.
  
Actual results:

As above. Ethernet does, however,  work through the wifi device. This appears
to be a regression as no traces have appeared using the same hardware
(Vaio PCG-K115B) using previous Fedora installations.

Expected results:

No BUG trace.

Additional info:

Comment 1 rbugz 2010-11-15 19:57:45 UTC
Updating the same hardware to fedora 14 results in
a freeze on insertion of the card (unless all irqs
are disabled in pcmcia/config.opts). See
Bug #641911

Comment 2 rbugz 2011-01-06 12:18:59 UTC
Compiling and using a 2.6.37 stable series kernel from kernel.org results
in the system no longer freezing on insertion of the PCMCIA card (as it
does with Fedora 2.6.36 series kernels - see comment above). However, the
invalid context bug is still present i.e.

BUG: sleeping function called from invalid context at mm/slub.c:793
in_atomic(): 0, irqs_disabled(): 1, pid: 513, name: modprobe
Pid: 513, comm: modprobe Not tainted 2.6.37 #1
Call Trace:
 [<c041e98e>] __might_sleep+0xc2/0xc9
 [<c04a733f>] slab_pre_alloc_hook.clone.44+0x23/0x2c
 [<c04a7a59>] kmem_cache_alloc_notrace+0x1f/0x6f
 [<c0463190>] ? request_threaded_irq+0x82/0x146
 [<c0463190>] request_threaded_irq+0x82/0x146
 [<f9434e42>] ? prism2_interrupt+0x0/0x623 [hostap_cs]
 [<c064cee9>] pcmcia_request_irq+0x2f/0x41
 [<f9437661>] hostap_cs_probe+0x5b2/0x79e [hostap_cs]
 [<c064bc8c>] pcmcia_device_probe+0x122/0x21d
 [<c060ae00>] ? driver_sysfs_add+0x38/0x6c
 [<c060b0fa>] driver_probe_device+0xed/0x1a3
 [<c060b1f8>] __driver_attach+0x48/0x64
 [<c060a3e4>] bus_for_each_dev+0x42/0x65
 [<c060adc6>] driver_attach+0x19/0x1b
 [<c060b1b0>] ? __driver_attach+0x0/0x64
 [<c060aa8d>] bus_add_driver+0xa7/0x1df
 [<c060b3bd>] driver_register+0x7c/0xdb
 [<c064c463>] pcmcia_register_driver+0xdd/0x10e
 [<f96e900d>] init_prism2_pccard+0xd/0xf [hostap_cs]
 [<c040121d>] do_one_initcall+0x75/0x118
 [<f96e9000>] ? init_prism2_pccard+0x0/0xf [hostap_cs]
 [<c044b4a1>] sys_init_module+0x11a3/0x132a
 [<c0402913>] sysenter_do_call+0x12/0x22

As originally reported for F13 the prism card works after the above call
trace has happened.

Comment 3 Stanislaw Gruszka 2011-01-07 10:49:55 UTC
Created attachment 472217 [details]
0001-hostap_cs-fix-sleeping-function-called-from-invalid-.patch

Please test this patch.

Comment 4 rbugz 2011-01-07 14:09:07 UTC
Thanks. It still produces a bug trace, however it now looks a
little different. The card is functional afterwards.

[   20.845847] BUG: sleeping function called from invalid context at kernel/mutex.c:85
[   20.846037] in_atomic(): 0, irqs_disabled(): 1, pid: 497, name: modprobe
[   20.846037] Pid: 497, comm: modprobe Not tainted 2.6.37 #1
[   20.846037] Call Trace:
[   20.846037]  [<c041e98e>] __might_sleep+0xc2/0xc9
[   20.846037]  [<c074a585>] mutex_lock+0x1c/0x2f
[   20.846037]  [<c064d425>] pcmcia_enable_device+0x43/0x3c4
[   20.846037]  [<c064cee9>] ? pcmcia_request_irq+0x2f/0x41
[   20.846037]  [<f9140677>] hostap_cs_probe+0x5c8/0x79e [hostap_cs]
[   20.846037]  [<c064bc8c>] pcmcia_device_probe+0x122/0x21d
[   20.846037]  [<c060ae00>] ? driver_sysfs_add+0x38/0x6c
[   20.846037]  [<c060b0fa>] driver_probe_device+0xed/0x1a3
[   20.846037]  [<c060b1f8>] __driver_attach+0x48/0x64
[   20.846037]  [<c060a3e4>] bus_for_each_dev+0x42/0x65
[   20.846037]  [<c060adc6>] driver_attach+0x19/0x1b
[   20.846037]  [<c060b1b0>] ? __driver_attach+0x0/0x64
[   20.846037]  [<c060aa8d>] bus_add_driver+0xa7/0x1df
[   20.846037]  [<c060b3bd>] driver_register+0x7c/0xdb
[   20.846037]  [<c064c463>] pcmcia_register_driver+0xdd/0x10e
[   20.846037]  [<f914800d>] init_prism2_pccard+0xd/0xf [hostap_cs]
[   20.846037]  [<c040121d>] do_one_initcall+0x75/0x118
[   20.846037]  [<f9148000>] ? init_prism2_pccard+0x0/0xf [hostap_cs]
[   20.846037]  [<c044b4a1>] sys_init_module+0x11a3/0x132a
[   20.846037]  [<c0402913>] sysenter_do_call+0x12/0x22

Comment 5 Stanislaw Gruszka 2011-01-07 14:40:07 UTC
Created attachment 472242 [details]
0001-hostap_cs-fix-sleeping-function-called-from-invalid-.patch

Here is second try.

Comment 6 rbugz 2011-01-07 16:47:55 UTC
Thanks. That has removed the bug trace and the card is working.
Much appreciated.

Comment 7 Stanislaw Gruszka 2011-01-11 07:40:45 UTC
*** Bug 641911 has been marked as a duplicate of this bug. ***

Comment 8 Fedora Update System 2011-02-05 20:13:41 UTC
kernel-2.6.34.8-67.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/kernel-2.6.34.8-67.fc13

Comment 9 Fedora Update System 2011-02-24 15:49:46 UTC
kernel-2.6.34.8-68.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/kernel-2.6.34.8-68.fc13

Comment 10 Fedora Update System 2011-03-07 21:05:34 UTC
kernel-2.6.34.8-68.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.