usb/88516: [patch]/dev/ulpt hangs when try read() from it (LBP-1120 printer)

Alexey Illarionov littlesavage at rambler.ru
Fri Nov 4 20:50:21 PST 2005


>Number:         88516
>Category:       usb
>Synopsis:       [patch]/dev/ulpt hangs when try read() from it (LBP-1120 printer)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-usb
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 05 04:50:20 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Alexey Illarionov
>Release:        5.4-RELEASE
>Organization:
>Environment:
FreeBSD ls.orionet.ru 5.4-RELEASE-p7 FreeBSD 5.4-RELEASE-p7 #10: Thu Nov  3 12:14:32 MSK 2005     alexey at ls.orionet.ru:/usr/obj/usr/src/sys/LS  i386
Canon LBP-1120 printer

uhci0: <VIA 83C572 USB controller> port 0xcc00-0xcc1f irq 9 at device 7.2 on pci0
uhci0: LegSup = 0xa000
usb0: <VIA 83C572 USB controller> on uhci0
usb0: USB revision 1.0
usbd_get_string: getting lang failed, using 0
uhub0: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1: <VIA 83C572 USB controller> port 0xd000-0xd01f irq 9 at device 7.3 on pci0
uhci1: LegSup = 0xa000
usb1: <VIA 83C572 USB controller> on uhci1
usb1: USB revision 1.0
usbd_get_string: getting lang failed, using 0
uhub1: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
ulpt0: Canon Canon CAPT USB Printer, rev 1.10/1.00, addr 2, iclass 7/1
ulpt0: using bi-directional mode

>Description:
I want to print on my printer Canon LBP-1120 in FreeBSD.
I try to use these driver: http://www.boichat.ch/nicolas/capt/ I change only
/dev/usb/lp0 to /dev/ulpt0 in sources. But I have noticed, that the program
hangs at function read() when try to read from this device. The Same occurs if
execute this:  cat /dev/ulpt0  It is impossible to kill this process.
I think, that it is a bug in the ulpt driver. It seems, that the variable <flags>
is incorrectly initialized in the function ulptopen()
The following occurs: In /usr/src/sys/dev/usb/ulpt.c function lptopen() started
read callout and function ulpt_tick() try to use busy sc->sc_in_xfer
With this patch this driver works. It is possible to print small documents.
>How-To-Repeat:
Plug Canon LBP-1120 printer
cat /dev/ulpt0
kill -s ABRT <pid of 'cat' process>
>Fix:
__FBSDID("$FreeBSD: src/sys/dev/usb/ulpt.c,v 1.65.2.1 2005/01/30 01:00:10 imp Exp $");

--- ulpt.c.orig Sun Jan 30 04:00:10 2005
+++ ulpt.c      Sat Nov  5 06:12:57 2005
@@ -600,7 +600,7 @@
                }

                /* If it's not opened for read the set up a reader. */
-               if (!(flags & FREAD)) {
+               if (!(flag & FREAD)) {
                        DPRINTF(("ulpt_open: start read callout\n"));
                        usb_callout_init(sc->sc_read_callout);
                        usb_callout(sc->sc_read_callout, hz/5, ulpt_tick, sc);

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-usb mailing list