Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset aa028db in mainline


Ignore:
Timestamp:
2010-04-25T18:44:43Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
d69f959
Parents:
37c9fc8
Message:

Fix ipc_wait_for_call() not to take the TASK spinlock while holding the
answerbox spinlock. Also disable interrutps when holding the TASK spinlock.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ipc.c

    r37c9fc8 raa028db  
    422422        call_t *request;
    423423        ipl_t ipl;
     424        uint64_t irq_cnt = 0;
     425        uint64_t answer_cnt = 0;
     426        uint64_t call_cnt = 0;
    424427        int rc;
    425428
     
    431434        spinlock_lock(&box->lock);
    432435        if (!list_empty(&box->irq_notifs)) {
    433 
    434436                /* Count recieved IRQ notification */
    435                 spinlock_lock(&TASK->lock);
    436                 TASK->ipc_info.irq_notif_recieved++;
    437                 spinlock_unlock(&TASK->lock);
     437                irq_cnt++;     
    438438
    439439                ipl = interrupts_disable();
     
    447447        } else if (!list_empty(&box->answers)) {
    448448                /* Count recieved answer */
    449                 spinlock_lock(&TASK->lock);
    450                 TASK->ipc_info.answer_recieved++;
    451                 spinlock_unlock(&TASK->lock);
     449                answer_cnt++;
    452450
    453451                /* Handle asynchronous answers */
     
    457455        } else if (!list_empty(&box->calls)) {
    458456                /* Count recieved call */
    459                 spinlock_lock(&TASK->lock);
    460                 TASK->ipc_info.call_recieved++;
    461                 spinlock_unlock(&TASK->lock);
     457                call_cnt++;
    462458
    463459                /* Handle requests */
     
    472468        }
    473469        spinlock_unlock(&box->lock);
     470       
     471        ipl = interrupts_disable();
     472        spinlock_lock(&TASK->lock);
     473        TASK->ipc_info.irq_notif_recieved += irq_cnt;
     474        TASK->ipc_info.answer_recieved += answer_cnt;
     475        TASK->ipc_info.call_recieved += call_cnt;
     476        spinlock_unlock(&TASK->lock);
     477        interrupts_restore(ipl);
     478
    474479        return request;
    475480}
Note: See TracChangeset for help on using the changeset viewer.