aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorCliff Wickman <cpw@sgi.com>2009-04-03 09:34:32 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-03 12:25:27 -0400
commitc4c4688f72e638708e5f6b5c259699de82a36fec (patch)
treee3ab3695f5efdb4603449ef0024d93190e7ea0c3 /arch/x86
parent9674f35b1ec17577163897f052f405c1e9e5893d (diff)
x86: UV BAU messaging timeouts
This patch replaces a 'nop' uv_enable_timeouts() in the UV TLB shootdown code. (somehow, long ago that function got eviscerated) If any cpu in the destination node does not get interrupted by the message and post completion in a reasonable time the hardware should respond to the sender with an error. This function enables such timeouts. Tested on the UV hardware simulator. Signed-off-by: Cliff Wickman <cpw@sgi.com> LKML-Reference: <E1LpjXU-00007e-Qh@eag09.americas.sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/uv/uv_mmrs.h5
-rw-r--r--arch/x86/kernel/tlb_uv.c56
2 files changed, 50 insertions, 11 deletions
diff --git a/arch/x86/include/asm/uv/uv_mmrs.h b/arch/x86/include/asm/uv/uv_mmrs.h
index db68ac8a5ac2..2cae46c7c8a2 100644
--- a/arch/x86/include/asm/uv/uv_mmrs.h
+++ b/arch/x86/include/asm/uv/uv_mmrs.h
@@ -17,6 +17,11 @@
17/* ========================================================================= */ 17/* ========================================================================= */
18/* UVH_BAU_DATA_CONFIG */ 18/* UVH_BAU_DATA_CONFIG */
19/* ========================================================================= */ 19/* ========================================================================= */
20#define UVH_LB_BAU_MISC_CONTROL 0x320170UL
21#define UV_ENABLE_INTD_SOFT_ACK_MODE_SHIFT 15
22#define UV_INTD_SOFT_ACK_TIMEOUT_PERIOD_SHIFT 16
23#define UV_INTD_SOFT_ACK_TIMEOUT_PERIOD 0x000000000bUL
24/* 1011 timebase 7 (168millisec) * 3 ticks -> 500ms */
20#define UVH_BAU_DATA_CONFIG 0x61680UL 25#define UVH_BAU_DATA_CONFIG 0x61680UL
21#define UVH_BAU_DATA_CONFIG_32 0x0438 26#define UVH_BAU_DATA_CONFIG_32 0x0438
22 27
diff --git a/arch/x86/kernel/tlb_uv.c b/arch/x86/kernel/tlb_uv.c
index b833bc634d17..fced96e94e22 100644
--- a/arch/x86/kernel/tlb_uv.c
+++ b/arch/x86/kernel/tlb_uv.c
@@ -445,24 +445,58 @@ void uv_bau_message_interrupt(struct pt_regs *regs)
445 set_irq_regs(old_regs); 445 set_irq_regs(old_regs);
446} 446}
447 447
448/*
449 * uv_enable_timeouts
450 *
451 * Each target blade (i.e. blades that have cpu's) needs to have
452 * shootdown message timeouts enabled. The timeout does not cause
453 * an interrupt, but causes an error message to be returned to
454 * the sender.
455 */
448static void uv_enable_timeouts(void) 456static void uv_enable_timeouts(void)
449{ 457{
450 int i;
451 int blade; 458 int blade;
452 int last_blade; 459 int nblades;
453 int pnode; 460 int pnode;
454 int cur_cpu = 0; 461 unsigned long mmr_image;
455 unsigned long apicid; 462
463 nblades = uv_num_possible_blades();
456 464
457 last_blade = -1; 465 for (blade = 0; blade < nblades; blade++) {
458 for_each_online_node(i) { 466 if (!uv_blade_nr_possible_cpus(blade))
459 blade = uv_node_to_blade_id(i);
460 if (blade == last_blade)
461 continue; 467 continue;
462 last_blade = blade; 468
463 apicid = per_cpu(x86_cpu_to_apicid, cur_cpu);
464 pnode = uv_blade_to_pnode(blade); 469 pnode = uv_blade_to_pnode(blade);
465 cur_cpu += uv_blade_nr_possible_cpus(i); 470 mmr_image =
471 uv_read_global_mmr64(pnode, UVH_LB_BAU_MISC_CONTROL);
472 /*
473 * Set the timeout period and then lock it in, in three
474 * steps; captures and locks in the period.
475 *
476 * To program the period, the SOFT_ACK_MODE must be off.
477 */
478 mmr_image &= ~((unsigned long)1 <<
479 UV_ENABLE_INTD_SOFT_ACK_MODE_SHIFT);
480 uv_write_global_mmr64
481 (pnode, UVH_LB_BAU_MISC_CONTROL, mmr_image);
482 /*
483 * Set the 4-bit period.
484 */
485 mmr_image &= ~((unsigned long)0xf <<
486 UV_INTD_SOFT_ACK_TIMEOUT_PERIOD_SHIFT);
487 mmr_image |= (UV_INTD_SOFT_ACK_TIMEOUT_PERIOD <<
488 UV_INTD_SOFT_ACK_TIMEOUT_PERIOD_SHIFT);
489 uv_write_global_mmr64
490 (pnode, UVH_LB_BAU_MISC_CONTROL, mmr_image);
491 /*
492 * Subsequent reversals of the timebase bit (3) cause an
493 * immediate timeout of one or all INTD resources as
494 * indicated in bits 2:0 (7 causes all of them to timeout).
495 */
496 mmr_image |= ((unsigned long)1 <<
497 UV_ENABLE_INTD_SOFT_ACK_MODE_SHIFT);
498 uv_write_global_mmr64
499 (pnode, UVH_LB_BAU_MISC_CONTROL, mmr_image);
466 } 500 }
467} 501}
468 502