From owner-freebsd-bugs Sat Apr 11 18:30:17 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA19007 for freebsd-bugs-outgoing; Sat, 11 Apr 1998 18:30:17 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA18982 for ; Sat, 11 Apr 1998 18:30:14 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id LAA30974; Sun, 12 Apr 1998 11:28:22 +1000 Date: Sun, 12 Apr 1998 11:28:22 +1000 From: Bruce Evans Message-Id: <199804120128.LAA30974@godzilla.zeta.org.au> To: dag-erli@ifi.uio.no, freebsd-bugs@hub.freebsd.org Subject: Re: kern/6099: LPIP to slow machine causes hang Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > > 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