aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJack Steiner <steiner@sgi.com>2009-06-17 19:28:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-18 16:04:02 -0400
commit270952a907220c0331fdaecbb55df892921c5e2d (patch)
tree374bc1a642108f2c878a86903a70d8af8cd7a04a /drivers
parenteb5bd5e52a8eafb1ddb42f983d41f97552afa106 (diff)
gru: update to rev 0.9 of gru spec
Update GRU driver to the latest version of the GRU spec. This consists of minor updates: - changes & additions to error status bits - new restriction on handling of TLB misses while in FMM mode - new field (not used by software) in TFH Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/sgi-gru/gru_instructions.h19
-rw-r--r--drivers/misc/sgi-gru/grufault.c8
-rw-r--r--drivers/misc/sgi-gru/gruhandles.h3
-rw-r--r--drivers/misc/sgi-gru/grukservices.c3
-rw-r--r--drivers/misc/sgi-gru/gruprocfs.c1
-rw-r--r--drivers/misc/sgi-gru/grutables.h1
6 files changed, 24 insertions, 11 deletions
diff --git a/drivers/misc/sgi-gru/gru_instructions.h b/drivers/misc/sgi-gru/gru_instructions.h
index 2feb885ca96..eb9140d32e6 100644
--- a/drivers/misc/sgi-gru/gru_instructions.h
+++ b/drivers/misc/sgi-gru/gru_instructions.h
@@ -253,32 +253,37 @@ struct gru_instruction {
253#define CBE_CAUSE_HA_RESPONSE_FATAL (1 << 13) 253#define CBE_CAUSE_HA_RESPONSE_FATAL (1 << 13)
254#define CBE_CAUSE_HA_RESPONSE_NON_FATAL (1 << 14) 254#define CBE_CAUSE_HA_RESPONSE_NON_FATAL (1 << 14)
255#define CBE_CAUSE_ADDRESS_SPACE_DECODE_ERROR (1 << 15) 255#define CBE_CAUSE_ADDRESS_SPACE_DECODE_ERROR (1 << 15)
256#define CBE_CAUSE_RESPONSE_DATA_ERROR (1 << 16) 256#define CBE_CAUSE_PROTOCOL_STATE_DATA_ERROR (1 << 16)
257#define CBE_CAUSE_PROTOCOL_STATE_DATA_ERROR (1 << 17) 257#define CBE_CAUSE_RA_RESPONSE_DATA_ERROR (1 << 17)
258#define CBE_CAUSE_HA_RESPONSE_DATA_ERROR (1 << 18)
258 259
259/* CBE cbrexecstatus bits */ 260/* CBE cbrexecstatus bits */
260#define CBR_EXS_ABORT_OCC_BIT 0 261#define CBR_EXS_ABORT_OCC_BIT 0
261#define CBR_EXS_INT_OCC_BIT 1 262#define CBR_EXS_INT_OCC_BIT 1
262#define CBR_EXS_PENDING_BIT 2 263#define CBR_EXS_PENDING_BIT 2
263#define CBR_EXS_QUEUED_BIT 3 264#define CBR_EXS_QUEUED_BIT 3
264#define CBR_EXS_TLBHW_BIT 4 265#define CBR_EXS_TLB_INVAL_BIT 4
265#define CBR_EXS_EXCEPTION_BIT 5 266#define CBR_EXS_EXCEPTION_BIT 5
266 267
267#define CBR_EXS_ABORT_OCC (1 << CBR_EXS_ABORT_OCC_BIT) 268#define CBR_EXS_ABORT_OCC (1 << CBR_EXS_ABORT_OCC_BIT)
268#define CBR_EXS_INT_OCC (1 << CBR_EXS_INT_OCC_BIT) 269#define CBR_EXS_INT_OCC (1 << CBR_EXS_INT_OCC_BIT)
269#define CBR_EXS_PENDING (1 << CBR_EXS_PENDING_BIT) 270#define CBR_EXS_PENDING (1 << CBR_EXS_PENDING_BIT)
270#define CBR_EXS_QUEUED (1 << CBR_EXS_QUEUED_BIT) 271#define CBR_EXS_QUEUED (1 << CBR_EXS_QUEUED_BIT)
271#define CBR_EXS_TLBHW (1 << CBR_EXS_TLBHW_BIT) 272#define CBR_TLB_INVAL (1 << CBR_EXS_TLB_INVAL_BIT)
272#define CBR_EXS_EXCEPTION (1 << CBR_EXS_EXCEPTION_BIT) 273#define CBR_EXS_EXCEPTION (1 << CBR_EXS_EXCEPTION_BIT)
273 274
274/* 275/*
275 * Exceptions are retried for the following cases. If any OTHER bits are set 276 * Exceptions are retried for the following cases. If any OTHER bits are set
276 * in ecause, the exception is not retryable. 277 * in ecause, the exception is not retryable.
277 */ 278 */
278#define EXCEPTION_RETRY_BITS (CBE_CAUSE_RESPONSE_DATA_ERROR | \ 279#define EXCEPTION_RETRY_BITS (CBE_CAUSE_EXECUTION_HW_ERROR | \
279 CBE_CAUSE_RA_REQUEST_TIMEOUT | \
280 CBE_CAUSE_TLBHW_ERROR | \ 280 CBE_CAUSE_TLBHW_ERROR | \
281 CBE_CAUSE_HA_REQUEST_TIMEOUT) 281 CBE_CAUSE_RA_REQUEST_TIMEOUT | \
282 CBE_CAUSE_RA_RESPONSE_NON_FATAL | \
283 CBE_CAUSE_HA_RESPONSE_NON_FATAL | \
284 CBE_CAUSE_RA_RESPONSE_DATA_ERROR | \
285 CBE_CAUSE_HA_RESPONSE_DATA_ERROR \
286 )
282 287
283/* Message queue head structure */ 288/* Message queue head structure */
284union gru_mesqhead { 289union gru_mesqhead {
diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c
index 8443e90f9f6..a489807613f 100644
--- a/drivers/misc/sgi-gru/grufault.c
+++ b/drivers/misc/sgi-gru/grufault.c
@@ -339,8 +339,12 @@ static int gru_try_dropin(struct gru_thread_state *gts,
339 * Might be a hardware race OR a stupid user. Ignore FMM because FMM 339 * Might be a hardware race OR a stupid user. Ignore FMM because FMM
340 * is a transient state. 340 * is a transient state.
341 */ 341 */
342 if (tfh->status != TFHSTATUS_EXCEPTION) 342 if (tfh->status != TFHSTATUS_EXCEPTION) {
343 goto failnoexception; 343 gru_flush_cache(tfh);
344 if (tfh->status != TFHSTATUS_EXCEPTION)
345 goto failnoexception;
346 STAT(tfh_stale_on_fault);
347 }
344 if (tfh->state == TFHSTATE_IDLE) 348 if (tfh->state == TFHSTATE_IDLE)
345 goto failidle; 349 goto failidle;
346 if (tfh->state == TFHSTATE_MISS_FMM && cb) 350 if (tfh->state == TFHSTATE_MISS_FMM && cb)
diff --git a/drivers/misc/sgi-gru/gruhandles.h b/drivers/misc/sgi-gru/gruhandles.h
index 9f41e2cc09d..99ec82678f5 100644
--- a/drivers/misc/sgi-gru/gruhandles.h
+++ b/drivers/misc/sgi-gru/gruhandles.h
@@ -255,7 +255,8 @@ struct gru_tlb_fault_handle {
255 unsigned int state:3; 255 unsigned int state:3;
256 unsigned int fill3:1; 256 unsigned int fill3:1;
257 257
258 unsigned int cause:7; 258 unsigned int cause:6;
259 unsigned int cb_int:1;
259 unsigned int fill4:1; 260 unsigned int fill4:1;
260 261
261 unsigned int indexway:12; /* DW 0 - high 32 */ 262 unsigned int indexway:12; /* DW 0 - high 32 */
diff --git a/drivers/misc/sgi-gru/grukservices.c b/drivers/misc/sgi-gru/grukservices.c
index 7d7952b27e0..ba6fcd963f3 100644
--- a/drivers/misc/sgi-gru/grukservices.c
+++ b/drivers/misc/sgi-gru/grukservices.c
@@ -406,7 +406,8 @@ static int gru_retry_exception(void *cb)
406 return CBS_IDLE; 406 return CBS_IDLE;
407 407
408 gru_get_cb_exception_detail(cb, &excdet); 408 gru_get_cb_exception_detail(cb, &excdet);
409 if (excdet.ecause & ~EXCEPTION_RETRY_BITS) 409 if ((excdet.ecause & ~EXCEPTION_RETRY_BITS) ||
410 (excdet.cbrexecstatus & CBR_EXS_ABORT_OCC))
410 break; 411 break;
411 if (retry-- == 0) 412 if (retry-- == 0)
412 break; 413 break;
diff --git a/drivers/misc/sgi-gru/gruprocfs.c b/drivers/misc/sgi-gru/gruprocfs.c
index 6ef4cb4b84c..b5b9cf5c182 100644
--- a/drivers/misc/sgi-gru/gruprocfs.c
+++ b/drivers/misc/sgi-gru/gruprocfs.c
@@ -89,6 +89,7 @@ static int statistics_show(struct seq_file *s, void *p)
89 printstat(s, tlb_dropin_fail_fmm); 89 printstat(s, tlb_dropin_fail_fmm);
90 printstat(s, tlb_dropin_fail_no_exception); 90 printstat(s, tlb_dropin_fail_no_exception);
91 printstat(s, tlb_dropin_fail_no_exception_war); 91 printstat(s, tlb_dropin_fail_no_exception_war);
92 printstat(s, tfh_stale_on_fault);
92 printstat(s, mmu_invalidate_range); 93 printstat(s, mmu_invalidate_range);
93 printstat(s, mmu_invalidate_page); 94 printstat(s, mmu_invalidate_page);
94 printstat(s, mmu_clear_flush_young); 95 printstat(s, mmu_clear_flush_young);
diff --git a/drivers/misc/sgi-gru/grutables.h b/drivers/misc/sgi-gru/grutables.h
index 6dfb3e69411..246c63883eb 100644
--- a/drivers/misc/sgi-gru/grutables.h
+++ b/drivers/misc/sgi-gru/grutables.h
@@ -212,6 +212,7 @@ struct gru_stats_s {
212 atomic_long_t tlb_dropin_fail_fmm; 212 atomic_long_t tlb_dropin_fail_fmm;
213 atomic_long_t tlb_dropin_fail_no_exception; 213 atomic_long_t tlb_dropin_fail_no_exception;
214 atomic_long_t tlb_dropin_fail_no_exception_war; 214 atomic_long_t tlb_dropin_fail_no_exception_war;
215 atomic_long_t tfh_stale_on_fault;
215 atomic_long_t mmu_invalidate_range; 216 atomic_long_t mmu_invalidate_range;
216 atomic_long_t mmu_invalidate_page; 217 atomic_long_t mmu_invalidate_page;
217 atomic_long_t mmu_clear_flush_young; 218 atomic_long_t mmu_clear_flush_young;