Commit d4a739f7 authored by claes's avatar claes

Changed error handling so that sporadic error are allowed and does not cause system to halt

parent 98ffea19
/* /*
* Proview $Id: rt_io_m_ai_hvai32.c,v 1.2 2006-04-12 10:14:49 claes Exp $ * Proview $Id: rt_io_m_ai_hvai32.c,v 1.3 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -58,6 +58,7 @@ typedef struct { ...@@ -58,6 +58,7 @@ typedef struct {
unsigned int Address; unsigned int Address;
int Qbus_fp; int Qbus_fp;
int ScanCount[IO_MAXCHAN]; int ScanCount[IO_MAXCHAN];
pwr_tTime ErrTime;
} io_sLocal; } io_sLocal;
static pwr_tStatus AiRangeToCoef( static pwr_tStatus AiRangeToCoef(
...@@ -179,6 +180,7 @@ static pwr_tStatus IoCardRead ( ...@@ -179,6 +180,7 @@ static pwr_tStatus IoCardRead (
qbus_io_read rb; qbus_io_read rb;
qbus_io_write wb; qbus_io_write wb;
int timeout; int timeout;
pwr_tTime now;
local = (io_sLocal *) cp->Local; local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ai_HVAI32 *) cp->op; op = (pwr_sClass_Ai_HVAI32 *) cp->op;
...@@ -241,7 +243,16 @@ static pwr_tStatus IoCardRead ( ...@@ -241,7 +243,16 @@ static pwr_tStatus IoCardRead (
} }
#endif #endif
/* Increase error count and check error limits */ /* Increase error count and check error limits */
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++; op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit) if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name); errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/* /*
* Proview $Id: rt_io_m_ao_hvao4.c,v 1.3 2006-09-05 12:03:01 claes Exp $ * Proview $Id: rt_io_m_ao_hvao4.c,v 1.4 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -59,6 +59,7 @@ typedef struct { ...@@ -59,6 +59,7 @@ typedef struct {
pwr_tFloat32 OldValue[IO_MAXCHAN]; pwr_tFloat32 OldValue[IO_MAXCHAN];
pwr_tBoolean OldTestOn[IO_MAXCHAN]; pwr_tBoolean OldTestOn[IO_MAXCHAN];
int WriteFirst; int WriteFirst;
pwr_tTime ErrTime;
} io_sLocal; } io_sLocal;
static pwr_tStatus AoRangeToCoef( static pwr_tStatus AoRangeToCoef(
...@@ -193,6 +194,7 @@ static pwr_tStatus IoCardWrite ( ...@@ -193,6 +194,7 @@ static pwr_tStatus IoCardWrite (
pwr_tFloat32 rawvalue; pwr_tFloat32 rawvalue;
qbus_io_write wb; qbus_io_write wb;
int sts; int sts;
pwr_tTime now;
local = (io_sLocal *) cp->Local; local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ao_HVAO4 *) cp->op; op = (pwr_sClass_Ao_HVAO4 *) cp->op;
...@@ -267,7 +269,16 @@ static pwr_tStatus IoCardWrite ( ...@@ -267,7 +269,16 @@ static pwr_tStatus IoCardWrite (
} }
#endif #endif
/* Increase error count and check error limits */ /* Increase error count and check error limits */
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++; op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit) if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name); errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/* /*
* Proview $Id: rt_io_m_co_pi24bo.c,v 1.5 2006-09-05 12:03:01 claes Exp $ * Proview $Id: rt_io_m_co_pi24bo.c,v 1.6 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -62,6 +62,7 @@ typedef struct { ...@@ -62,6 +62,7 @@ typedef struct {
unsigned int bfb_item; unsigned int bfb_item;
pwr_tInt32 OldValue[IO_MAXCHAN]; pwr_tInt32 OldValue[IO_MAXCHAN];
int FirstScan[IO_MAXCHAN]; int FirstScan[IO_MAXCHAN];
pwr_tTime ErrTime;
} io_sLocal; } io_sLocal;
static pwr_tStatus IoCardInit ( static pwr_tStatus IoCardInit (
...@@ -203,6 +204,7 @@ static pwr_tStatus IoCardRead ( ...@@ -203,6 +204,7 @@ static pwr_tStatus IoCardRead (
qbus_io_read rb; qbus_io_read rb;
qbus_io_write wb; qbus_io_write wb;
io_sRackLocal *r_local = (io_sRackLocal *)(rp->Local); io_sRackLocal *r_local = (io_sRackLocal *)(rp->Local);
pwr_tTime now;
local = (io_sLocal *) cp->Local; local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Co_PI24BO *) cp->op; op = (pwr_sClass_Co_PI24BO *) cp->op;
...@@ -305,7 +307,16 @@ static pwr_tStatus IoCardRead ( ...@@ -305,7 +307,16 @@ static pwr_tStatus IoCardRead (
if ( sts1 == -1 || sts2 == -1) if ( sts1 == -1 || sts2 == -1)
{ {
/* Increase error count and check error limits */ /* Increase error count and check error limits */
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++; op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit) if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name); errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/* /*
* Proview $Id: rt_io_m_di_dix2.c,v 1.5 2006-09-05 12:03:01 claes Exp $ * Proview $Id: rt_io_m_di_dix2.c,v 1.6 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -59,6 +59,7 @@ typedef struct { ...@@ -59,6 +59,7 @@ typedef struct {
void *Data[16]; void *Data[16];
pwr_tBoolean Found; pwr_tBoolean Found;
} Filter[2]; } Filter[2];
pwr_tTime ErrTime;
} io_sLocal; } io_sLocal;
static pwr_tStatus IoCardInit ( static pwr_tStatus IoCardInit (
...@@ -147,6 +148,7 @@ static pwr_tStatus IoCardRead ( ...@@ -147,6 +148,7 @@ static pwr_tStatus IoCardRead (
int sts; int sts;
qbus_io_read rb; qbus_io_read rb;
int bfb_error = 0; int bfb_error = 0;
pwr_tTime now;
op = (pwr_sClass_Di_DIX2 *) cp->op; op = (pwr_sClass_Di_DIX2 *) cp->op;
...@@ -210,7 +212,16 @@ static pwr_tStatus IoCardRead ( ...@@ -210,7 +212,16 @@ static pwr_tStatus IoCardRead (
if ( sts <= 0) if ( sts <= 0)
{ {
/* Increase error count and check error limits */ /* Increase error count and check error limits */
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++; op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit) if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name); errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/* /*
* Proview $Id: rt_io_m_do_hvdo32.c,v 1.5 2006-09-05 12:03:01 claes Exp $ * Proview $Id: rt_io_m_do_hvdo32.c,v 1.6 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -57,6 +57,7 @@ typedef struct { ...@@ -57,6 +57,7 @@ typedef struct {
void *Data[16]; void *Data[16];
pwr_tBoolean Found; pwr_tBoolean Found;
} Filter[2]; } Filter[2];
pwr_tTime ErrTime;
} io_sLocal; } io_sLocal;
static pwr_tStatus IoCardInit ( static pwr_tStatus IoCardInit (
...@@ -146,6 +147,7 @@ static pwr_tStatus IoCardWrite ( ...@@ -146,6 +147,7 @@ static pwr_tStatus IoCardWrite (
int i; int i;
qbus_io_write wb; qbus_io_write wb;
int sts; int sts;
pwr_tTime now;
op = (pwr_sClass_Do_HVDO32 *) cp->op; op = (pwr_sClass_Do_HVDO32 *) cp->op;
...@@ -220,7 +222,16 @@ static pwr_tStatus IoCardWrite ( ...@@ -220,7 +222,16 @@ static pwr_tStatus IoCardWrite (
} }
#endif #endif
/* Increase error count and check error limits */ /* Increase error count and check error limits */
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++; op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit) if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name); errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/* /*
* Proview $Id: rt_io_m_ssab_aiup.c,v 1.3 2006-09-05 12:03:01 claes Exp $ * Proview $Id: rt_io_m_ssab_aiup.c,v 1.4 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -55,6 +55,7 @@ typedef struct { ...@@ -55,6 +55,7 @@ typedef struct {
unsigned int Address; unsigned int Address;
int Qbus_fp; int Qbus_fp;
int ScanCount[IO_MAXCHAN]; int ScanCount[IO_MAXCHAN];
pwr_tTime ErrTime;
} io_sLocal; } io_sLocal;
static pwr_tStatus AiRangeToCoef( static pwr_tStatus AiRangeToCoef(
...@@ -178,6 +179,7 @@ static pwr_tStatus IoCardRead ( ...@@ -178,6 +179,7 @@ static pwr_tStatus IoCardRead (
int sts; int sts;
qbus_io_read rb; qbus_io_read rb;
int bfb_error = 0; int bfb_error = 0;
pwr_tTime now;
local = (io_sLocal *) cp->Local; local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ssab_BaseACard *) cp->op; op = (pwr_sClass_Ssab_BaseACard *) cp->op;
...@@ -260,7 +262,16 @@ static pwr_tStatus IoCardRead ( ...@@ -260,7 +262,16 @@ static pwr_tStatus IoCardRead (
} }
#endif #endif
/* Increase error count and check error limits */ /* Increase error count and check error limits */
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++; op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit) if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name); errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/* /*
* Proview $Id: rt_io_m_ssab_aoup.c,v 1.4 2006-09-05 12:03:01 claes Exp $ * Proview $Id: rt_io_m_ssab_aoup.c,v 1.5 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -58,6 +58,7 @@ typedef struct { ...@@ -58,6 +58,7 @@ typedef struct {
pwr_tFloat32 OldValue[IO_MAXCHAN]; pwr_tFloat32 OldValue[IO_MAXCHAN];
pwr_tBoolean OldTestOn[IO_MAXCHAN]; pwr_tBoolean OldTestOn[IO_MAXCHAN];
int WriteFirst; int WriteFirst;
pwr_tTime ErrTime;
} io_sLocal; } io_sLocal;
static pwr_tStatus AoRangeToCoef( static pwr_tStatus AoRangeToCoef(
...@@ -194,6 +195,7 @@ static pwr_tStatus IoCardWrite ( ...@@ -194,6 +195,7 @@ static pwr_tStatus IoCardWrite (
pwr_tFloat32 rawvalue; pwr_tFloat32 rawvalue;
qbus_io_write wb; qbus_io_write wb;
int sts; int sts;
pwr_tTime now;
local = (io_sLocal *) cp->Local; local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ssab_BaseACard *) cp->op; op = (pwr_sClass_Ssab_BaseACard *) cp->op;
...@@ -268,7 +270,16 @@ static pwr_tStatus IoCardWrite ( ...@@ -268,7 +270,16 @@ static pwr_tStatus IoCardWrite (
} }
#endif #endif
/* Increase error count and check error limits */ /* Increase error count and check error limits */
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++; op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit) if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name); errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/* /*
* Proview $Id: rt_io_m_ssab_co.c,v 1.3 2006-09-05 12:03:01 claes Exp $ * Proview $Id: rt_io_m_ssab_co.c,v 1.4 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -59,6 +59,7 @@ typedef struct { ...@@ -59,6 +59,7 @@ typedef struct {
int Qbus_fp; int Qbus_fp;
pwr_tInt32 OldValue[IO_MAXCHAN]; pwr_tInt32 OldValue[IO_MAXCHAN];
int FirstScan[IO_MAXCHAN]; int FirstScan[IO_MAXCHAN];
pwr_tTime ErrTime;
} io_sLocal; } io_sLocal;
static pwr_tStatus IoCardInit ( static pwr_tStatus IoCardInit (
...@@ -200,6 +201,7 @@ static pwr_tStatus IoCardRead ( ...@@ -200,6 +201,7 @@ static pwr_tStatus IoCardRead (
qbus_io_read rb; qbus_io_read rb;
qbus_io_write wb; qbus_io_write wb;
io_sRackLocal *r_local = (io_sRackLocal *)(rp->Local); io_sRackLocal *r_local = (io_sRackLocal *)(rp->Local);
pwr_tTime now;
local = (io_sLocal *) cp->Local; local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ssab_CO4uP *) cp->op; op = (pwr_sClass_Ssab_CO4uP *) cp->op;
...@@ -313,7 +315,16 @@ static pwr_tStatus IoCardRead ( ...@@ -313,7 +315,16 @@ static pwr_tStatus IoCardRead (
#endif #endif
/* Increase error count and check error limits */ /* Increase error count and check error limits */
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++; op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit) if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name); errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/* /*
* Proview $Id: rt_io_m_ssab_di.c,v 1.4 2006-09-05 12:03:01 claes Exp $ * Proview $Id: rt_io_m_ssab_di.c,v 1.5 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -57,6 +57,7 @@ typedef struct { ...@@ -57,6 +57,7 @@ typedef struct {
void *Data[16]; void *Data[16];
pwr_tBoolean Found; pwr_tBoolean Found;
} Filter[2]; } Filter[2];
pwr_tTime ErrTime;
} io_sLocal; } io_sLocal;
static pwr_tStatus IoCardInit ( static pwr_tStatus IoCardInit (
...@@ -144,6 +145,7 @@ static pwr_tStatus IoCardRead ( ...@@ -144,6 +145,7 @@ static pwr_tStatus IoCardRead (
int sts; int sts;
qbus_io_read rb; qbus_io_read rb;
int bfb_error = 0; int bfb_error = 0;
pwr_tTime now;
local = (io_sLocal *) cp->Local; local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ssab_BaseDiCard *) cp->op; op = (pwr_sClass_Ssab_BaseDiCard *) cp->op;
...@@ -209,7 +211,16 @@ static pwr_tStatus IoCardRead ( ...@@ -209,7 +211,16 @@ static pwr_tStatus IoCardRead (
/* Error handling for local Qbus-I/O */ /* Error handling for local Qbus-I/O */
{ {
/* Increase error count and check error limits */ /* Increase error count and check error limits */
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++;
}
else
op->ErrorCount++; op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit) if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name); errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
/* /*
* Proview $Id: rt_io_m_ssab_do.c,v 1.3 2006-07-03 06:20:03 claes Exp $ * Proview $Id: rt_io_m_ssab_do.c,v 1.4 2007-04-30 12:08:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -58,6 +58,7 @@ typedef struct { ...@@ -58,6 +58,7 @@ typedef struct {
void *Data[16]; void *Data[16];
pwr_tBoolean Found; pwr_tBoolean Found;
} Filter[2]; } Filter[2];
pwr_tTime ErrTime;
} io_sLocal; } io_sLocal;
static pwr_tStatus IoCardInit ( static pwr_tStatus IoCardInit (
...@@ -146,6 +147,7 @@ static pwr_tStatus IoCardWrite ( ...@@ -146,6 +147,7 @@ static pwr_tStatus IoCardWrite (
int i; int i;
qbus_io_write wb; qbus_io_write wb;
int sts; int sts;
pwr_tTime now;
local = (io_sLocal *) cp->Local; local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ssab_BaseDoCard *) cp->op; op = (pwr_sClass_Ssab_BaseDoCard *) cp->op;
...@@ -222,7 +224,17 @@ static pwr_tStatus IoCardWrite ( ...@@ -222,7 +224,17 @@ static pwr_tStatus IoCardWrite (
} }
#endif #endif
/* Increase error count and check error limits */ /* Increase error count and check error limits */
clock_gettime(CLOCK_REALTIME, &now);
if (op->ErrorCount > op->ErrorSoftLimit) {
/* Ignore if some time has expired */
if (now.tv_sec - local->ErrTime.tv_sec < 600)
op->ErrorCount++; op->ErrorCount++;
}
else
op->ErrorCount++;
local->ErrTime = now;
if ( op->ErrorCount == op->ErrorSoftLimit) if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name); errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment