Kernel panic in PCI driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

I am using following functions in my driver for a PCI device.

wait_event_interruptible and wake_up_interruptible.

my algorithm goes like this

fun1()
{
waits for an event whose source is an interrupt from the PCI device; /*i.e calls wait_event_interruptible*/
}

fun2()
{
Check if there is an interrupt from the PCI device;
if so, give wake up call to queue that is waited upon in fun1;/*i.e calls wake_up_interruptible*/
}

These functions are called infinitely as the PCI device is continuously generating interrupts. so waiting and waking happens a number of times. But after some iterations kernel gets panicked with following messages. (fun2 is named as ccp_read_irq and ccp_intr_handler is a routine that is invoked when there is an interrupt). What could be the reason for kernel getting panicked. Is it the huge number of interrupts that it is unable to handle ? Kindly have a look at following messages and help me to get a clue of what the problem is.

Another thing i have tried with my code having no spinlocks at all but the problem persists.

kernel messages start here

Kernel BUG at spinlock:75
invalid operand: 0000 [1] SMP
CPU 2
Modules linked in: ccp(U) parport_pc lp parport autofs4 i2c_dev i2c_core nfs lod
Pid: 7099, comm: dat_data_lat_se Tainted: P      26.9-42.ELsmp
RIP: 0010:[<ffffffff8030b0b7>] <ffffffff8030b0b7>{_spin_unlock_irqrestore+27}
RSP: 0018:0000010005d83eb0  EFLAGS: 00010002
RAX: 0000000000000001 RBX: 0000010139914880 RCX: 0000000000000000
RDX: 0000000000000001 RSI: 0000000000000046 RDI: 0000010139914898
RBP: 0000000000000097 R08: 00000101399148a0 R09: 0000000000000020
R10: 0000000100000000 R11: 0000000000000202 R12: 00000100b5af5188
R13: 00000100b5ae0000 R14: 0000000000000000 R15: 0000000000000000
FS:  0000002a956853e0(0000) GS:ffffffff804e5180(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000009c8058 CR3: 0000000005d6e000 CR4: 00000000000006e0
Process dat_data_lat_se (pid: 7099, threadinfo 000001010da3e000, task 000001013)
Stack: ffffffffa02fd0da 0000000080110833 0000010127c3b780 0000000100000000
       00003b780000001 0000000000000002 ffffffff80467640 00000000804e5f00
       00000100b5ae0000 0000000000000002
Call Trace:<IRQ> <ffffffffa02fd0da>{:ccp:ccp_read_irq+453} <ffffffffa02fd295>{:
       <ffffffff80112f4a>{handle_IRQ_event+41} <ffffffff801131c4>{do_IRQ+197}
       <ffffffff80110833>{ret_from_intr+0}  <EOI> <ffffffff8030b3a9>{.text.lock
       <ffffffff8018ab18>{sys_ioctl+104} <ffffffff8011026a>{system_call+126}


Code: 0f 0b 6f 4d 32 80 ff ff ff ff 4b 00 c7 07 01 00 00 00 56 9d
RIP <ffffffff8030b0b7>{_spin_unlock_irqrestore+27} RSP <0000010005d83eb0>
 <0>Kernel panic - not sing: Oops
 Badness in panic at kernel/panic.c:118

Call Trace:<IRQ> <ffffffff80137a86>{panic+527} <ffffffff80110833>{ret_from_intr
       <ffffffff80111aec>{oops_end+38} <ffffffff80111b07>{oops_end+65}
       <ffffffff80111c05>{die+54} <ffffffff80111fc8>{do_invalid_op+145}
       <ffffffff8030b0b7>{_spin_unlock_irqrestore+27} <ffffffff801321e3>{activa
       <ffffffff8013271e>{try_to_wake_up+876} <ffffffff80110d91>{error_exit+0}
       <ffffffff8030b0b7>{_spin_unlock_irqrestore+27} <ffffffffa02fd0da>{:ccp:c
       <ffffffffa02fd295>{:ccp:ccp_intr_handler+217} <ffffffff80112f4a>{handle_
       <ffffffff801131c4>{do_IRQ+197} <ffffffff80110833>{ret_from_intr+0}
        <EOI> <ffffffff8030b3a9>{.text.lock.spinlock+5} <ffffffff8018ab18>{sys_
       <ffffffff8011026a>{system_call+126}
Badness in i8042_panic_blink at drivers/input/serio/i8042.c:987

Call Trace:<IRQ> <ffffffff80241feb>{i8042_panic_blink+238} <ffffffff80137a34>{p
       <ffffffff80110833>{ret_from_intr+0} <ffffffff80111aec>{oops_end+38}
       <ffffffff80111b07>{oops_end+65} <ffffffff80111c05>{die+54}
       <ffffffff80111fc8>{do_invalid_op+145} <ffffffff8030b0b7>{_spin_unlock_ir
       <ffffffff801321e3>{activate_task+124} <ffffffff8013271e>{try_to_wake_up+
       <ffffffff80110d91>{error_exit+0} <ffffffff8030b0b7>{_spin_unlock_irqrest
       <ffffffffa02fd0da>{:ccp:ccp_read_irq+453} <ffffffffa02fd295>{:ccp:ccp_in
       <ffffffff80112f4a>{handle_IRQ_event+41} <ffffffff801131c4>{do_IRQ+197}
       <ffffffff80110833>{ret_from_intr+0}  <EOI> <ffffffff8030b3a9>{.text.lock
       <ffffffff8018ab18>{sys_ioctl+104} <ffffffff8011026a>{system_call+126}

Badness in i8042_panic_blink at drivers/input/serio/i8042.c:990

Call Trace:<IRQ> <ffffffff8024207d>{i8042_panic_blink+384} <ffffffff80137a34>{p
       <ffffffff80110833>{ret_from_intr+0} <ffffffff80111aec>{oops_end+38}
       <ffffffff80111b07>{oops_end+65} <ffffffff80111c05>{die+54}
       <ffffffff80111fc8>{do_invalid_op+145} <ffffffff8030b0b7>{_spin_unlock_ir
       <ffffffff801321e3>{activate_task+124} <ffffffff8013271e>{try_to_wake_up+
       <ffffffff80110d91>{error_exit+0} <ffffffff8030b0b7>{_spin_unlock_irqrest
       <ffffffffa02fd0da>{:ccp:ccp_read_irq+453} <ffffffffa02fd295>{:ccp:ccp_in
       <ffffffff80112f4a>{handle_IRQ_event+41} <ffffffff801131c4>{do_IRQ+197}
       <ffffffff80110833>{ret_from_intr+0}  <EOI> <ffffffff8030b3a9>{.text.lock
       <ffffffff8018ab18>{sys_ioctl+104} <ffffffff8011026a>{system_call+126}

Badness in i8042_panic_blink at drivers/input/serio/i8042.c:992

Call Trace:<IRQ> <ffffffff802420e2>{i8042_panic_blink+485} <ffffffff80137a34>{p
       <ffffffff80110833>{ret_from_intr+0} <ffffffff80111aec>{oops_end+38}
       <ffffffff80111b0oops_end+65} <ffffffff80111c05>{die+54}
       <ffffffff80111fc8>{do_invalid_op+145} <ffffffff8030b0b7>{_spin_unlock_ir
       <ffffffff801321e3>{activate_task+124} <ffffffff8013271e>{try_to_wake_up+
       <ffffffff80110d91>{error_exit+0} <ffffffff8030b0b7>{_spin_unlock_irqrest
       <ffffffffa02fd0da>{:ccp:ccp_read_irq+453} <ffffffffa02fd295>{:ccp:ccp_in
       <ffffffff80112f4a>{handle_IRQ_event+41} <ffffffff801131c4>{do_IRQ+197}
       <ffffffff80110833>{ret_from_intr+0}  <EOI> <ffffffff8030b3a9>{.text.lock
       <ffffffff8018ab18>{sys_ioctl+104} <ffffffff8011026a>{system_call+126}

Thanks and Regards,
Jasjit Singh


Sent from Yahoo! Mail.
A Smarter Email.

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux