Bug 456067

Summary: Debug: sleeping function called from invalid context at include/asm/semaphore.h:65
Product: Red Hat Enterprise Linux 4 Reporter: Vitaly Mayatskikh <vmayatsk>
Component: kernelAssignee: Red Hat Kernel Manager <kernel-mgr>
Status: CLOSED NOTABUG QA Contact: Martin Jenner <mjenner>
Severity: low Docs Contact:
Priority: low    
Version: 4.8   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-07-21 11:37:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Vitaly Mayatskikh 2008-07-21 11:23:12 UTC
usb_hcd_pci_probe (drivers/usb/core/hcd-pci.c) doesn't handle h/w initialization
errors correctly. In case of error kernel produces this message:

Red Hat Enterprise Linux AS release 4 (Nahant Update 6)
Kernel 2.6.9-67.EL on an ppc64

squad3.rhts.bos.redhat.com login: Debug: sleeping function called from invalid
context at include/asm/semaphore.h:65
in_atomic():0[expected: 0], irqs_disabled():1
Call Trace:
[c0000001dcc1eeb0] [c00000000005d434] .__might_sleep+0xcc/0xec (unreliable)
[c0000001dcc1ef50] [c0000000001e3c38] .dma_pool_destroy+0x34/0x1f0
[c0000001dcc1efe0] [c00000000024d7e0] .hcd_buffer_destroy+0x2c/0x64
[c0000001dcc1f070] [d000000000237240] .function_destroy+0x2c/0x40
[c0000001dcc1f0f0] [d000000000237aa0] .probe_1656+0x6f0/0x918
[c0000001dcc1f1a0] [d00000000023852c] .enter_kretprobe_probe+0x178/0x320
[c0000001dcc1f240] [c000000000049bec] .trampoline_probe_handler+0xb0/0x150
[c0000001dcc1f2e0] [c000000000049ff8] .kprobe_exceptions_notify+0x308/0x600
[c0000001dcc1f3a0] [c000000000073adc] .notifier_call_chain+0x68/0x98
[c0000001dcc1f430] [c0000000000128b4] .ProgramCheckException+0x80/0x17c
[c0000001dcc1f4d0] [c00000000000b048] ProgramCheck_common+0xc8/0x100
--- Exception: 700 at .kretprobe_trampoline_holder+0x0/0x8
    LR = .kretprobe_trampoline_holder+0x0/0x8
[c0000001dcc1f890] [c000000000181674] .pci_device_probe_static+0x6c/0xa8
[c0000001dcc1f920] [c0000000001816f4] .__pci_device_probe+0x44/0x7c
[c0000001dcc1f9b0] [c000000000181768] .pci_device_probe+0x3c/0x6c
[c0000001dcc1fa40] [c0000000001dfa84] .bus_match+0x94/0xd8
[c0000001dcc1fad0] [c0000000001dfc30] .driver_attach+0x70/0xe4
[c0000001dcc1fb60] [c0000000001e0444] .bus_add_driver+0xf4/0x158
[c0000001dcc1fc00] [c0000000001e0b40] .driver_register+0x38/0x4c
[c0000001dcc1fc80] [c000000000181b9c] .pci_register_driver+0x80/0xcc
[c0000001dcc1fd10] [d0000000003edbe4] .ohci_hcd_pci_init+0x40/0x70 [ohci_hcd]
[c0000001dcc1fd90] [c000000000085350] .sys_init_module+0x1f0/0x460
[c0000001dcc1fe30] [c000000000011280] syscall_exit+0x0/0x18
ohci_hcd 0000:c8:01.0: init 0000:c8:01.0 fail, -11
ohci_hcd: probe of 0000:c8:01.0 failed with error -11
ohci_hcd 0000:c8:01.1: init 0000:c8:01.1 fail, -11
ohci_hcd: probe of 0000:c8:01.1 failed with error -11

I have noticed a possibility of this bug in sources and wrote a systemtap's
script to trigger artificial error in usb_hcd_pci_probe(). Run it with stap -vvg:

 * Simulate hcd-pci initialization error with
 * "out of memory" in usb_hcd_pci_probe => hcd_buffer_create
void hcd_buffer_destroy (void *hcd);

function destroy(hcd:long)
        hcd_buffer_destroy ((void*)THIS->hcd);

probe kernel.function("hcd_buffer_create").return
        printf("%s => hcd_buffer_create, return %d\n", caller(), $return);
        if (caller() == ".usb_hcd_pci_probe" && !$return) {
                printf("simulating failure\n");
                $return = -11 /* -ENOMEM */;

Comment 1 Vitaly Mayatskikh 2008-07-21 11:37:48 UTC
Sorry, not a bug...