Date: Thu, 16 Jul 2009 22:22:10 +0200 From: Hans Petter Selasky <hselasky@c2i.net> To: Patrick Lamaiziere <patfbsd@davenulle.org> Cc: freebsd-current@freebsd.org Subject: Re: ulpt problem (USB_ERR_IOERROR) Message-ID: <200907162222.11736.hselasky@c2i.net> In-Reply-To: <20090716215528.271fc177@baby-jane.lamaiziere.net> References: <20090703172600.1971111e@baby-jane.lamaiziere.net> <200907130846.51980.hselasky@c2i.net> <20090716215528.271fc177@baby-jane.lamaiziere.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi, On Thursday 16 July 2009 21:55:28 Patrick Lamaiziere wrote: > Le Mon, 13 Jul 2009 08:46:50 +0200, > > Hans Petter Selasky <hselasky@c2i.net> a =E9crit : > > The printing works besides from the status failing? > > Yes. > > > Do you mean here? : Yes. > [ULPT_INTR_DT_RD] =3D { .type =3D UE_CONTROL, > ... > .timeout =3D 20000, /* 20 second */ > > If yes, I tried but this does not change anything. I also tried to > change the ticks of the callout_reset in usb_watchdog(). > > But If I remove the transfer start in usb_watchdog() (so I never read > the status of the printer), it works well. Could you try to add an "if (sc->sc_fflags =3D=3D 0)" in front, like this: /*=20 * Only read status while the device is not opened, due to * possible hardware or firmware bug in some printers. */ if (sc->sc_fflags =3D=3D 0) usbd_transfer_start(sc->sc_xfer[ULPT_INTR_DT_RD]); > With cups and without the deframentation of the datas to write it seems > to work too (the same configuration as the top of this thread). Are you > sure this it required by my printer? No. I've removed that patch. > Not related but I noticed that usb_write() in usb_dev.c returns -1 if I > hit Ctrl-C when doing a "cat file > /dev/unlpt0". Because > usb_fifo_wait(f) returns -1 (should be EINTR?). If cv_wait_sig() returns -1, then they do not behave like in the manual pag= e: man cv_wait_sig You have to do a "kill" to kill it. What I've seen is the code hangs in the= =20 flushing loop in the close call: /* check if flushed already */ while (f->flag_flushing && (!f->flag_iserror)) { /* wait until all data has been written */ f->flag_sleeping =3D 1; err =3D cv_wait_sig(&f->cv_io, f->priv_mtx); if (err) { DPRINTF("signal received\n"); break; } } I have no idea why. Seems like the signals are blocked, so that CTRL+C is n= ot=20 passed another time! Please investigate, if you have some time. New patch: 1) cvsup to 8-current. 2) Replace serial/ulpt.c with the one from USB P4 http://perforce.freebsd.org/chv.cgi?CH=3D166176 =2D-HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907162222.11736.hselasky>