From owner-freebsd-usb@FreeBSD.ORG Thu Sep 27 13:29:04 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 18137106566B; Thu, 27 Sep 2012 13:29:04 +0000 (UTC) (envelope-from Benjamin.Close@clearchain.com) Received: from mail.clearchain.com (leo.clearchain.com [199.73.29.74]) by mx1.freebsd.org (Postfix) with ESMTP id 8B60E8FC19; Thu, 27 Sep 2012 13:29:03 +0000 (UTC) Received: from Lynx.local ([101.113.61.70]) (authenticated bits=0) by mail.clearchain.com (8.14.5/8.14.5) with ESMTP id q8RDSXRv023747 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 27 Sep 2012 22:58:46 +0930 (CST) (envelope-from Benjamin.Close@clearchain.com) Message-ID: <506454BE.70600@clearchain.com> Date: Thu, 27 Sep 2012 22:59:34 +0930 From: Benjamin Close User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Hans Petter Selasky References: <504DED78.2010203@clearchain.com> <504FDD37.5060407@clearchain.com> <201209120749.07628.hselasky@c2i.net> In-Reply-To: <201209120749.07628.hselasky@c2i.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (mail.clearchain.com [199.73.29.74]); Thu, 27 Sep 2012 22:58:49 +0930 (CST) Cc: mav@freebsd.org, freebsd-usb@freebsd.org Subject: Re: Fwd: usb port issue in 9.1-Prerelease (Possibly Cam related) 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: Thu, 27 Sep 2012 13:29:04 -0000 As a followup for anyone reading the mailing lists.. This hang will most likely be fixed when the resolution to: http://lists.freebsd.org/pipermail/svn-src-head/2012-September/040561.html is correctly worked out. On 12/09/12 3:19 PM, Hans Petter Selasky wrote: > Hi Alexander, > > Looks like some bugs in the refcounting in CAM layer. > > --HPS > > On Wednesday 12 September 2012 02:54:15 Benjamin Close wrote: >> Sending to -usb as no response from -stable. >> >> >> -------- Original Message -------- >> Subject: usb port issue in 9.1-Prerelease (Possibly Cam related) >> Date: Mon, 10 Sep 2012 23:09:04 +0930 >> From: Benjamin Close >> To: freebsd-stable@freebsd.org >> >> >> >> Hi Folks, >> I've facing an intermittent hang with a USB port which seems cam >> related: >> >> Event's that happen are: >> >> o USB modem (HUAWEI E220) plugged into PC >> >> ugen3.2: at usbus3 >> u3g0: <3G Modem> on usbus3 >> u3g0: Found 3 ports. >> umass0: on usbus3 >> umass0: SCSI over Bulk-Only; quirks = 0x0000 >> umass0:6:0:-1: Attached to scbus6 >> umass1: on usbus3 >> umass1: SCSI over Bulk-Only; quirks = 0x0000 >> umass1:7:1:-1: Attached to scbus7 >> cd1 at umass-sim0 bus 0 scbus6 target 0 lun 0 >> cd1: Removable CD-ROM SCSI-2 device >> cd1: 1.000MB/s transfers >> cd1: Attempt to query device size failed: NOT READY, Medium not present >> da0 at umass-sim1 bus 1 scbus7 target 0 lun 0 >> da0: Removable Direct Access SCSI-2 device >> da0: 1.000MB/s transfers >> da0: Attempt to query device size failed: NOT READY, Medium not present >> >> >> o Time Elapses....many packets passed, no da0 or cd1 used. >> >> >> o USB Modem drops off the bus >> (It does this occasionally as it resets itself) >> >> o Causes USB bus to lose devices >> >> ugen3.2: at usbus3 (disconnected) >> u3g0: at uhub3, port 1, addr 2 (disconnected) >> (cd1:umass-sim0:0:0:0): lost device, 1 refs >> (cd1:umass-sim0:0:0:0): removing device entry >> (pass4:umass-sim0:0:0:0): passdevgonecb: devfs entry is gone >> (da0:umass-sim1:1:0:0): lost device - 0 outstanding, 1 refs >> (da0:umass-sim1:1:0:0): removing device entry >> (pass5:umass-sim1:1:0:0): passdevgonecb: devfs entry is gone >> umass0: at uhub3, port 1, addr 2 (disconnected) >> >> >> At this point that particular USB port is effectively useless. Plugging >> anything into the ports shows no device showing up. >> >> Running usbconfig hangs with: >> >> PID TID COMM TDNAME KSTACK >> 48562 101874 usbconfig - mi_switch+0x186 >> sleepq_wait+0x42 _sx_xlock_hard+0x426 usbd_enum_lock+0xac >> usb_ref_device+0x21c usb_open+0xc7 devfs_open+0x197 vn_open_cred+0x2ff >> kern_openat+0x20a amd64_syscall+0x540 Xfast_syscall+0xf7 >> >> Controller is: >> >> uhci0@pci0:0:26:0: class=0x0c0300 card=0x02091028 chip=0x28348086 >> rev=0x02 hdr=0x00 >> vendor = 'Intel Corporation' >> device = '82801H (ICH8 Family) USB UHCI Controller' >> class = serial bus >> subclass = USB >> uhci1@pci0:0:26:1: class=0x0c0300 card=0x02091028 chip=0x28358086 >> rev=0x02 hdr=0x00 >> vendor = 'Intel Corporation' >> device = '82801H (ICH8 Family) USB UHCI Controller' >> class = serial bus >> subclass = USB >> ehci0@pci0:0:26:7: class=0x0c0320 card=0x02091028 chip=0x283a8086 >> rev=0x02 hdr=0x00 >> vendor = 'Intel Corporation' >> device = '82801H (ICH8 Family) USB2 EHCI Controller' >> class = serial bus >> subclass = USB >> >> It does however seem related to cam as looking at the various threads >> for the usb hub I find: >> >> (kgdb) bt >> #0 sched_switch (td=0xfffffe0002650000, newtd=0xfffffe000227f000, >> flags=Variable "flags" is not available. >> ) at /usr/src/sys/kern/sched_ule.c:1927 >> #1 0xffffffff808f34c6 in mi_switch (flags=260, newtd=0x0) at >> /usr/src/sys/kern/kern_synch.c:485 >> #2 0xffffffff8092bfd2 in sleepq_wait (wchan=0xfffffe001ec2a900, pri=92) >> at /usr/src/sys/kern/subr_sleepqueue.c:623 >> #3 0xffffffff808f3c69 in _sleep (ident=0xfffffe001ec2a900, >> lock=0xfffffe00371e9210, priority=Variable "priority" is not available. >> ) at /usr/src/sys/kern/kern_synch.c:250 >> #4 0xffffffff802bea02 in cam_sim_free (sim=0xfffffe001ec2a900, >> free_devq=1) at /usr/src/sys/cam/cam_sim.c:112 >> #5 0xffffffff8074f8ba in umass_detach (dev=Variable "dev" is not >> available. ) at /usr/src/sys/dev/usb/storage/umass.c:2183 >> #6 0xffffffff8091a054 in device_detach (dev=0xfffffe001ec2e900) at >> device_if.h:214 >> #7 0xffffffff8075c458 in usb_detach_device (udev=0xfffffe0007ce8800, >> iface_index=32 ' ', flag=Variable "flag" is not available. >> ) at /usr/src/sys/dev/usb/usb_device.c:1065 >> #8 0xffffffff8075c5f4 in usb_unconfigure (udev=0xfffffe0007ce8800, >> flag=Variable "flag" is not available. >> ) at /usr/src/sys/dev/usb/usb_device.c:455 >> #9 0xffffffff8075c88e in usb_free_device (udev=0xfffffe0007ce8800, >> flag=Variable "flag" is not available. >> ) at /usr/src/sys/dev/usb/usb_device.c:2093 >> #10 0xffffffff80764e5e in uhub_explore (udev=0xfffffe0007353800) at >> /usr/src/sys/dev/usb/usb_hub.c:358 >> #11 0xffffffff8074f536 in usb_bus_explore (pm=Variable "pm" is not >> available. >> ) at /usr/src/sys/dev/usb/controller/usb_controller.c:359 >> #12 0xffffffff80769173 in usb_process (arg=Variable "arg" is not available. >> ) at /usr/src/sys/dev/usb/usb_process.c:170 >> #13 0xffffffff808bc2df in fork_exit (callout=0xffffffff807690a0 >> , arg=0xffffff80007c0e88, frame=0xffffff804743cc40) at >> /usr/src/sys/kern/kern_fork.c:992 >> #14 0xffffffff80bc216e in fork_trampoline () at >> /usr/src/sys/amd64/amd64/exception.S:602 >> >> >> From: cam_sim_free(struct cam_sim *sim, int free_devq) >> >> (kgdb) l >> 107 { >> 108 int error; >> 109 >> 110 sim->refcount--; >> 111 if (sim->refcount > 0) { >> >> 112 error = msleep(sim, sim->mtx, PRIBIO, "simfree", >> 0); >> >> 113 KASSERT(error == 0, ("invalid error value for >> msleep(9)")); >> 114 } >> 115 >> 116 KASSERT(sim->refcount == 0, ("sim->refcount == 0")); >> >> >> It almost appears as if the cam layer is trying to finalise a write of >> some sort but the physical device has already gone. >> >> (kgdb) p sim->refcount >> $1 = 1 >> >> Not sure why refcount is still ==1. >> >> The same device in a box running 9.0-Stable (as of about 3 months ago) >> with a ICH9 controller works as expected. >> >> Any suggestions? >> >> Cheers, >> Benjamin >> >> >> >> >> _______________________________________________ >> freebsd-usb@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-usb >> To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" >