vserver 1.9.5.x5
[linux-2.6.git] / arch / ia64 / kernel / salinfo.c
index 500e105..d227fab 100644 (file)
@@ -19,6 +19,9 @@
  *
  * Jan 28 2004 kaos@sgi.com
  *   Periodically check for outstanding MCA or INIT records.
+ *
+ * Dec  5 2004 kaos@sgi.com
+ *   Standardize which records are cleared automatically.
  */
 
 #include <linux/types.h>
@@ -230,8 +233,8 @@ salinfo_log_wakeup(int type, u8 *buffer, u64 size, int irqsafe)
        }
 }
 
-/* Check for outstanding MCA/INIT records every 5 minutes (arbitrary) */
-#define SALINFO_TIMER_DELAY (5*60*HZ)
+/* Check for outstanding MCA/INIT records every minute (arbitrary) */
+#define SALINFO_TIMER_DELAY (60*HZ)
 static struct timer_list salinfo_timer;
 
 static void
@@ -382,8 +385,11 @@ static void
 salinfo_log_read_cpu(void *context)
 {
        struct salinfo_data *data = context;
+       sal_log_record_header_t *rh;
        data->log_size = ia64_sal_get_state_info(data->type, (u64 *) data->log_buffer);
-       if (data->type == SAL_INFO_TYPE_CPE || data->type == SAL_INFO_TYPE_CMC)
+       rh = (sal_log_record_header_t *)(data->log_buffer);
+       /* Clear corrected errors as they are read from SAL */
+       if (rh->severity == sal_log_severity_corrected)
                ia64_sal_clear_state_info(data->type);
 }
 
@@ -457,6 +463,7 @@ salinfo_log_clear_cpu(void *context)
 static int
 salinfo_log_clear(struct salinfo_data *data, int cpu)
 {
+       sal_log_record_header_t *rh;
        data->state = STATE_NO_DATA;
        if (!test_bit(cpu, &data->cpu_event))
                return 0;
@@ -469,10 +476,9 @@ salinfo_log_clear(struct salinfo_data *data, int cpu)
                data->saved_num = 0;
                spin_unlock_irqrestore(&data_saved_lock, flags);
        }
-       /* ia64_mca_log_sal_error_record or salinfo_log_read_cpu already cleared
-        * CPE and CMC errors
-        */
-       if (data->type != SAL_INFO_TYPE_CPE && data->type != SAL_INFO_TYPE_CMC)
+       rh = (sal_log_record_header_t *)(data->log_buffer);
+       /* Corrected errors have already been cleared from SAL */
+       if (rh->severity != sal_log_severity_corrected)
                call_on_cpu(cpu, salinfo_log_clear_cpu, data);
        /* clearing a record may make a new record visible */
        salinfo_log_new_read(cpu, data);