From owner-freebsd-bugs Sat Apr 11 08:50:04 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA18687 for freebsd-bugs-outgoing; Sat, 11 Apr 1998 08:50:04 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA18671; Sat, 11 Apr 1998 08:50:02 -0700 (PDT) (envelope-from gnats) Date: Sat, 11 Apr 1998 08:50:02 -0700 (PDT) Message-Id: <199804111550.IAA18671@hub.freebsd.org> To: freebsd-bugs Cc: From: dag-erli@ifi.uio.no (Dag-Erling Coidan =?iso-8859-1?Q?Sm=F8rgrav?= ) Subject: Re: kern/6099: LPIP to slow machine causes hang Reply-To: dag-erli@ifi.uio.no (Dag-Erling Coidan =?iso-8859-1?Q?Sm=F8rgrav?= ) 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: dag-erli@ifi.uio.no (Dag-Erling Coidan =?iso-8859-1?Q?Sm=F8rgrav?= ) To: Peter Jeremy Cc: freebsd-gnats-submit@freebsd.org, dmlb@ragnet.demon.co.uk, regnauld@deepo.prosa.dk Subject: Re: kern/6099: LPIP to slow machine causes hang Date: 11 Apr 1998 17:48:08 +0200 Peter Jeremy 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: --- /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; @@ -436,6 +437,7 @@ sc->sc_irq = LP_HAS_IRQ | LP_USE_IRQ | LP_ENABLE_IRQ; printf("lpt%d: Interrupt-driven port\n", unit); #ifdef INET + sc->sc_irqmask = isdp->id_irq; lpattach(sc, unit); #endif } else { @@ -924,6 +926,7 @@ struct ifaddr *ifa = (struct ifaddr *)data; struct ifreq *ifr = (struct ifreq *)data; u_char *ptr; + int x; switch (cmd) { @@ -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. -- fprintf(stderr, "I have a closed mind. It helps keeping the rain out.\n"); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message