aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-gru/grukservices.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/sgi-gru/grukservices.c')
-rw-r--r--drivers/misc/sgi-gru/grukservices.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/drivers/misc/sgi-gru/grukservices.c b/drivers/misc/sgi-gru/grukservices.c
index 8c81aca0463a..4da6f56833d1 100644
--- a/drivers/misc/sgi-gru/grukservices.c
+++ b/drivers/misc/sgi-gru/grukservices.c
@@ -414,8 +414,8 @@ char *gru_get_cb_exception_detail_str(int ret, void *cb,
414 if (ret > 0 && gen->istatus == CBS_EXCEPTION) { 414 if (ret > 0 && gen->istatus == CBS_EXCEPTION) {
415 gru_get_cb_exception_detail(cb, &excdet); 415 gru_get_cb_exception_detail(cb, &excdet);
416 snprintf(buf, size, 416 snprintf(buf, size,
417 "GRU exception: cb %p, opc %d, exopc %d, ecause 0x%x," 417 "GRU:%d exception: cb %p, opc %d, exopc %d, ecause 0x%x,"
418 "excdet0 0x%lx, excdet1 0x%x", 418 "excdet0 0x%lx, excdet1 0x%x", smp_processor_id(),
419 gen, excdet.opc, excdet.exopc, excdet.ecause, 419 gen, excdet.opc, excdet.exopc, excdet.ecause,
420 excdet.exceptdet0, excdet.exceptdet1); 420 excdet.exceptdet0, excdet.exceptdet1);
421 } else { 421 } else {
@@ -604,6 +604,8 @@ static int send_noop_message(void *cb, struct gru_message_queue_desc *mqd,
604 ret = MQE_UNEXPECTED_CB_ERR; 604 ret = MQE_UNEXPECTED_CB_ERR;
605 break; 605 break;
606 case CBSS_PAGE_OVERFLOW: 606 case CBSS_PAGE_OVERFLOW:
607 STAT(mesq_noop_page_overflow);
608 /* fallthru */
607 default: 609 default:
608 BUG(); 610 BUG();
609 } 611 }
@@ -745,6 +747,9 @@ static int send_message_failure(void *cb, struct gru_message_queue_desc *mqd,
745 STAT(mesq_send_put_nacked); 747 STAT(mesq_send_put_nacked);
746 ret = send_message_put_nacked(cb, mqd, mesg, lines); 748 ret = send_message_put_nacked(cb, mqd, mesg, lines);
747 break; 749 break;
750 case CBSS_PAGE_OVERFLOW:
751 STAT(mesq_page_overflow);
752 /* fallthru */
748 default: 753 default:
749 BUG(); 754 BUG();
750 } 755 }
@@ -837,7 +842,6 @@ void *gru_get_next_message(struct gru_message_queue_desc *mqd)
837 int present = mhdr->present; 842 int present = mhdr->present;
838 843
839 /* skip NOOP messages */ 844 /* skip NOOP messages */
840 STAT(mesq_receive);
841 while (present == MQS_NOOP) { 845 while (present == MQS_NOOP) {
842 gru_free_message(mqd, mhdr); 846 gru_free_message(mqd, mhdr);
843 mhdr = mq->next; 847 mhdr = mq->next;
@@ -857,6 +861,7 @@ void *gru_get_next_message(struct gru_message_queue_desc *mqd)
857 if (mhdr->lines == 2) 861 if (mhdr->lines == 2)
858 restore_present2(mhdr, mhdr->present2); 862 restore_present2(mhdr, mhdr->present2);
859 863
864 STAT(mesq_receive);
860 return mhdr; 865 return mhdr;
861} 866}
862EXPORT_SYMBOL_GPL(gru_get_next_message); 867EXPORT_SYMBOL_GPL(gru_get_next_message);
@@ -927,24 +932,24 @@ static int quicktest0(unsigned long arg)
927 932
928 gru_vload(cb, uv_gpa(&word0), gru_get_tri(dsr), XTYPE_DW, 1, 1, IMA); 933 gru_vload(cb, uv_gpa(&word0), gru_get_tri(dsr), XTYPE_DW, 1, 1, IMA);
929 if (gru_wait(cb) != CBS_IDLE) { 934 if (gru_wait(cb) != CBS_IDLE) {
930 printk(KERN_DEBUG "GRU quicktest0: CBR failure 1\n"); 935 printk(KERN_DEBUG "GRU:%d quicktest0: CBR failure 1\n", smp_processor_id());
931 goto done; 936 goto done;
932 } 937 }
933 938
934 if (*p != MAGIC) { 939 if (*p != MAGIC) {
935 printk(KERN_DEBUG "GRU: quicktest0 bad magic 0x%lx\n", *p); 940 printk(KERN_DEBUG "GRU:%d quicktest0 bad magic 0x%lx\n", smp_processor_id(), *p);
936 goto done; 941 goto done;
937 } 942 }
938 gru_vstore(cb, uv_gpa(&word1), gru_get_tri(dsr), XTYPE_DW, 1, 1, IMA); 943 gru_vstore(cb, uv_gpa(&word1), gru_get_tri(dsr), XTYPE_DW, 1, 1, IMA);
939 if (gru_wait(cb) != CBS_IDLE) { 944 if (gru_wait(cb) != CBS_IDLE) {
940 printk(KERN_DEBUG "GRU quicktest0: CBR failure 2\n"); 945 printk(KERN_DEBUG "GRU:%d quicktest0: CBR failure 2\n", smp_processor_id());
941 goto done; 946 goto done;
942 } 947 }
943 948
944 if (word0 != word1 || word1 != MAGIC) { 949 if (word0 != word1 || word1 != MAGIC) {
945 printk(KERN_DEBUG 950 printk(KERN_DEBUG
946 "GRU quicktest0 err: found 0x%lx, expected 0x%lx\n", 951 "GRU:%d quicktest0 err: found 0x%lx, expected 0x%lx\n",
947 word1, MAGIC); 952 smp_processor_id(), word1, MAGIC);
948 goto done; 953 goto done;
949 } 954 }
950 ret = 0; 955 ret = 0;
@@ -981,8 +986,11 @@ static int quicktest1(unsigned long arg)
981 if (ret) 986 if (ret)
982 break; 987 break;
983 } 988 }
984 if (ret != MQE_QUEUE_FULL || i != 4) 989 if (ret != MQE_QUEUE_FULL || i != 4) {
990 printk(KERN_DEBUG "GRU:%d quicktest1: unexpect status %d, i %d\n",
991 smp_processor_id(), ret, i);
985 goto done; 992 goto done;
993 }
986 994
987 for (i = 0; i < 6; i++) { 995 for (i = 0; i < 6; i++) {
988 m = gru_get_next_message(&mqd); 996 m = gru_get_next_message(&mqd);
@@ -990,7 +998,12 @@ static int quicktest1(unsigned long arg)
990 break; 998 break;
991 gru_free_message(&mqd, m); 999 gru_free_message(&mqd, m);
992 } 1000 }
993 ret = (i == 4) ? 0 : -EIO; 1001 if (i != 4) {
1002 printk(KERN_DEBUG "GRU:%d quicktest2: bad message, i %d, m %p, m8 %d\n",
1003 smp_processor_id(), i, m, m ? m[8] : -1);
1004 goto done;
1005 }
1006 ret = 0;
994 1007
995done: 1008done:
996 kfree(p); 1009 kfree(p);
@@ -1069,7 +1082,7 @@ static int quicktest3(unsigned long arg)
1069 memset(buf1, get_cycles() & 255, sizeof(buf1)); 1082 memset(buf1, get_cycles() & 255, sizeof(buf1));
1070 gru_copy_gpa(uv_gpa(buf2), uv_gpa(buf1), BUFSIZE); 1083 gru_copy_gpa(uv_gpa(buf2), uv_gpa(buf1), BUFSIZE);
1071 if (memcmp(buf1, buf2, BUFSIZE)) { 1084 if (memcmp(buf1, buf2, BUFSIZE)) {
1072 printk(KERN_DEBUG "GRU quicktest3 error\n"); 1085 printk(KERN_DEBUG "GRU:%d quicktest3 error\n", smp_processor_id());
1073 ret = -EIO; 1086 ret = -EIO;
1074 } 1087 }
1075 return ret; 1088 return ret;