From f391e3c21cafdf6008377148fb58cf93405aeba0 Mon Sep 17 00:00:00 2001 From: Visa Hankala Date: Thu, 14 Apr 2016 13:49:28 +0000 Subject: Wrap comintr() so that the interrupt handler always returns non-zero. This prevents console clutter about spurious UART interrupts. --- sys/arch/octeon/dev/cn30xxuart.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'sys/arch/octeon') diff --git a/sys/arch/octeon/dev/cn30xxuart.c b/sys/arch/octeon/dev/cn30xxuart.c index bfe37114085..8eae942454b 100644 --- a/sys/arch/octeon/dev/cn30xxuart.c +++ b/sys/arch/octeon/dev/cn30xxuart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cn30xxuart.c,v 1.7 2015/02/05 23:29:33 uebayasi Exp $ */ +/* $OpenBSD: cn30xxuart.c,v 1.8 2016/04/14 13:49:27 visa Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -46,6 +46,7 @@ int cn30xxuart_probe(struct device *, void *, void *); void cn30xxuart_attach(struct device *, struct device *, void *); +int cn30xxuart_intr(void *); struct cfattach cn30xxuart_ca = { sizeof(struct com_softc), cn30xxuart_probe, cn30xxuart_attach @@ -129,10 +130,24 @@ cn30xxuart_attach(struct device *parent, struct device *self, void *aux) com_attach_subr(sc); - octeon_intr_establish(uba->uba_intr, IPL_TTY, comintr, + octeon_intr_establish(uba->uba_intr, IPL_TTY, cn30xxuart_intr, (void *)sc, sc->sc_dev.dv_xname); } +int +cn30xxuart_intr(void *arg) +{ + comintr(arg); + + /* + * Always return non-zero to prevent console clutter about spurious + * interrupts. comstart() enables the transmitter holding register + * empty interrupt before adding data to the FIFO, which can trigger + * a premature interrupt on the primary CPU in a multiprocessor system. + */ + return 1; +} + /* * Early console routines. */ -- cgit v1.2.3