Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176730
b: refs/heads/master
c: 648eb8e
h: refs/heads/master
v: v3
  • Loading branch information
Jack Steiner authored and Linus Torvalds committed Dec 16, 2009
1 parent 40bf7e0 commit 35901f0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 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: f2965d68b6775290218ff2a040e64c8b40556280
refs/heads/master: 648eb8e50200a09db2488623958d9cbd4b8aaf55
22 changes: 19 additions & 3 deletions trunk/drivers/misc/sgi-gru/gruhandles.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ static void start_instruction(void *h)
gru_flush_cache(h);
}

static void report_instruction_timeout(void *h)
{
unsigned long goff = GSEGPOFF((unsigned long)h);
char *id = "???";

if (TYPE_IS(CCH, goff))
id = "CCH";
else if (TYPE_IS(TGH, goff))
id = "TGH";
else if (TYPE_IS(TFH, goff))
id = "TFH";

panic(KERN_ALERT "GRU %p (%s) is malfunctioning\n", h, id);
}

static int wait_instruction_complete(void *h, enum mcs_op opc)
{
int status;
Expand All @@ -64,9 +79,10 @@ static int wait_instruction_complete(void *h, enum mcs_op opc)
status = GET_MSEG_HANDLE_STATUS(h);
if (status != CCHSTATUS_ACTIVE)
break;
if (GRU_OPERATION_TIMEOUT < (get_cycles() - start_time))
panic("GRU %p is malfunctioning: start %ld, end %ld\n",
h, start_time, (unsigned long)get_cycles());
if (GRU_OPERATION_TIMEOUT < (get_cycles() - start_time)) {
report_instruction_timeout(h);
start_time = get_cycles();
}
}
if (gru_options & OPT_STATS)
update_mcs_stats(opc, get_cycles() - start_time);
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/misc/sgi-gru/gruhandles.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@
/* Convert an arbitrary handle address to the beginning of the GRU segment */
#define GRUBASE(h) ((void *)((unsigned long)(h) & ~(GRU_SIZE - 1)))

/* Test a valid handle address to determine the type */
#define TYPE_IS(hn, h) ((h) >= GRU_##hn##_BASE && (h) < \
GRU_##hn##_BASE + GRU_NUM_##hn * GRU_HANDLE_STRIDE && \
(((h) & (GRU_HANDLE_STRIDE - 1)) == 0))


/* General addressing macros. */
static inline void *get_gseg_base_address(void *base, int ctxnum)
{
Expand Down

0 comments on commit 35901f0

Please sign in to comment.