From owner-freebsd-current@FreeBSD.ORG Tue Feb 10 20:14:49 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 E6CF71065670; Tue, 10 Feb 2009 20:14:49 +0000 (UTC) (envelope-from shuvaev@physik.uni-wuerzburg.de) Received: from mailrelay.rz.uni-wuerzburg.de (mailrelay.rz.uni-wuerzburg.de [132.187.3.28]) by mx1.freebsd.org (Postfix) with ESMTP id 62C4C8FC24; Tue, 10 Feb 2009 20:14:49 +0000 (UTC) (envelope-from shuvaev@physik.uni-wuerzburg.de) Received: from virusscan.mail (localhost [127.0.0.1]) by mailrelay.mail (Postfix) with ESMTP id 0A3A0199071; Tue, 10 Feb 2009 21:14:48 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by virusscan.mail (Postfix) with ESMTP id F1AD719906E; Tue, 10 Feb 2009 21:14:47 +0100 (CET) Received: from mail.physik.uni-wuerzburg.de (wthp192.physik.uni-wuerzburg.de [132.187.40.192]) by mailmaster.uni-wuerzburg.de (Postfix) with ESMTP id D2AEF199062; Tue, 10 Feb 2009 21:14:47 +0100 (CET) Received: from wep4035 ([132.187.37.35]) by mail.physik.uni-wuerzburg.de (Lotus Domino Release 8.0.2HF443) with ESMTP id 2009021021144764-50479 ; Tue, 10 Feb 2009 21:14:47 +0100 Received: by wep4035 (sSMTP sendmail emulation); Tue, 10 Feb 2009 21:14:47 +0100 From: "Alexey Shuvaev" Date: Tue, 10 Feb 2009 21:14:47 +0100 To: John Baldwin Message-ID: <20090210201447.GA1664@wep4035.physik.uni-wuerzburg.de> References: <200902021643.39862.c47g@gmx.at> <200902091133.48838.jhb@freebsd.org> <200902091958.39480.c47g@gmx.at> <200902091458.41637.jhb@freebsd.org> MIME-Version: 1.0 In-Reply-To: <200902091458.41637.jhb@freebsd.org> Organization: Universitaet Wuerzburg User-Agent: Mutt/1.5.18 (2008-05-17) X-MIMETrack: Itemize by SMTP Server on domino1/uni-wuerzburg(Release 8.0.2HF443 | November 25, 2008) at 02/10/2009 09:14:47 PM, Serialize by Router on domino1/uni-wuerzburg(Release 8.0.2HF443 | November 25, 2008) at 02/10/2009 09:14:47 PM, Serialize complete at 02/10/2009 09:14:47 PM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Virus-Scanned: by amavisd-new at uni-wuerzburg.de Cc: freebsd-current@freebsd.org Subject: Re: lpt stopped working 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: Tue, 10 Feb 2009 20:14:50 -0000 On Mon, Feb 09, 2009 at 02:58:41PM -0500, John Baldwin wrote: > On Monday 09 February 2009 1:58:39 pm Christian Gusenbauer wrote: > > On Monday 09 February 2009, John Baldwin wrote: > > > > > > Please help to debug this so we can have working lpt0 in 8.0. No one > > > tested the patches months ago when I first posted them, and if folks do > not > > > test them now I will simply remove the driver before 8.0 ships. I no > > > > Mea culpa, too. As you sent your patches, I thought someone else will do the > > tests surely ... :-(. > > > > > longer have any hardware such that I can test this directly, so I am > > > depending on folks to test things I have asked for and report back. I > > > believe the last thing I asked for was for someone to do this when they > lpt > > > was hung: > > > > > > Ok, can you run kgdb against your running kernel (Just run 'kgdb' without > > > any arguments) and do the following: > > > > > > (kgdb) p *(struct ppb_data *)ppbus_devclass->devices[0]->softc > > > > > > Assuming the ppb_owner is not 0, can you then do this: > > > > > > (kgdb) p *(device_t)((struct ppb_data > > > *)ppbus_devclass->devices[0]->softc)->ppb_owner > > > > This is the output (unfortunately ppb_owner IS 0): > > > > (kgdb) p *(struct ppb_data *)ppbus_devclass->devices[0]->softc > > $1 = {class_id = 10, state = 1, error = 0, mode = 0, ppb_owner = 0x0, > > ppc_lock = 0xc56bfe7c, ppc_irq_res = 0xc573d5c0} > > And this is while lpd or the like is hung trying to write to /dev/lpt0? > Hello all! Ok, here we go. 1st, the system: ~> uname -a FreeBSD wep4035 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Sat Feb 7 20:25:10 CET 2009 root@wep4035:/usr/obj/usr/src/sys/NOUSB amd64 Parallel port (from dmesg): ppc0: port 0x378-0x37f,0x778-0x77f irq 7 drq 3 on acpi0 ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode ppc0: FIFO with 16/16/9 bytes threshold ppc0: [ITHREAD] ppbus0: on ppc0 ppbus0: IEEE1284 device found /NIBBLE/ECP ppbus0: Probing for PnP devices: ppbus0: PRINTER MLC,PCL,PML,SCL plip0: on ppbus0 plip0: [ITHREAD] lpt0: on ppbus0 lpt0: [ITHREAD] lpt0: Interrupt-driven port ppi0: on ppbus0 I have simplified things and do not run lpd. The command is: 'ktrace -id cat monitor_info > /dev/lpt0' (I think it should work?) kdump -E > ktrace.dump does not show anything interesting: [snip] 1564 cat 0.001120 CALL open(0x7fffffffee1c,O_RDONLY,0x6d) 1564 cat 0.001127 NAMI "monitor_info" 1564 cat 0.001143 RET open 3 1564 cat 0.001149 CALL fstat(0x1,0x7fffffffeac0) 1564 cat 0.001155 STRU struct stat {dev=83951360, ino=53, mode=crw-rw--- - , nlink=1, uid=0, gid=0, rdev=53, atime=1234294743.332164000, stime=1234294743 .332164000, ctime=1234294974, birthtime=-1, size=0, blksize=4096, blocks=0, flag s=0x0 } 1564 cat 0.001160 RET fstat 0 1564 cat 0.001180 CALL __sysctl(0x7fffffffea20,0x2,0x80085eeb8,0x7ffffff fea18,0,0) 1564 cat 0.001187 RET __sysctl 0 1564 cat 0.001191 CALL __sysctl(0x7fffffffea60,0x2,0x7fffffffea7c,0x7fff ffffea70,0,0) 1564 cat 0.001198 RET __sysctl 0 1564 cat 0.001203 CALL __sysctl(0x7fffffffea60,0x2,0x7fffffffea7c,0x7fffffffea70,0,0) 1564 cat 0.001208 RET __sysctl 0 1564 cat 0.001230 CALL __sysctl(0x7fffffffe5f0,0x2,0x8008509e8,0x7fffffffe5e8,0,0) 1564 cat 0.001236 RET __sysctl 0 1564 cat 0.001242 CALL readlink(0x800722639,0x7fffffffe610,0x400) 1564 cat 0.001248 NAMI "/etc/malloc.conf" 1564 cat 0.001264 RET readlink -1 errno 2 No such file or directory 1564 cat 0.001270 CALL issetugid 1564 cat 0.001275 RET issetugid 0 1564 cat 0.001296 CALL break(0x600000) 1564 cat 0.001302 RET break 0 1564 cat 0.001317 CALL __sysctl(0x7fffffffe850,0x2,0x7fffffffe86c,0x7fffffffe860,0,0) 1564 cat 0.001324 RET __sysctl 0 1564 cat 0.001329 CALL mmap(0,0x100000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0) 1564 cat 0.001335 RET mmap 8790016/0x800862000 1564 cat 0.001340 CALL mmap(0x800962000,0x9e000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0) 1564 cat 0.001346 RET mmap 9838592/0x800962000 1564 cat 0.001351 CALL munmap(0x800862000,0x9e000) 1564 cat 0.001359 RET munmap 0 1564 cat 0.001378 CALL read(0x3,0x800902000,0x1000) 1564 cat 0.006845 GIO fd 3 read 4096 bytes "(II) VESA(0): VESA VBE DDC supported (II) VESA(0): VESA VBE DDC Level 2 (II) VESA(0): VESA VBE DDC transfer in appr. 1 sec. (==) VESA(0): Write-combining range (0x0,0x1000) was already clear (==) VESA(0): Write-combining range (0x0,0x1000) was already clear [snip] 1 604 625 +hsync +vsync (46.9 kHz) (II) VESA(0): Modeline "800x600"x0.0 50.00 800 856 976 1040 600 63\ 7 643 666 +hsync +vsync (48.1 kHz) (II) VESA(0): Modeline "1280x1024"x60.0 108.88 1280 1360 1496 1712 \ 1024 1025 1028 1060 -hsync +vsync (63.6 kHz) (II) VESA(0): Modeline "1680x1050"x60.0 147.14 16" 1564 cat 0.006879 RET read 4096/0x1000 1564 cat 0.006888 CALL write(0x1,0x800902000,0x1000) 1564 cat 114.695563 RET write RESTART 1564 cat 114.695637 PSIG SIGINT SIG_DFL After 114 seconds I have hit Ctrl-C. And this is from kgdb: (kgdb) p *(struct ppb_data *)ppbus_devclass->devices[0]->softc $1 = {class_id = 0, state = 1, error = 0, mode = 0, ppb_owner = 0xffffff0004668700, ppc_lock = 0xffffff0004668eb8, ppc_irq_res = 0xffffff0004677900} (kgdb) p *(device_t)((struct ppb_data*)ppbus_devclass->devices[0]->softc)->ppb _owner $2 = {ops = 0xffffff0001520000, link = {tqe_next = 0xffffff0004668500, tqe_prev = 0xffffff0004668908}, devlink = {tqe_next = 0xffffff0004668500, tqe_prev = 0xffffff0004668918}, parent = 0xffffff0004669000, children = { tqh_first = 0x0, tqh_last = 0xffffff0004668730}, driver = 0xffffffff806961c0, devclass = 0xffffff00014f4900, unit = 0, nameunit = 0xffffff0004666940 "lpt0", desc = 0xffffffff804fc110 "Printer", busy = 0, state = DS_ATTACHED, devflags = 0, flags = 7, order = 0 '\0', pad = 0 '\0', ivars = 0xffffff0004668800, softc = 0xffffff0004668400, sysctl_ctx = {tqh_first = 0xffffff0004674180, tqh_last = 0xffffff0004674288}, sysctl_tree = 0xffffff000467d480} (kgdb) The driver stays in this state even after exit of 'cat' process (I think this was already reported): ~> cat monitor_info > /dev/lpt0 /dev/lpt0: Device busy. I can play with the printer et. al. (ppi, maybe plip) in the evenings, so if you need something else... Alexey.