From owner-freebsd-usb@freebsd.org Wed Sep 28 07:59:24 2016 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD0C4C0073F; Wed, 28 Sep 2016 07:59:24 +0000 (UTC) (envelope-from me@janh.de) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3F6F8; Wed, 28 Sep 2016 07:59:23 +0000 (UTC) (envelope-from me@janh.de) Received: from [192.168.178.49] ([84.175.67.119]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0MTNxP-1bOwBk3wlr-00SReP; Wed, 28 Sep 2016 09:59:20 +0200 Subject: Re: Status of PCIe Hotplug? To: Eric van Gyzen References: <791ee95b-ab4e-f07e-6b8d-0e0b6c49ceb0@janh.de> <58f84457-d775-3023-5727-a326bc8df722@FreeBSD.org> Cc: Borja Marcos , FreeBSD-STABLE Mailing List , FreeBSD-USB Mailing List From: Jan Henrik Sylvester Message-ID: Date: Wed, 28 Sep 2016 09:59:10 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <58f84457-d775-3023-5727-a326bc8df722@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:RcxwPsL8WH6/LQ7NzKz98tDMSZj4DNLKdKFaalReyls7HIJUnCU WnlKqOs7KdS5F1c6Egz7xtuVYR0vhn9t6ThMbdT1BTZS7b6r0QecjsxBd+BzKz2yzq+x8ws MYVKK6+VV+JIRMMQFG6EVimgMXEV8ls1x7gjVR8Cdz8WltThWeWatj3lMyFUXlKwamJUpZY 6yFuX6/9VMNKul22g6kOg== X-UI-Out-Filterresults: notjunk:1;V01:K0:gWDtL+mLyK4=:uTRzq/P5oY1ngo2aeAag95 aa4ElBueqlLbs2+fCZNJS2PWJc3fFb2YCfOs+Vum58MpjaXP/5wk2IxTwHRff1odGzjcsCFuf B7y2BVlEFuJfXY50prDokd0GABcB0BwBbIp+KZBsDDUCWZM8opixWPhL5Ec/8BNJ0+riOimVh lhaMIzBc4NLY7XFbXwBWZSEli//3RBlQAjjUqRYHtlqmeknQXShTTft3o7j8CIsT1eMCoKWnZ iY8n0jIwnUkzPKJNhhyeoKR6wIaV7BVuFY0bPZuD62kcqBrVGbUCcKy/KJAH+Eherm7YiDX2L 2p2vI92qr5Bq4KOqmuIxxT0t8ZHLLkQFPue99uTeLbBxlBPcpoWDFQAnqsWmGSKqUJezL3lH+ QtEV1NSsgBnJ1MTGxWUihyyKx6qfbUfgMU3naIFhNPBe+W7R/K1WLodLiUUeH48GgpcBJYDkQ 0ygvt+DGWcWmLFzuAI16HYut122gEKRKDPKHdEA9Et1MHeT7p222WamtlmxAo1FzxtFf5T7Nk 4yokG3J/X5b5sv6ct8YGuvZwFi6IgLw7v41zx68ZBUdNCJTxGbczkteXtHhhK1oJP7jdaQKUm e3oQXgVELV9+d7tPCmZTIcJJ/Nh7ysGy4oVq9XVSd6eQWqDyyM1NFFFRKN1DSwiNL8+ORc2Ca 7XTMXSH5vne4NUXYsoAFzdPsnTFL2T5oy1OX/j51D+GCuahDXzD6zGFVPVyZ7t2RjMdJDCIqg fWa0F8WdWGrWisSB X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2016 07:59:25 -0000 On 09/27/2016 17:51, Eric van Gyzen wrote: > In the case of Jan's USB 3.0 ExpressCard, it's possible that one or all > of the USB controller drivers (xhci, ehci, uhci) didn't cope with the > surprise removal of the controller. Before removing the card, try > detaching the driver(s) with "devctl detach xhciN". There might be more > than one device. Use "pciconf -lc" to find the HotPlug-capable pcib > devices (bridges). Use devinfo to find which one is your ExpressCard > slot and find all the devices attached to it. Then use devctl to detach > the devices. There could be a tree of devices; in that case, you can > usually start at the level immediately under pcibN; you don't need to > detach every device from the bottom up. Once all the devices are > detached, you should be able to remove the card safely. Doing "devctl detach xhci0" before the removal of the USB 3.0 ExpressCard, there is no panic, the device gets deattached properly, and I can reconnect it later. Anyhow, because the mechanism holding the ExpressCard is not completely reliable, on the third time inserting the card, it did not hold and I got a panic, because it was immediately ejected without devctl detach. Due to the card not holding firmly, I often pulled it together with the usb device on 10.3-RELEASE and never got a panic. I guess it is a regression in the usb driver dealing with sudden loss of the device. The panic message is below, I guess I should take this discussion to freebsd-usb@, CCed. Thanks, Jan Henrik Fatal trap 9: general protection fault while in kernel mode cpuid = 1; acpic id = 01 instruction pointer = 0x20:0xffffffff80b1549c stack pointer = 0x28:0xfffffe022f62ca00 frame pointer = 0x28:0xfffffe022f62ca70 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 14 (usbus1) trap number = 9 panic: general protection fault cpuid = 1 KDB: stack backtrace: #0 0xffffffff80b24077 at kdb_backtrace+0x67 #1 0xffffffff80ad93e2 at vpanic+0x182 #2 0xffffffff80ad9253 at panic+0x43 #3 0xffffffff80fa0d31 at trap_fatal+0x351 #4 0xffffffff80fa09c8 at trap+0x768 #5 0xffffffff80f84141 at calltrap+0x8 #6 0xffffffff808f2f63 at usb_detach_device+0xf3 #7 0xffffffff808f1d5b at usb_unconfigure+0x2b #8 0xffffffff808f5623 at usb_free_device+0x103 #9 0xffffffff808f58b1 at usb_bus_detach+0x161 #10 0xffffffff80903e95 at usb_process+0x125 #11 0xffffffff80a90055 at fork_exit+0x85 #12 0xffffffff80f8467e at fork_trampoline+0xe Uptime: 18m27s Automatic reboot in 15 seconds - press a key on the console to abort