From owner-freebsd-usb@FreeBSD.ORG Mon Jul 11 15:09:06 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3303D16A41C for ; Mon, 11 Jul 2005 15:09:06 +0000 (GMT) (envelope-from past@ebs.gr) Received: from fly.ebs.gr (fly.ebs.gr [62.103.84.177]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CC6243D45 for ; Mon, 11 Jul 2005 15:09:04 +0000 (GMT) (envelope-from past@ebs.gr) Received: from ebs.gr (root@hal.ebs.gr [10.1.1.2]) by fly.ebs.gr (8.12.9p1/8.12.9) with ESMTP id j6BF8xKU007641 for ; Mon, 11 Jul 2005 18:08:59 +0300 (EEST) (envelope-from past@ebs.gr) Received: from [10.1.1.184] (ajax.ebs.gr [10.1.1.184]) by ebs.gr (8.13.3/8.12.11) with ESMTP id j6BF8wZv035397 for ; Mon, 11 Jul 2005 18:08:59 +0300 (EEST) (envelope-from past@ebs.gr) Received: from 127.0.0.1 (AVG SMTP 7.0.323 [267.8.11]); Mon, 11 Jul 2005 18:08:51 +0300 Message-ID: <42D28B82.7070004@ebs.gr> Date: Mon, 11 Jul 2005 18:08:50 +0300 From: Panagiotis Astithas Organization: EBS Ltd. User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-usb@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: ulpt or ohci bug [was: Proposed patch to ulpt.c] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2005 15:09:06 -0000 I have been experiencing problems with a Hewlett-Packard Color LaserJet 2550 series printer, so I tried your patch. I had to manually remove the local declaration of 'spin', since buildkernel failed. For my situation things remain the same, i.e. nothing breaks, but I still get the symptoms I will describe next. So, at least this is a 'it doesn't break anything' message. I have been reading the relevant code, but I can't see whether my problem is in ulpt or ohci. If someone who knows this stuff can lead me to the right direction, it would be very much appreciated. I've even tried an interesting patch from NetBSD (ulpt.c, rev. 1.64) but it didn't help either. My long-standing problem with ulpt (and RELENG_5) is that printing (through cups or lpd) always works for the first document, but the next process hangs forever in a ulptwr state: box# ps axwwwl | grep usb 0 45 0 0 8 0 0 8 usbevt DL ?? 0:00.02 [usb0] 0 46 0 0 8 0 0 8 usbtsk DL ?? 0:00.00 [usbtask] 0 47 0 0 8 0 0 8 usbevt DL ?? 0:00.00 [usb1] 0 368 1 0 96 0 1244 768 select Is ?? 0:00.01 /usr/sbin/usbd 0 735 479 0 0 0 2572 1332 ulptwr I ?? 0:00.01 usb:/dev/ulpt0 11 root Test Page 1 (usb) 0 794 480 0 96 0 352 220 - R+ p0 0:00.00 grep usb 0 773 771 0 5 0 1696 1348 ttyin I+ p1 0:00.13 less usb.debug I see the same behavior on two different systems, on 5.4, RELENG_5, SMP and UP. This particular system has: box# usbdevs -v Controller /dev/usb0: addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), SiS(0x0000), rev 1.00 port 1 addr 2: full speed, power 2 mA, config 1, hp color LaserJet 2550 series(0x1c17), Hewlett-Packard(0x03f0), rev 1.00 port 2 powered port 3 powered Controller /dev/usb1: addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), SiS(0x0000), rev 1.00 port 1 powered port 2 powered port 3 powered Jul 11 16:10:46 box kernel: ohci0: mem 0xe7000000-0xe7 000fff irq 20 at device 3.0 on pci0 Jul 11 16:10:46 box kernel: usb0: OHCI version 1.0, legacy support Jul 11 16:10:46 box kernel: usb0: on ohci0 Jul 11 16:10:46 box kernel: usb0: USB revision 1.0 Jul 11 16:10:46 box kernel: uhub0: SiS OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 Jul 11 16:10:46 box kernel: uhub0: 3 ports with 3 removable, self powered Jul 11 16:10:46 box kernel: ohci1: mem 0xe6800000-0xe6 800fff irq 21 at device 3.1 on pci0 Jul 11 16:10:46 box kernel: usb1: OHCI version 1.0, legacy support Jul 11 16:10:46 box kernel: usb1: on ohci1 Jul 11 16:10:46 box kernel: usb1: USB revision 1.0 Jul 11 16:10:46 box kernel: uhub1: SiS OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 Jul 11 16:10:46 box kernel: uhub1: 3 ports with 3 removable, self powered Jul 11 16:10:46 box kernel: pci0: at device 3.3 (no driver att ached) Jul 11 16:10:46 box kernel: ulpt0: Hewlett-Packard hp color LaserJet 2550 series , rev 2.00/1.00, addr 2, iclass 7/1 Jul 11 16:10:46 box kernel: ulpt0: using bi-directional mode Cranking up hw.usb.ohci.debug and hw.usb.ulpt.debug to 1 and sending a test page from CUPS, I get: Jul 11 17:26:53 box kernel: ulptopen: flags=0x0 Jul 11 17:26:53 box kernel: ulpt_open: open input pipe Jul 11 17:26:53 box kernel: ulpt_open: start read callout Jul 11 17:26:53 box kernel: ulptopen: done, error=0 Jul 11 17:26:53 box kernel: ulptwrite Jul 11 17:26:53 box kernel: ohci_alloc_std_chain: start len=4096 Jul 11 17:26:53 box kernel: ulptwrite Jul 11 17:26:53 box kernel: ohci_alloc_std_chain: start len=4096 Jul 11 17:26:54 box last message repeated 3 times Jul 11 17:26:54 box kernel: ulptwrite Jul 11 17:26:54 box kernel: ohci_alloc_std_chain: start len=4096 Jul 11 17:26:54 box kernel: ohci_alloc_std_chain: start len=4096 Jul 11 17:26:54 box kernel: ohci_device_bulk_close: pipe=0xc1968400 Jul 11 17:26:54 box kernel: ohci_device_bulk_close: pipe=0xc1735680 Jul 11 17:26:54 box kernel: ulptclose: closed Sending a second test page gives this: Jul 11 17:27:43 box kernel: ulptopen: flags=0x0 Jul 11 17:27:43 box kernel: ulpt_open: open input pipe Jul 11 17:27:43 box kernel: ulpt_open: start read callout Jul 11 17:27:43 box kernel: ulptopen: done, error=0 Jul 11 17:27:43 box kernel: ulptwrite Jul 11 17:27:43 box kernel: ohci_alloc_std_chain: start len=4096 Jul 11 17:28:14 box last message repeated 152 times Jul 11 17:30:15 box last message repeated 605 times Jul 11 17:40:16 box last message repeated 3005 times Jul 11 17:48:16 box last message repeated 2402 times Jul 11 17:48:16 box kernel: ohci_device_bulk_abort: xfer=0xc1987b00 Jul 11 17:48:16 box kernel: ohci_abort_xfer: xfer=0xc1987b00 pipe=0xc15ba680 sed=0xc1592760 Jul 11 17:48:16 box kernel: ulptwrite: error=18 Jul 11 17:48:16 box kernel: ohci_device_bulk_close: pipe=0xc15ba680 Jul 11 17:48:16 box kernel: ohci_device_bulk_close: pipe=0xc15bab00 Jul 11 17:48:16 box kernel: ulptclose: closed where after 20 minutes I killed the process. I have a similar but lengthier debug output with the same sysctl variables raised to 100, here: http://www.netmode.ntua.gr/~past/ulpt.debug.gz If anyone could explain the events a bit and tell me where I should concentrate my debugging, I would appreciate it a lot! Thanks, Panagiotis