aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/sgi-gru/gru_instructions.h33
1 files changed, 16 insertions, 17 deletions
diff --git a/drivers/misc/sgi-gru/gru_instructions.h b/drivers/misc/sgi-gru/gru_instructions.h
index eb9140d32e62..3c9c06618e6a 100644
--- a/drivers/misc/sgi-gru/gru_instructions.h
+++ b/drivers/misc/sgi-gru/gru_instructions.h
@@ -623,9 +623,11 @@ static inline int gru_get_cb_substatus(void *cb)
623 return cbs->isubstatus; 623 return cbs->isubstatus;
624} 624}
625 625
626/* Check the status of a CB. If the CB is in UPM mode, call the 626/*
627 * OS to handle the UPM status. 627 * User interface to check an instruction status. UPM and exceptions
628 * Returns the CB status field value (0 for normal completion) 628 * are handled automatically. However, this function does NOT wait
629 * for an active instruction to complete.
630 *
629 */ 631 */
630static inline int gru_check_status(void *cb) 632static inline int gru_check_status(void *cb)
631{ 633{
@@ -633,34 +635,31 @@ static inline int gru_check_status(void *cb)
633 int ret; 635 int ret;
634 636
635 ret = cbs->istatus; 637 ret = cbs->istatus;
636 if (ret == CBS_CALL_OS) 638 if (ret != CBS_ACTIVE)
637 ret = gru_check_status_proc(cb); 639 ret = gru_check_status_proc(cb);
638 return ret; 640 return ret;
639} 641}
640 642
641/* Wait for CB to complete. 643/*
642 * Returns the CB status field value (0 for normal completion) 644 * User interface (via inline function) to wait for an instruction
645 * to complete. Completion status (IDLE or EXCEPTION is returned
646 * to the user. Exception due to hardware errors are automatically
647 * retried before returning an exception.
648 *
643 */ 649 */
644static inline int gru_wait(void *cb) 650static inline int gru_wait(void *cb)
645{ 651{
646 struct gru_control_block_status *cbs = (void *)cb; 652 return gru_wait_proc(cb);
647 int ret = cbs->istatus;
648
649 if (ret != CBS_IDLE)
650 ret = gru_wait_proc(cb);
651 return ret;
652} 653}
653 654
654/* Wait for CB to complete. Aborts program if error. (Note: error does NOT 655/*
656 * Wait for CB to complete. Aborts program if error. (Note: error does NOT
655 * mean TLB mis - only fatal errors such as memory parity error or user 657 * mean TLB mis - only fatal errors such as memory parity error or user
656 * bugs will cause termination. 658 * bugs will cause termination.
657 */ 659 */
658static inline void gru_wait_abort(void *cb) 660static inline void gru_wait_abort(void *cb)
659{ 661{
660 struct gru_control_block_status *cbs = (void *)cb; 662 gru_wait_abort_proc(cb);
661
662 if (cbs->istatus != CBS_IDLE)
663 gru_wait_abort_proc(cb);
664} 663}
665 664
666 665