From owner-freebsd-current@FreeBSD.ORG Thu Jul 16 20:22:30 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E119106566B for ; Thu, 16 Jul 2009 20:22:30 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe02.swip.net [212.247.154.33]) by mx1.freebsd.org (Postfix) with ESMTP id AAB5C8FC26 for ; Thu, 16 Jul 2009 20:22:29 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=BQeo18V-fugA:10 a=MXw7gxVQKqGXY79tIT8aFQ==:17 a=8kQB0OdkAAAA:8 a=6I5d2MoRAAAA:8 a=VSPY1edCvaJWUeliMl4A:9 a=0AwTxFcmsfbhUwSTj5QA:7 a=LZj8knURKD92ZaK0HJhDCa8-Mq0A:4 a=9aOQ2cSd83gA:10 Received: from [62.113.132.61] (account mc467741@c2i.net HELO laptop.adsl.tele2.no) by mailfe02.swip.net (CommuniGate Pro SMTP 5.2.13) with ESMTPA id 1288337506; Thu, 16 Jul 2009 22:22:27 +0200 From: Hans Petter Selasky To: Patrick Lamaiziere Date: Thu, 16 Jul 2009 22:22:10 +0200 User-Agent: KMail/1.11.4 (FreeBSD/8.0-BETA1; KDE/4.2.4; i386; ; ) References: <20090703172600.1971111e@baby-jane.lamaiziere.net> <200907130846.51980.hselasky@c2i.net> <20090716215528.271fc177@baby-jane.lamaiziere.net> In-Reply-To: <20090716215528.271fc177@baby-jane.lamaiziere.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200907162222.11736.hselasky@c2i.net> Cc: freebsd-current@freebsd.org Subject: Re: ulpt problem (USB_ERR_IOERROR) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jul 2009 20:22:30 -0000 Hi, On Thursday 16 July 2009 21:55:28 Patrick Lamaiziere wrote: > Le Mon, 13 Jul 2009 08:46:50 +0200, > > Hans Petter Selasky 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