From owner-freebsd-bugs Wed May 20 00:04:43 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA01810 for freebsd-bugs-outgoing; Wed, 20 May 1998 00:04:43 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA01797 for ; Wed, 20 May 1998 00:04:37 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id AAA10489; Wed, 20 May 1998 00:00:04 -0700 (PDT) Date: Wed, 20 May 1998 00:00:04 -0700 (PDT) Message-Id: <199805200700.AAA10489@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: Poul-Henning Kamp Subject: Re: kern/6099: LPIP to slow machine causes hang Reply-To: Poul-Henning Kamp Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/6099; it has been noted by GNATS. From: Poul-Henning Kamp To: freebsd-gnats-submit@freebsd.org Cc: Subject: Re: kern/6099: LPIP to slow machine causes hang Date: Wed, 20 May 1998 08:57:30 +0200 In message <199804120128.LAA30974@godzilla.zeta.org.au>, Bruce Evans writes: >> > 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 > -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop." "ttyv0" -- What UNIX calls a $20K state-of-the-art, 3D, hi-res color terminal To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message