Date: Sat, 11 Apr 1998 08:50:02 -0700 (PDT) From: dag-erli@ifi.uio.no (Dag-Erling Coidan =?iso-8859-1?Q?Sm=F8rgrav?= ) To: freebsd-bugs Subject: Re: kern/6099: LPIP to slow machine causes hang Message-ID: <199804111550.IAA18671@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: dag-erli@ifi.uio.no (Dag-Erling Coidan =?iso-8859-1?Q?Sm=F8rgrav?= )
To: Peter Jeremy <Peter.Jeremy@alcatel.com.au>
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 <Peter.Jeremy@alcatel.com.au> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804111550.IAA18671>
