Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sgimips/dev split crime_bus_reset() into crime_{cpu...
details: https://anonhg.NetBSD.org/src/rev/9cfc1ffa047e
branches: trunk
changeset: 329273:9cfc1ffa047e
user: mrg <mrg%NetBSD.org@localhost>
date: Sat May 17 20:44:08 2014 +0000
description:
split crime_bus_reset() into crime_{cpu,mem}_reset() and only reset
the cpu or the memory upon either error, not both.
seems to make my O2 slightly less likely to hang, and matches what
the linux crime driver does.
diffstat:
sys/arch/sgimips/dev/crime.c | 41 +++++++++++++++++++++++++++++------------
1 files changed, 29 insertions(+), 12 deletions(-)
diffs (91 lines):
diff -r 6e354aca7df7 -r 9cfc1ffa047e sys/arch/sgimips/dev/crime.c
--- a/sys/arch/sgimips/dev/crime.c Sat May 17 20:34:49 2014 +0000
+++ b/sys/arch/sgimips/dev/crime.c Sat May 17 20:44:08 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crime.c,v 1.36 2011/08/18 02:56:21 macallan Exp $ */
+/* $NetBSD: crime.c,v 1.37 2014/05/17 20:44:08 mrg Exp $ */
/*
* Copyright (c) 2004 Christopher SEKIYA
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: crime.c,v 1.36 2011/08/18 02:56:21 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crime.c,v 1.37 2014/05/17 20:44:08 mrg Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -63,7 +63,9 @@
static int crime_match(device_t, struct cfdata *, void *);
static void crime_attach(device_t, device_t, void *);
-void crime_bus_reset(void);
+static void crime_mem_reset(void);
+static void crime_cpu_reset(void);
+static void crime_bus_reset(void);
void crime_watchdog_reset(void);
void crime_watchdog_disable(void);
void crime_intr(vaddr_t, uint32_t, uint32_t);
@@ -142,7 +144,8 @@
aprint_normal(" (CRIME_ID: %" PRIu64 ")\n", crm_id);
/* reset CRIME CPU & memory error registers */
- crime_bus_reset();
+ crime_mem_reset();
+ crime_cpu_reset();
crime_watchdog_disable();
@@ -237,17 +240,17 @@
CRIME_MEM_ERROR_STAT);
printf("crime: memory error address %" PRIu64
" status %" PRIu64 "\n", address << 2, stat);
- crime_bus_reset();
+ crime_mem_reset();
}
if (crime_ipending & CRIME_INT_CRMERR) {
stat = bus_space_read_8(crm_iot, crm_ioh,
CRIME_CPU_ERROR_STAT);
- printf("crime: cpu error %" PRIu64 " at"
- " address %" PRIu64 "\n", stat,
- bus_space_read_8(crm_iot, crm_ioh,
- CRIME_CPU_ERROR_ADDR));
- crime_bus_reset();
+ address = bus_space_read_8(crm_iot, crm_ioh,
+ CRIME_CPU_ERROR_ADDR) << 2;
+ printf("crime: cpu error %" PRIu64 " at address %"
+ PRIu64 "\n", stat, address);
+ crime_cpu_reset();
}
}
@@ -283,11 +286,25 @@
}
void
+crime_mem_reset(void)
+{
+
+ bus_space_write_8(crm_iot, crm_ioh, CRIME_MEM_ERROR_STAT, 0);
+}
+
+void
+crime_cpu_reset(void)
+{
+
+ bus_space_write_8(crm_iot, crm_ioh, CRIME_CPU_ERROR_STAT, 0);
+}
+
+void
crime_bus_reset(void)
{
- bus_space_write_8(crm_iot, crm_ioh, CRIME_CPU_ERROR_STAT, 0);
- bus_space_write_8(crm_iot, crm_ioh, CRIME_MEM_ERROR_STAT, 0);
+ crime_mem_reset();
+ crime_cpu_reset();
}
void
Home |
Main Index |
Thread Index |
Old Index