Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Apr 1998 11:28:22 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        dag-erli@ifi.uio.no, freebsd-bugs@hub.freebsd.org
Subject:   Re: kern/6099: LPIP to slow machine causes hang
Message-ID:  <199804120128.LAA30974@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
> > The problem with LPIP is that enabling an lpt port for LPIP does not
> > update net_imask.  This means that LPIP interrupts can break splimp()
> > critical regions - which includes all mbuf handling.
> > 
> > The following patches correct the problem in 2.2.5R.  The problem also
> > exists in older versions of 2.2, -stable and -current.  The same patches
> >
> > [patch deleted]
> 
> Here's a patch for 2.2.6-STABLE:

It's a waste of time to fix it better than (or different than) the
corresponding problem for SLIP.  Just change the evil SLIP ifdef in
isa.c.  ppp_tty.c has better fixes mainly because it needs them for
the LKM version.

> --- /sys/i386/isa/lpt.c.orig    Sat Apr 11 17:44:06 1998
> +++ /sys/i386/isa/lpt.c Sat Apr 11 17:44:13 1998
> @@ -224,6 +224,7 @@
>         u_char  sc_backoff ;    /* time to call lptout() again */
> 
>  #ifdef INET
> +        u_short                sc_irqmask;     /* hardware interrupt mask */
>         struct  ifnet   sc_if;
>         u_char          *sc_ifbuf;
>         int             sc_iferrs;

This white space lossage on every line (except the empty one :).

> @@ -932,6 +935,9 @@
>      case SIOCSIFADDR:
>         if (ifa->ifa_addr->sa_family != AF_INET)
>             return EAFNOSUPPORT;
> +       x = splhigh();
> +       net_imask |= sc->sc_irqmask;
> +       splx(x);
>         ifp->if_flags |= IFF_UP;
>         /* FALLTHROUGH */
>      case SIOCSIFFLAGS:
> 
> I haven't had time to test it thoroughly yet though.

It is inadequate.  It doesn't call update_intr_masks(), so unless
something else calls this function, intr_masks[] is out of date
and lpt interrupts are not always masked when network h/w interrupt
handlers run.  It doesn't set tty_imask to net_imask, so lptintr()
begins with the wrong set of interrupts masked (this is actually
harmless because lptintr() has internal, bogus spls) and there is
a risk that SLIP or PPP depends on spltty() masking network h/w
interrupts.  (All this only applies when neither SLIP nor PPP is
configured.)

Bruce

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804120128.LAA30974>