Date: Tue, 31 Mar 1998 13:10:02 -0800 (PST) From: Peter Jeremy <Peter.Jeremy@alcatel.com.au> To: freebsd-bugs Subject: Re: kern/6099: LPIP to slow machine causes hang Message-ID: <199803312110.NAA22216@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/6099; it has been noted by GNATS. From: Peter Jeremy <Peter.Jeremy@alcatel.com.au> To: freebsd-gnats-submit@freebsd.org Cc: dag-erli@ifi.uio.no, dmlb@ragnet.demon.co.uk, regnauld@deepo.prosa.dk Subject: Re: kern/6099: LPIP to slow machine causes hang Date: Wed, 01 Apr 1998 07:02:21 +1000 (EST) This problem appears to be identical to PRs kern/1271 and i386/5698. 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 will presumably correct similar bugs in those versions. --- /home3/jeremyp/fbsd.225/src/sys/i386/isa/lpt.c Tue Nov 12 20:08:38 1996 +++ /tmp/lpt.c Fri Mar 27 19:08:19 1998 @@ -214,9 +214,9 @@ #define LP_AUTOLF 0x40 /* tell printer to do an automatic lf */ #define LP_BYPASS 0x80 /* bypass printer ready checks */ struct buf *sc_inbuf; + char *sc_cp ; short sc_xfercnt ; char sc_primed; - char *sc_cp ; u_char sc_irq ; /* IRQ status of port */ #define LP_HAS_IRQ 0x01 /* we have an irq available */ #define LP_USE_IRQ 0x02 /* we are using our irq */ @@ -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; @@ -445,6 +446,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 { @@ -933,7 +935,7 @@ struct ifaddr *ifa = (struct ifaddr *)data; struct ifreq *ifr = (struct ifreq *)data; u_char *ptr; - + int x; switch (cmd) { case SIOCSIFDSTADDR: @@ -941,6 +943,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: -- Peter Jeremy (VK2PJ) peter.jeremy@alcatel.com.au Alcatel Australia Limited 41 Mandible St Phone: +61 2 9690 5019 ALEXANDRIA NSW 2015 Fax: +61 2 9690 5247 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?199803312110.NAA22216>