NetBSD Problem Report #24665
Received: (qmail 10922 invoked by uid 605); 4 Mar 2004 02:21:27 -0000
Message-Id: <200403040221.i242LIT15798@bondage.mcmahill.net>
Date: Wed, 3 Mar 2004 21:21:18 -0500 (EST)
From: dmcmahill@netbsd.org
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: dmcmahill@netbsd.org
To: gnats-bugs@gnats.NetBSD.org
Subject: power cycling printer wedges machine
X-Send-Pr-Version: 3.95
>Number: 24665
>Category: kern
>Synopsis: power cycling printer wedges machine
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Mar 04 02:22:00 +0000 2004
>Closed-Date:
>Last-Modified: Sun Sep 03 01:15:48 +0000 2006
>Originator:
>Release: NetBSD 1.6ZI
>Organization:
>Environment:
System: NetBSD buttercream 1.6ZI NetBSD 1.6ZI (GENERIC) #0: Thu Feb 5 18:09:52 UTC 2004 cyber@tgm.netbsd.org:/autobuild/HEAD/i386/OBJ/autobuild/HEAD/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
The various bits of dmesg output related to the printer are:
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
ohci0 at pci0 dev 1 function 2: Silicon Integrated System 5597/5598 USB host controller (rev. 0x07)
ohci0: interrupting at irq 9
ohci0: OHCI version 1.0, legacy support
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uhub0: Silicon Integra OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 3 ports with 3 removable, self powered
ulpt0 at uhub0 port 1 configuration 1 interface 0
ulpt0: Compaq Corporation Compaq A1500, rev 1.10/1.00, addr 2, iclass 7/1
ulpt0: using bi-directional mode
If I unplug the USB cable to the printer I see ulpt0 detach in the
console messages. If I plut the USB cable back into the printer,
I see the ulpt0 attach message. If I unplug the printer power
cord I see the ulpt0 detach message and if I plug the printer power
cord back in, the machine wedges hard. It will not respond to
the keyboard or pings over the network.
>How-To-Repeat:
power cycle printer, note that machine is wedged hard.
>Fix:
no idea
>Release-Note:
>Audit-Trail:
From: Dan McMahill <mcmahill@alum.mit.edu>
To: gnats-bugs@gnats.NetBSD.org
Cc: dmcmahill@netbsd.org
Subject: Re: port-i386/24665: power cycling printer wedges machine
Date: Fri, 5 Mar 2004 10:18:17 -0500
> >How-To-Repeat:
>
> power cycle printer, note that machine is wedged hard.
>
it was pointed out to me that if the machine was running X, that the
system might be sitting at ddb. So I tried without X as the current
virtual terminal and indeed, the kernel had paniced.
Kernel: pagetrap fault, code=0panic: ohci_add_done: addr 0x01d40710 not found
Stopped at netbsd:cpu_Debugger+0x4:
eave
db> bt
cpu_Debugger(0,8,c0572697,1d40710,0) at netbsd:cpu_Debugger+0x4
panic(c06f3a40,1d40710,0,c128d500,0) at netbsd:panic+0x11d
ohci_softintr(c11ba000,1d40710,c084fa28,0,108e8) at netbsd:ohci_softintr
ohci_intrl(c11ba000,5,c0840010,30,10) at netbsd: ohci_intr+0x1ce
Xintr_legacy9() at netbsd:Xinter_legacy9+0xa8
--- interrupt ---
0x5f313733:
db>
From: Dan McMahill <dmcmahill@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: port-i386/24665
Date: Sat, 13 Mar 2004 21:50:49 -0500
I tried again with kernel sources from today (2004-03-13), same result.
I set up a serial console and set ohcidebug=25 and captured the result.
It is in ftp://ftp.netbsd.org/pub/NetBSD/misc/dmcmahill/ohcidebug_25.log
The interesting thing is that with ohcidebug=25 set, I do not get a
panic when power cycling the printer while if I don't set ohcidebug=25
I do get a panic. Same kernel in both cases.
-Dan
--
Responsible-Changed-From-To: port-i386-maintainer->kern-bug-people
Responsible-Changed-By: dmcmahill
Responsible-Changed-When: Sun Mar 14 13:46:02 UTC 2004
Responsible-Changed-Why:
pr should have been filed as a kernel bug not port-i386 specific
Responsible-Changed-From-To: kern-bug-people->mycroft
Responsible-Changed-By: mycroft
Responsible-Changed-When: Wed Jun 30 11:30:42 UTC 2004
Responsible-Changed-Why:
.
From: "Charles M. Hannum" <abuse@spamalicious.com>
To: dmcmahill@netbsd.org
Cc: gnats-bugs@netbsd.org
Subject: Re: kern/24665: power cycling printer wedges machine
Date: Thu, 1 Jul 2004 01:23:36 +0000
--Boundary-00=_Ye24AsTxyK1CAYT
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Please try the attached patch and let me know how it goes.
--Boundary-00=_Ye24AsTxyK1CAYT
Content-Type: text/x-diff;
charset="us-ascii";
name="ohci3.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="ohci3.diff"
Index: ohci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ohci.c,v
retrieving revision 1.149
diff -u -r1.149 ohci.c
--- ohci.c 29 Jun 2004 03:56:04 -0000 1.149
+++ ohci.c 1 Jul 2004 01:14:26 -0000
@@ -142,7 +142,6 @@
Static void ohci_poll(struct usbd_bus *);
Static void ohci_softintr(void *);
Static void ohci_waitintr(ohci_softc_t *, usbd_xfer_handle);
-Static void ohci_add_done(ohci_softc_t *, ohci_physaddr_t);
Static void ohci_rhsc(ohci_softc_t *, usbd_xfer_handle);
Static usbd_status ohci_device_request(usbd_xfer_handle xfer);
@@ -1102,7 +1101,9 @@
ohci_intr1(ohci_softc_t *sc)
{
u_int32_t intrs, eintrs;
+#if 0
ohci_physaddr_t done;
+#endif
DPRINTFN(14,("ohci_intr1: enter\n"));
@@ -1114,6 +1115,7 @@
return (0);
}
+#if 0
intrs = 0;
done = le32toh(sc->sc_hcca->hcca_done_head);
if (done != 0) {
@@ -1121,15 +1123,16 @@
intrs = OHCI_WDH;
if (done & OHCI_DONE_INTRS)
intrs |= OREAD4(sc, OHCI_INTERRUPT_STATUS);
- sc->sc_hcca->hcca_done_head = 0;
} else
intrs = OREAD4(sc, OHCI_INTERRUPT_STATUS) & ~OHCI_WDH;
+#else
+ intrs = OREAD4(sc, OHCI_INTERRUPT_STATUS);
+#endif
if (!intrs)
return (0);
- intrs &= ~OHCI_MIE;
- OWRITE4(sc, OHCI_INTERRUPT_STATUS, intrs); /* Acknowledge */
+ OWRITE4(sc, OHCI_INTERRUPT_STATUS, intrs & ~(OHCI_MIE|OHCI_WDH)); /* Acknowledge */
eintrs = intrs & sc->sc_eintrs;
if (!eintrs)
return (0);
@@ -1151,8 +1154,8 @@
eintrs &= ~OHCI_SO;
}
if (eintrs & OHCI_WDH) {
- ohci_add_done(sc, done &~ OHCI_DONE_INTRS);
usb_schedsoftintr(&sc->sc_bus);
+ OWRITE4(sc, OHCI_INTERRUPT_DISABLE, OHCI_WDH);
eintrs &= ~OHCI_WDH;
}
if (eintrs & OHCI_RD) {
@@ -1236,10 +1239,27 @@
#endif
void
-ohci_add_done(ohci_softc_t *sc, ohci_physaddr_t done)
+ohci_softintr(void *v)
{
- ohci_soft_itd_t *sitd, *sidone, **ip;
- ohci_soft_td_t *std, *sdone, **p;
+ ohci_softc_t *sc = v;
+ ohci_soft_itd_t *sitd, *sidone, *sitdnext;
+ ohci_soft_td_t *std, *sdone, *stdnext;
+ usbd_xfer_handle xfer;
+ struct ohci_pipe *opipe;
+ int len, cc, s;
+ int i, j, actlen, iframes, uedir;
+ ohci_physaddr_t done;
+
+ DPRINTFN(10,("ohci_softintr: enter\n"));
+
+ sc->sc_bus.intr_context++;
+
+ s = splhardusb();
+ done = le32toh(sc->sc_hcca->hcca_done_head);
+ sc->sc_hcca->hcca_done_head = htole32(done & OHCI_DONE_INTRS);
+ OWRITE4(sc, OHCI_INTERRUPT_STATUS, OHCI_WDH);
+ OWRITE4(sc, OHCI_INTERRUPT_ENABLE, OHCI_WDH);
+ splx(s);
/* Reverse the done list. */
for (sdone = NULL, sidone = NULL; done != 0; ) {
@@ -1259,41 +1279,9 @@
DPRINTFN(5,("add ITD %p\n", sitd));
continue;
}
- panic("ohci_add_done: addr 0x%08lx not found", (u_long)done);
+ panic("ohci_softintr: addr 0x%08lx not found", (u_long)done);
}
- /* sdone & sidone now hold the done lists. */
- /* Put them on the already processed lists. */
- for (p = &sc->sc_sdone; *p != NULL; p = &(*p)->dnext)
- ;
- *p = sdone;
- for (ip = &sc->sc_sidone; *ip != NULL; ip = &(*ip)->dnext)
- ;
- *ip = sidone;
-}
-
-void
-ohci_softintr(void *v)
-{
- ohci_softc_t *sc = v;
- ohci_soft_itd_t *sitd, *sidone, *sitdnext;
- ohci_soft_td_t *std, *sdone, *stdnext;
- usbd_xfer_handle xfer;
- struct ohci_pipe *opipe;
- int len, cc, s;
- int i, j, actlen, iframes, uedir;
-
- DPRINTFN(10,("ohci_softintr: enter\n"));
-
- sc->sc_bus.intr_context++;
-
- s = splhardusb();
- sdone = sc->sc_sdone;
- sc->sc_sdone = NULL;
- sidone = sc->sc_sidone;
- sc->sc_sidone = NULL;
- splx(s);
-
DPRINTFN(10,("ohci_softintr: sdone=%p sidone=%p\n", sdone, sidone));
#ifdef OHCI_DEBUG
@@ -2239,7 +2227,7 @@
}
/* Zap headp register if hardware pointed inside the xfer. */
if (hit) {
- DPRINTFN(1,("ohci_abort_xfer: set hd=0x08%x, tl=0x%08x\n",
+ DPRINTFN(1,("ohci_abort_xfer: set hd=0x%08x, tl=0x%08x\n",
(int)p->physaddr, (int)le32toh(sed->ed.ed_tailp)));
sed->ed.ed_headp = htole32(p->physaddr); /* unlink TDs */
} else {
--Boundary-00=_Ye24AsTxyK1CAYT--
Responsible-Changed-From-To: mycroft->kern-bug-people
Responsible-Changed-By: wiz@netbsd.org
Responsible-Changed-When: Sun, 03 Sep 2006 01:15:48 +0000
Responsible-Changed-Why:
Back to role account, mycroft doesn't have commit access any longer.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.