Ignore:
Timestamp:
Mar 28, 2014, 10:48:51 AM (11 years ago)
Author:
alain
Message:

Bug fix in both _tty_rx_isr() and _bdv_isr():
The ISR must do nothing it the status indicates that
there is no pending ISR.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_drivers/bdv_driver.c

    r295 r297  
    304304    unsigned int lpid       = procid % NB_PROCS_MAX;
    305305
    306     // acknowledge WTI in local XCU if required
    307     unsigned int value;
    308     if ( irq_type == IRQ_TYPE_WTI ) _xcu_get_wti_value( cluster_xy, irq_id, &value );
    309 
    310     // save status in _bdv_status variable and reset IRQ
    311     _bdv_status = _bdv_get_register( BLOCK_DEVICE_STATUS );
     306    // get BDV status (and reset IRQ)
     307    unsigned int status =  _bdv_get_register( BLOCK_DEVICE_STATUS );
     308
     309    // check status: does nothing if IDLE or BUSY
     310    if ( (status == BLOCK_DEVICE_IDLE) ||
     311         (status == BLOCK_DEVICE_BUSY) )   return;
     312 
     313    // reset WTI in XCU if WTI type
     314    if ( irq_type == IRQ_TYPE_WTI )
     315    {
     316        unsigned int value;
     317        _xcu_get_wti_value( cluster_xy, irq_id, &value );
     318    }
     319   
     320    // save status in kernel buffer _bdv_status
     321    _bdv_status = status;
    312322
    313323    // identify task waiting on BDV
     
    315325    unsigned int ltid       = _bdv_gtid & 0xFFFF;
    316326    unsigned int remote_xy  = rprocid / NB_PROCS_MAX;
     327
     328    // re-activates sleeping task
     329    _set_task_slot( rprocid,     // global processor index
     330                    ltid,        // local task index on processor
     331                    CTX_RUN_ID,  // CTX_RUN slot
     332                    1 );         // running
     333
     334    // requires a context switch for remote processor running the waiting task
     335    _xcu_send_wti( remote_xy,    // cluster index
     336                   lpid,         // local processor index
     337                   0 );          // don't force context switch if not idle
    317338
    318339#if GIET_DEBUG_IRQS  // we don't take the TTY lock to avoid deadlock
     
    343364#endif
    344365
    345     // re-activates sleeping task
    346     _set_task_slot( rprocid,     // global processor index
    347                     ltid,        // local task index on processor
    348                     CTX_RUN_ID,  // CTX_RUN slot
    349                     1 );         // running
    350 
    351     // requires a context switch for remote processor running the waiting task
    352     _xcu_send_wti( remote_xy,    // cluster index
    353                    lpid,         // local processor index
    354                    0 );          // don't force context switch if not idle
    355366}
    356367
Note: See TracChangeset for help on using the changeset viewer.