[lkml]   [2001]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectCannot unlock spinlock... Was: Problem in yenta.c, 2nd edition
Hallo l-k,

On Mon, Nov 05, 2001 at 11:29:00AM +0100, Jan Marek wrote:
> >
> > Try moving the block of code which requests the IRQ down
> > so that it comes after the call to cardbus_register().
> yes. I tried move the block, what are you wrote about... Bu the
> last messages, what I got from notebook when I modprobe'd
> yenta_socket is:
> Yenta IRQ list 04b8, PCI irq11
> Socket status: 30000010
> (this messages is generated in function cardbus_register()).
> And kernel freeze as before...

I tryed to trace of function request_irq():

I found, that problem is in this code:

--- function setup_irq() from file arch/i386/kernel/irq.c

/* this was setup_x86_irq but it seems pretty generic */
int setup_irq(unsigned int irq, struct irqaction * new)
int shared = 0;
unsigned long flags;
struct irqaction *old, **p;
irq_desc_t *desc = irq_desc + irq;

* Some drivers like serial.c use request_irq() heavily,
* so we have to be careful not to interfere with a
* running system.
if (new->flags & SA_SAMPLE_RANDOM) {
* This function might sleep, we want to call it first,
* outside of the atomic block.
* Yes, this might clear the entropy pool if the wrong
* driver is attempted to be loaded, without actually
* installing a new handler, but is this really a problem,
* only the sysadmin is able to do this.

* The following block of code has to be executed atomically
printk("setup_irq: spin_lock_irqsave()\n");
p = &desc->action;
if ((old = *p) != NULL) {
/* Can't share interrupts unless both agree to */
if (!(old->flags & new->flags & SA_SHIRQ)) {
return -EBUSY;

/* add new interrupt at end of irq queue */
do {
p = &old->next;
old = *p;
} while (old);
shared = 1;

*p = new;

if (!shared) {
desc->depth = 0;
printk("request_irq: desc->handler->startup(irq)\n");
printk("request_irq: spin_unlock_irqrestore()\n");

printk("request_irq: register_irq_proc()\n");
return 0;
--- end of listing

The last message I got from kernel is:
request_irq: desc->handler->startup(irq)

Then problem is in the spin_unlock_irqrestore()???

Any ideas, recomendations, suggestions?

Jan Marek
Ing. Jan Marek
University of South Bohemia
Academic Computer Centre
Phone: +420-38-7772080
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:12    [W:0.080 / U:3.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site