--- zzzz-none-000/linux-2.6.19.2/drivers/isdn/hysdn/hysdn_sched.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/drivers/isdn/hysdn/hysdn_sched.c 2007-01-11 07:38:19.000000000 +0000 @@ -155,17 +155,21 @@ if (card->debug_flags & LOG_SCHED_ASYN) hysdn_addlog(card, "async tx-cfg chan=%d len=%d", chan, strlen(line) + 1); + spin_lock_irqsave(&card->hysdn_lock, flags); while (card->async_busy) { + sti(); if (card->debug_flags & LOG_SCHED_ASYN) hysdn_addlog(card, "async tx-cfg delayed"); msleep_interruptible(20); /* Timeout 20ms */ - if (!--cnt) + if (!--cnt) { + spin_unlock_irqrestore(&card->hysdn_lock, flags); return (-ERR_ASYNC_TIME); /* timed out */ + } + cli(); } /* wait for buffer to become free */ - spin_lock_irqsave(&card->hysdn_lock, flags); strcpy(card->async_data, line); card->async_len = strlen(line) + 1; card->async_channel = chan; @@ -173,23 +177,30 @@ /* now queue the task */ schedule_work(&card->irq_queue); - spin_unlock_irqrestore(&card->hysdn_lock, flags); + sti(); if (card->debug_flags & LOG_SCHED_ASYN) hysdn_addlog(card, "async tx-cfg data queued"); cnt++; /* short delay */ + cli(); while (card->async_busy) { + sti(); if (card->debug_flags & LOG_SCHED_ASYN) hysdn_addlog(card, "async tx-cfg waiting for tx-ready"); msleep_interruptible(20); /* Timeout 20ms */ - if (!--cnt) + if (!--cnt) { + spin_unlock_irqrestore(&card->hysdn_lock, flags); return (-ERR_ASYNC_TIME); /* timed out */ + } + cli(); } /* wait for buffer to become free again */ + spin_unlock_irqrestore(&card->hysdn_lock, flags); + if (card->debug_flags & LOG_SCHED_ASYN) hysdn_addlog(card, "async tx-cfg data send");