> Date: Tue, 12 Apr 2016 13:12:42 +0000
> From: Visa Hankala <[email protected]>
>
> On Fri, Apr 08, 2016 at 12:16:03PM +0000, Visa Hankala wrote:
> > Every now and then I see "spurious interrupt 34" messages on octeon
> > serial console. The root cause seems to be in comstart() which enables
> > the TX holding register empty interrupt before writing data to the TX
> > register. If the register is empty initially, the early enabling can
> > trigger a premature interrupt.
> >
> > The message does not appear when the enabling is done after the data
> > writing. The change has not caused ill effects on amd64, i386 and sgi
> > machines that I used for testing. OK?
>
> Any objections to this patch? The timing issue is generic, not specific
> to octeon.
Was going to check the hardware description of these registers. The
worry I have is that enabling the interrupt after pushing out the
character will make us miss completions. But that is not an issue if
the interrupt is latched.
> > Index: dev/ic/com.c
> > ===================================================================
> > RCS file: src/sys/dev/ic/com.c,v
> > retrieving revision 1.158
> > diff -u -p -r1.158 com.c
> > --- dev/ic/com.c 14 Sep 2014 14:17:24 -0000 1.158
> > +++ dev/ic/com.c 8 Apr 2016 10:11:59 -0000
> > @@ -1013,12 +1013,6 @@ comstart(struct tty *tp)
> > bus_space_write_1(iot, ioh, com_isr, ISR_SEND);
> > #endif
> >
> > - /* Enable transmit completion interrupts. */
> > - if (!ISSET(sc->sc_ier, IER_ETXRDY)) {
> > - SET(sc->sc_ier, IER_ETXRDY);
> > - bus_space_write_1(iot, ioh, com_ier, sc->sc_ier);
> > - }
> > -
> > if (ISSET(sc->sc_hwflags, COM_HW_FIFO)) {
> > u_char buffer[128]; /* largest fifo */
> > int i, n;
> > @@ -1031,6 +1025,12 @@ comstart(struct tty *tp)
> > bzero(buffer, n);
> > } else if (tp->t_outq.c_cc != 0)
> > bus_space_write_1(iot, ioh, com_data, getc(&tp->t_outq));
> > +
> > + /* Enable transmit completion interrupts. */
> > + if (!ISSET(sc->sc_ier, IER_ETXRDY)) {
> > + SET(sc->sc_ier, IER_ETXRDY);
> > + bus_space_write_1(iot, ioh, com_ier, sc->sc_ier);
> > + }
> > out:
> > splx(s);
> > return;
> >
>
>