From 6f8d9e0a09f0cdc616315b01c007f3bbe0562922 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sat, 16 Dec 2006 20:07:14 +0000 Subject: Make hil(4) shared interrupts aware, by exiting early if the stat register does not indicate data being available; for some reason on hppa hil_intr() gets invoked when serial ports interrupt. --- sys/dev/hil/hil.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sys/dev') diff --git a/sys/dev/hil/hil.c b/sys/dev/hil/hil.c index 16edb15dd05..8888fe226e2 100644 --- a/sys/dev/hil/hil.c +++ b/sys/dev/hil/hil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hil.c,v 1.22 2006/11/05 14:39:32 miod Exp $ */ +/* $OpenBSD: hil.c,v 1.23 2006/12/16 20:07:13 miod Exp $ */ /* * Copyright (c) 2003, 2004, Miodrag Vallat. * All rights reserved. @@ -284,9 +284,18 @@ hil_intr(void *v) return (0); stat = bus_space_read_1(sc->sc_bst, sc->sc_bsh, HILP_STAT); + + /* + * This should never happen if the interrupt comes from the + * loop. + */ + if ((stat & HIL_DATA_RDY) == 0) + return (0); /* not for us */ + c = bus_space_read_1(sc->sc_bst, sc->sc_bsh, HILP_DATA); /* clears interrupt */ DELAY(1); + hil_process_int(sc, stat, c); if (sc->sc_status != HIL_STATUS_BUSY) -- cgit v1.2.3