From hscholz@deimos.raisdorf.net Fri Jun 18 11:13:12 2004 Return-Path: Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CBB6216A4CE for ; Fri, 18 Jun 2004 11:13:12 +0000 (GMT) Received: from deimos.raisdorf.net (pD9E3DD9C.dip.t-dialin.net [217.227.221.156]) by mx1.FreeBSD.org (Postfix) with ESMTP id C803943D31 for ; Fri, 18 Jun 2004 11:13:10 +0000 (GMT) (envelope-from hscholz@deimos.raisdorf.net) Received: from deimos.raisdorf.net (localhost.raisdorf.net [127.0.0.1]) by deimos.raisdorf.net (8.12.11/8.12.11) with ESMTP id i5I7DBFY001124; Fri, 18 Jun 2004 09:13:12 +0200 (CEST) (envelope-from hscholz@deimos.raisdorf.net) Received: (from hscholz@localhost) by deimos.raisdorf.net (8.12.11/8.12.11/Submit) id i5I7DBTE001123; Fri, 18 Jun 2004 09:13:11 +0200 (CEST) (envelope-from hscholz) Message-Id: <200406180713.i5I7DBTE001123@deimos.raisdorf.net> Date: Fri, 18 Jun 2004 09:13:11 +0200 (CEST) From: Hendrik Scholz Reply-To: Hendrik Scholz To: FreeBSD-gnats-submit@freebsd.org Cc: Hendrik Scholz Subject: devstat: disappearing devices not properly removed X-Send-Pr-Version: 3.113 X-GNATS-Notify: >Number: 68074 >Category: misc >Synopsis: devstat: disappearing devices not properly removed >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jun 18 11:20:10 GMT 2004 >Closed-Date: Sun Jun 27 20:53:45 GMT 2004 >Last-Modified: Sun Jun 27 21:00:41 GMT 2004 >Originator: Hendrik Scholz >Release: FreeBSD 5.2-CURRENT i386 >Organization: >Environment: System: FreeBSD deimos.raisdorf.net 5.2-CURRENT FreeBSD 5.2-CURRENT #2: Tue Jun 15 02:20:43 CEST 2004 hscholz@deimos.raisdorf.net:/usr/src/sys/i386/compile/DEIMOS i386 >Description: When attaching USB or firewire mass storage devices (USB CF disk, iPod) a new scsi disk gets created and a libdevstat struct devstat entry is added. Once a device is unplugged and no longer available this entry should be removed but still appears on -current. >How-To-Repeat: - check number of devices $ sysctl kern.devstat.numdevs kern.devstat.numdevs: 2 (ad0 and fd0 in this case - see systat -vm 1) - attach USB umass device umass0: SanDisk ImageMate CF, rev 2.00/1.19, addr 2 da0 at umass-sim0 bus 0 target 0 lun 0 da0: Removable Direct Access SCSI-0 device da0: 1.000MB/s transfers da0: 246MB (503808 512 byte sectors: 64H 32S/T 246C) - check number of devices $ sysctl kern.devstat.numdevs kern.devstat.numdevs: 4 ad0, fd0, da0, pass0 - detach device umass0: at uhub0 port 2 (addr 2) disconnected (da0:umass-sim0:0:0:0): lost device (da0:umass-sim0:0:0:0): removing device entry umass0: detached - check number of devices $ sysctl kern.devstat.numdevs kern.devstat.numdevs: 4 This should be two again NOTES: - only tested with one Sandisk USB 1.1/2.0 cardreader since I didn't have anything else available on the flight - apparently the devices properly disappear from systat -vm and sysctl on 5.2.1-REL-p6 dmesg: Copyright (c) 1992-2004 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 5.2-CURRENT #2: Tue Jun 15 02:20:43 CEST 2004 hscholz@deimos.raisdorf.net:/usr/src/sys/i386/compile/DEIMOS Preloaded elf kernel "/boot/kernel/kernel" at 0xc0832000. Preloaded elf module "/boot/kernel/acpi.ko" at 0xc08322bc. Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: Mobile Intel(R) Pentium(R) III CPU - M 1000MHz (531.57-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x6b4 Stepping = 4 Features=0x383f9ff real memory = 125304832 (119 MB) avail memory = 112824320 (107 MB) random: Pentium Pro MTRR support enabled npx0: [FAST] npx0: on motherboard npx0: INT 16 interface acpi0: on motherboard acpi0: [GIANT-LOCKED] pcibios: BIOS version 2.10 acpi0: Power Button (fixed) Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x8008-0x800b on acpi0 cpu0: port 0x530-0x537 on acpi0 acpi_tz0: port 0x530-0x537 on acpi0 acpi_acad0: on acpi0 acpi_cmbat0: on acpi0 acpi_button0: on acpi0 acpi_lid0: on acpi0 acpi_button1: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pcib0: slot 2 INTA is routed to irq 10 pcib0: slot 29 INTA is routed to irq 10 pcib0: slot 29 INTB is routed to irq 11 pcib0: slot 29 INTC is routed to irq 11 pcib0: slot 31 INTB is routed to irq 10 pcib0: slot 31 INTB is routed to irq 10 pcib0: slot 31 INTB is routed to irq 10 agp0: mem 0xe0000000-0xe007ffff,0xe80 00000-0xefffffff irq 10 at device 2.0 on pci0 agp0: Reserved 0x8000000 bytes for rid 0x10 type 3 at 0xe8000000 agp0: Reserved 0x80000 bytes for rid 0x14 type 3 at 0xe0000000 agp0: detected 8060k stolen memory agp0: aperture size is 128M pci0: at device 2.1 (no driver attached) uhci0: port 0x8c80-0x8c9f irq 10 at device 29.0 on pci0 uhci0: Reserved 0x20 bytes for rid 0x20 type 4 at 0x8c80 uhci0: [GIANT-LOCKED] usb0: on uhci0 usb0: USB revision 1.0 uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered umass0: SanDisk ImageMate CF, rev 2.00/1.19, addr 2 uhci1: port 0x8ca0-0x8cbf irq 11 at device 29.1 on pci0 uhci1: Reserved 0x20 bytes for rid 0x20 type 4 at 0x8ca0 uhci1: [GIANT-LOCKED] usb1: on uhci1 usb1: USB revision 1.0 uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub1: 2 ports with 2 removable, self powered uhci2: port 0x8cc0-0x8cdf irq 11 at device 29.2 on pci0 uhci2: Reserved 0x20 bytes for rid 0x20 type 4 at 0x8cc0 uhci2: [GIANT-LOCKED] usb2: on uhci2 usb2: USB revision 1.0 uhub2: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub2: 2 ports with 2 removable, self powered pcib1: at device 30.0 on pci0 pci2: on pcib1 pcib1: slot 3 INTB is routed to irq 11 pcib1: slot 5 INTA is routed to irq 11 cbb0: at device 3.0 on pci2 cbb0: Lazy allocation of 0x1000 bytes rid 0x10 type 3 at 0xe0201000 cardbus0: on cbb0 pccard0: <16-bit PCCard bus> on cbb0 pcib1: slot 3 INTA is routed to irq 10 fwohci0: mem 0xe0200000-0xe02007ff irq 11 at device 3.1 on pci2 fwohci0: Reserved 0x800 bytes for rid 0x10 type 3 at 0xe0200000 fwohci0: [GIANT-LOCKED] fwohci0: OHCI version 1.0 (ROM=1) fwohci0: No. of Isochronous channel is 4. fwohci0: EUI64 00:00:f0:41:04:10:01:42 fwohci0: Phy 1394a available S400, 2 ports. fwohci0: Link S400, max_rec 2048 bytes. firewire0: on fwohci0 sbp0: on firewire0 fwe0: on firewire0 if_fwe0: Fake Ethernet address: 02:00:f0:10:01:42 fwe0: Ethernet address: 02:00:f0:10:01:42 fwohci0: Initiate bus reset fwohci0: node_id=0xc800ffc0, gen=1, CYCLEMASTER mode firewire0: 1 nodes, maxhop <= 0, cable IRM = 0 (me) firewire0: bus manager 0 (me) xl0: <3Com 3c905C-TX Fast Etherlink XL> port 0xa000-0xa07f mem 0xe0200800-0xe020 087f irq 11 at device 5.0 on pci2 xl0: Reserved 0x80 bytes for rid 0x14 type 3 at 0xe0200800 miibus0: on xl0 ukphy0: on miibus0 ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto xl0: Ethernet address: 00:00:f0:77:01:3e xl0: [GIANT-LOCKED] cbb1: at device 7.0 on pci2 cbb1: Lazy allocation of 0x1000 bytes rid 0x10 type 3 at 0xe0202000 cardbus1: on cbb1 pccard1: <16-bit PCCard bus> on cbb1 pcib1: slot 7 INTA is routed to irq 5 isab0: at device 31.0 on pci0 isa0: on isab0 atapci0: port 0x9000-0x900f,0x376,0x170-0x177,0x 3f6,0x1f0-0x1f7 at device 31.1 on pci0 atapci0: Reserved 0x10 bytes for rid 0x20 type 4 at 0x9000 atapci0: Reserved 0x8 bytes for rid 0x10 type 4 at 0x1f0 atapci0: Reserved 0x1 bytes for rid 0x14 type 4 at 0x3f6 ata0: at 0x1f0 irq 14 on atapci0 atapci0: Reserved 0x8 bytes for rid 0x18 type 4 at 0x170 atapci0: Reserved 0x1 bytes for rid 0x1c type 4 at 0x376 ata1: at 0x170 irq 15 on atapci0 pci0: at device 31.3 (no driver attached) pcm0: port 0x80c0-0x80ff,0x8400-0x84ff irq 10 at device 3 1.5 on pci0 pcm0: Reserved 0x100 bytes for rid 0x10 type 4 at 0x8400 pcm0: Reserved 0x40 bytes for rid 0x14 type 4 at 0x80c0 pcm0: [GIANT-LOCKED] pcm0: pci0: at device 31.6 (no driver attached) acpi_ec0: port 0x66,0x62 on acpi0 atkbdc0: port 0x64,0x60 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] psm0: irq 12 on atkbdc0 psm0: [GIANT-LOCKED] psm0: model Generic PS/2 mouse, device ID 0 sio0: configured irq 4 not in bitmap of probed irqs 0 sio0: port may not be enabled sio0 port 0x3f8-0x3ff irq 4 on acpi0 sio0: type 8250 or not responding fdc0: port 0x3f7,0x3f0-0 x3f5 irq 6 drq 2 on acpi0 fdc0: FIFO enabled, 8 bytes threshold fd0: <1440-KB 3.5" drive> on fdc0 drive 0 orm0: