Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Kernel crash with USB printer on sparc64



No idea about the garbage output, but try this for the crash (not even
compile tested, but you get the idea)

Martin
Index: ulpt.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ulpt.c,v
retrieving revision 1.81
diff -u -p -r1.81 ulpt.c
--- ulpt.c      24 May 2008 16:40:58 -0000      1.81
+++ ulpt.c      6 Oct 2008 00:12:01 -0000
@@ -186,6 +186,7 @@ int ulpt_statusmsg(u_char, struct ulpt_s
 void ulpt_read_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
                  usbd_status status);
 void ulpt_tick(void *xsc);
+Static void ulpt_do_close(strcut ulpt_softc *sc);
 
 #if 0
 void ieee1284_print_id(char *);
@@ -386,10 +387,7 @@ USB_DETACH(ulpt)
        DPRINTFN(1, ("ulpt_detach: sc=%p\n", sc));
 
        sc->sc_dying = 1;
-       if (sc->sc_out_pipe != NULL)
-               usbd_abort_pipe(sc->sc_out_pipe);
-       if (sc->sc_in_pipe != NULL)
-               usbd_abort_pipe(sc->sc_in_pipe);
+       ulpt_do_close(sc);
 
        s = splusb();
        if (--sc->sc_refcnt >= 0) {
@@ -629,13 +627,9 @@ ulpt_statusmsg(u_char status, struct ulp
        return (status);
 }
 
-int
-ulptclose(dev_t dev, int flag, int mode,
-    struct lwp *l)
+Static void
+ulpt_do_close(strcut ulpt_softc *sc)
 {
-       struct ulpt_softc *sc;
-
-       USB_GET_SC(ulpt, ULPTUNIT(dev), sc);
 
        if (sc->sc_state != ULPT_OPEN)
                /* We are being forced to close before the open completed. */
@@ -668,6 +662,16 @@ ulptclose(dev_t dev, int flag, int mode,
        }
 
        sc->sc_state = 0;
+}
+
+int
+ulptclose(dev_t dev, int flag, int mode,
+    struct lwp *l)
+{
+       struct ulpt_softc *sc;
+
+       USB_GET_SC(ulpt, ULPTUNIT(dev), sc);
+       ulpt_do_close(sc);
 
        DPRINTFN(2, ("ulptclose: closed\n"));
        return (0);


Home | Main Index | Thread Index | Old Index