aboutsummaryrefslogtreecommitdiff
path: root/sys/pci/xrpu.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1999-07-03 08:23:00 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1999-07-03 08:23:00 +0000
commite366aade76c318d6d9d87418a2cb8d55ffaf95e1 (patch)
tree794eaa0f893d7a1dac10086320d89c3e48ababc7 /sys/pci/xrpu.c
parentc31558b2154a3c65fcfd89d7a08501dcd914f305 (diff)
downloadsrc-e366aade76c318d6d9d87418a2cb8d55ffaf95e1.tar.gz
src-e366aade76c318d6d9d87418a2cb8d55ffaf95e1.zip
Bail after 5 attempts to read very noisy signals.
Notes
Notes: svn path=/head/; revision=48511
Diffstat (limited to 'sys/pci/xrpu.c')
-rw-r--r--sys/pci/xrpu.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/pci/xrpu.c b/sys/pci/xrpu.c
index 08b8d3ddf29e..8bc3bca0732a 100644
--- a/sys/pci/xrpu.c
+++ b/sys/pci/xrpu.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: xrpu.c,v 1.12 1999/05/31 11:29:04 phk Exp $
+ * $Id: xrpu.c,v 1.13 1999/06/22 10:31:30 phk Exp $
*
* A very simple device driver for PCI cards based on Xilinx 6200 series
* FPGA/RPU devices. Current Functionality is to allow you to open and
@@ -100,24 +100,26 @@ void
xrpu_poll_pps(struct timecounter *tc)
{
struct softc *sc = tc->tc_priv;
- int i;
+ int i, j;
unsigned count1, ppscount;
for (i = 0; i < XRPU_MAX_PPS; i++) {
if (sc->assert[i]) {
ppscount = *(sc->assert[i]) & tc->tc_counter_mask;
+ j = 0;
do {
count1 = ppscount;
ppscount = *(sc->assert[i]) & tc->tc_counter_mask;
- } while (ppscount != count1);
+ } while (ppscount != count1 && ++j < 5);
pps_event(&sc->pps[i], tc, ppscount, PPS_CAPTUREASSERT);
}
if (sc->clear[i]) {
+ j = 0;
ppscount = *(sc->clear[i]) & tc->tc_counter_mask;
do {
count1 = ppscount;
ppscount = *(sc->clear[i]) & tc->tc_counter_mask;
- } while (ppscount != count1);
+ } while (ppscount != count1 && ++j < 5);
pps_event(&sc->pps[i], tc, ppscount, PPS_CAPTURECLEAR);
}
}