x86, UV: Correct BAU software acknowledge
[deliverable/linux.git] / arch / x86 / kernel / tlb_uv.c
index dc6a68312758a95bbf7b6dbb03ceb20c110aa60b..295a41122da12974e3b2c870e279cf82f6e8dcc5 100644 (file)
 #include <asm/irq_vectors.h>
 #include <asm/timer.h>
 
-struct msg_desc {
-       struct bau_payload_queue_entry *msg;
-       int msg_slot;
-       int sw_ack_slot;
-       struct bau_payload_queue_entry *va_queue_first;
-       struct bau_payload_queue_entry *va_queue_last;
-};
-
 /* timeouts in nanoseconds (indexed by UVH_AGING_PRESCALE_SEL urgency7 30:28) */
 static int timeout_base_ns[] = {
                20,
@@ -79,10 +71,6 @@ static DEFINE_PER_CPU(struct ptc_stats, ptcstats);
 static DEFINE_PER_CPU(struct bau_control, bau_control);
 static DEFINE_PER_CPU(cpumask_var_t, uv_flush_tlb_mask);
 
-struct reset_args {
-       int sender;
-};
-
 /*
  * Determine the first node on a uvhub. 'Nodes' are used for kernel
  * memory allocation.
@@ -153,7 +141,7 @@ static inline void uv_bau_process_retry_msg(struct msg_desc *mdp,
        struct ptc_stats *stat;
 
        msg = mdp->msg;
-       stat = &per_cpu(ptcstats, bcp->cpu);
+       stat = bcp->statp;
        stat->d_retries++;
        /*
         * cancel any message from msg+1 to the retry itself
@@ -173,15 +161,14 @@ static inline void uv_bau_process_retry_msg(struct msg_desc *mdp,
                        slot2 = msg2 - mdp->va_queue_first;
                        mmr = uv_read_local_mmr
                                (UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE);
-                       msg_res = ((msg2->sw_ack_vector << 8) |
-                                  msg2->sw_ack_vector);
+                       msg_res = msg2->sw_ack_vector;
                        /*
                         * This is a message retry; clear the resources held
                         * by the previous message only if they timed out.
                         * If it has not timed out we have an unexpected
                         * situation to report.
                         */
-                       if (mmr & (msg_res << 8)) {
+                       if (mmr & (msg_res << UV_SW_ACK_NPENDING)) {
                                /*
                                 * is the resource timed out?
                                 * make everyone ignore the cancelled message.
@@ -191,9 +178,9 @@ static inline void uv_bau_process_retry_msg(struct msg_desc *mdp,
                                cancel_count++;
                                uv_write_local_mmr(
                                    UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE_ALIAS,
-                                       (msg_res << 8) | msg_res);
-                       } else
-                               printk(KERN_INFO "note bau retry: no effect\n");
+                                       (msg_res << UV_SW_ACK_NPENDING) |
+                                        msg_res);
+                       }
                }
        }
        if (!cancel_count)
@@ -217,7 +204,7 @@ static void uv_bau_process_message(struct msg_desc *mdp,
         * This must be a normal message, or retry of a normal message
         */
        msg = mdp->msg;
-       stat = &per_cpu(ptcstats, bcp->cpu);
+       stat = bcp->statp;
        if (msg->address == TLB_FLUSH_ALL) {
                local_flush_tlb();
                stat->d_alltlb++;
@@ -301,7 +288,7 @@ uv_do_reset(void *ptr)
 
        bcp = &per_cpu(bau_control, smp_processor_id());
        rap = (struct reset_args *)ptr;
-       stat = &per_cpu(ptcstats, bcp->cpu);
+       stat = bcp->statp;
        stat->d_resets++;
 
        /*
@@ -329,13 +316,13 @@ uv_do_reset(void *ptr)
                         */
                        mmr = uv_read_local_mmr
                                        (UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE);
-                       msg_res = ((msg->sw_ack_vector << 8) |
-                                                  msg->sw_ack_vector);
+                       msg_res = msg->sw_ack_vector;
                        if (mmr & msg_res) {
                                stat->d_rcanceled++;
                                uv_write_local_mmr(
                                    UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE_ALIAS,
-                                                       msg_res);
+                                       (msg_res << UV_SW_ACK_NPENDING) |
+                                        msg_res);
                        }
                }
        }
@@ -419,7 +406,7 @@ static int uv_wait_completion(struct bau_desc *bau_desc,
        unsigned long mask;
        cycles_t ttime;
        cycles_t timeout_time;
-       struct ptc_stats *stat = &per_cpu(ptcstats, this_cpu);
+       struct ptc_stats *stat = bcp->statp;
        struct bau_control *hmaster;
 
        hmaster = bcp->uvhub_master;
@@ -583,7 +570,7 @@ const struct cpumask *uv_flush_send_and_wait(struct bau_desc *bau_desc,
        cycles_t time1;
        cycles_t time2;
        cycles_t elapsed;
-       struct ptc_stats *stat = &per_cpu(ptcstats, bcp->cpu);
+       struct ptc_stats *stat = bcp->statp;
        struct bau_control *smaster = bcp->socket_master;
        struct bau_control *hmaster = bcp->uvhub_master;
 
@@ -794,7 +781,7 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
                return cpumask;
 
        bcp = &per_cpu(bau_control, cpu);
-       stat = &per_cpu(ptcstats, cpu);
+       stat = bcp->statp;
 
        /* bau was disabled due to slow response */
        if (bcp->baudisabled) {
@@ -903,7 +890,7 @@ void uv_bau_message_interrupt(struct pt_regs *regs)
 
        time_start = get_cycles();
        bcp = &per_cpu(bau_control, smp_processor_id());
-       stat = &per_cpu(ptcstats, smp_processor_id());
+       stat = bcp->statp;
        msgdesc.va_queue_first = bcp->va_queue_first;
        msgdesc.va_queue_last = bcp->va_queue_last;
        msg = bcp->bau_msg_head;
@@ -1636,6 +1623,7 @@ static void uv_init_per_cpu(int nuvhubs)
        for_each_present_cpu(cpu) {
                bcp = &per_cpu(bau_control, cpu);
                bcp->baudisabled = 0;
+               bcp->statp = &per_cpu(ptcstats, cpu);
                /* time interval to catch a hardware stay-busy bug */
                bcp->timeout_interval = microsec_2_cycles(2*timeout_us);
                bcp->max_bau_concurrent = max_bau_concurrent;
@@ -1673,7 +1661,6 @@ static int __init uv_bau_init(void)
                zalloc_cpumask_var_node(&per_cpu(uv_flush_tlb_mask, cur_cpu),
                                       GFP_KERNEL, cpu_to_node(cur_cpu));
 
-       max_bau_concurrent = MAX_BAU_CONCURRENT;
        uv_nshift = uv_hub_info->m_val;
        uv_mmask = (1UL << uv_hub_info->m_val) - 1;
        nuvhubs = uv_num_possible_blades();
This page took 0.028909 seconds and 5 git commands to generate.