Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176734
b: refs/heads/master
c: 33f3648
h: refs/heads/master
v: v3
  • Loading branch information
Jack Steiner authored and Linus Torvalds committed Dec 16, 2009
1 parent 83710f4 commit a9ff38c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b8229bedd1f39799dc83d5c0dad0bd9cd3e5f44c
refs/heads/master: 33f3648342dc40f8bd6383a5a1a91c22e06f6b77
48 changes: 39 additions & 9 deletions trunk/drivers/misc/sgi-gru/grukservices.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,7 @@ static int quicktest2(unsigned long arg)
int ret = 0;
unsigned long *buf;
void *cb0, *cb;
struct gru_control_block_status *gen;
int i, k, istatus, bytes;

bytes = numcb * 4 * 8;
Expand All @@ -1023,20 +1024,30 @@ static int quicktest2(unsigned long arg)
XTYPE_DW, 4, 1, IMA_INTERRUPT);

ret = 0;
for (k = 0; k < numcb; k++) {
k = numcb;
do {
gru_wait_async_cbr(han);
for (i = 0; i < numcb; i++) {
cb = cb0 + i * GRU_HANDLE_STRIDE;
istatus = gru_check_status(cb);
if (istatus == CBS_ACTIVE)
continue;
if (istatus == CBS_EXCEPTION)
ret = -EFAULT;
else if (buf[i] || buf[i + 1] || buf[i + 2] ||
buf[i + 3])
ret = -EIO;
if (istatus != CBS_ACTIVE && istatus != CBS_CALL_OS)
break;
}
}
if (i == numcb)
continue;
if (istatus != CBS_IDLE) {
printk(KERN_DEBUG "GRU:%d quicktest2: cb %d, exception\n", smp_processor_id(), i);
ret = -EFAULT;
} else if (buf[4 * i] || buf[4 * i + 1] || buf[4 * i + 2] ||
buf[4 * i + 3]) {
printk(KERN_DEBUG "GRU:%d quicktest2:cb %d, buf 0x%lx, 0x%lx, 0x%lx, 0x%lx\n",
smp_processor_id(), i, buf[4 * i], buf[4 * i + 1], buf[4 * i + 2], buf[4 * i + 3]);
ret = -EIO;
}
k--;
gen = cb;
gen->istatus = CBS_CALL_OS; /* don't handle this CBR again */
} while (k);
BUG_ON(cmp.done);

gru_unlock_async_resource(han);
Expand All @@ -1046,6 +1057,22 @@ static int quicktest2(unsigned long arg)
return ret;
}

#define BUFSIZE 200
static int quicktest3(unsigned long arg)
{
char buf1[BUFSIZE], buf2[BUFSIZE];
int ret = 0;

memset(buf2, 0, sizeof(buf2));
memset(buf1, get_cycles() & 255, sizeof(buf1));
gru_copy_gpa(uv_gpa(buf2), uv_gpa(buf1), BUFSIZE);
if (memcmp(buf1, buf2, BUFSIZE)) {
printk(KERN_DEBUG "GRU quicktest3 error\n");
ret = -EIO;
}
return ret;
}

/*
* Debugging only. User hook for various kernel tests
* of driver & gru.
Expand All @@ -1064,6 +1091,9 @@ int gru_ktest(unsigned long arg)
case 2:
ret = quicktest2(arg);
break;
case 3:
ret = quicktest3(arg);
break;
case 99:
ret = gru_free_kernel_contexts();
break;
Expand Down

0 comments on commit a9ff38c

Please sign in to comment.