From owner-freebsd-current@FreeBSD.ORG Sun Mar 7 18:41:29 2010 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 E7748106566B for ; Sun, 7 Mar 2010 18:41:28 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe05.swip.net [212.247.154.129]) by mx1.freebsd.org (Postfix) with ESMTP id 4DD158FC25 for ; Sun, 7 Mar 2010 18:41:27 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=ByZRc_aOPEEA:10 a=8nJEP1OIZ-IA:10 a=M8b_wTzEtboA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=pGLkceISAAAA:8 a=gMUvyaaGakBy8VsOJykA:9 a=FL1iqKG-iFfMp8kTRAkA:7 a=FpEAc6FofNjtJOPcI4G7oc_FYhcA:4 a=wPNLvfGTeEIA:10 a=MSl-tDqOz04A:10 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe05.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 1278656755 for freebsd-current@freebsd.org; Sun, 07 Mar 2010 19:41:26 +0100 To: freebsd-current@freebsd.org From: Hans Petter Selasky X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'( =?iso-8859-1?q?=3B=5FIjlA=3A=0A=09hGE=2E=2EEw?=, =?iso-8859-1?q?XAQ*o=23=5C/M=7ESC=3DS1-f9=7BEzRfT=27=7CHhll5Q=5Dha5Bt-s=7Co?= =?iso-8859-1?q?TlKMusi=3A1e=5BwJl=7Dkd=7DGR=0A=09Z0adGx-x=5F0zGbZj=27e?=(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' Date: Sun, 7 Mar 2010 19:39:51 +0100 MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201003071939.51882.hselasky@c2i.net> Subject: Re: Removing USB keyboard after filesystems synced causes panic with destroyed mutex twa(4)? 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: Sun, 07 Mar 2010 18:41:29 -0000 On Sunday 07 March 2010 11:46:58 Garrett Cooper wrote: > On Sun, Mar 7, 2010 at 2:24 AM, Garrett Cooper wrote: > > On Sun, Mar 7, 2010 at 2:07 AM, Garrett Cooper wrote: > >> Hi Alexander and Hans, > >> I recently did the following which generated a panic on a > >> 9-CURRENT kernel compiled on the 26th: > >> > >> 1. Executed reboot > >> 2. Removed keyboard. > >> 3. Some time after `All buffers synced\nUptime: ...' was displayed, > >> the keyboard was registered disconnected. > >> 4. The interrupt was delivered to my twa(4) enabled card and the > >> kernel panicked, like so: > >> > >> ugen2.2: at usbus2 (disconnected) > >> uhub8: at uhub2, port 1, addr 2 (disconnected) > >> ugen2.3: at usbus2 (disconnected) > >> ukbd0: at uhub8, port 3, addr 3 (disconnected) > >> uhid0: at uhub8, port 3, addr 3 (disconnected) > >> panic: mtx_lock_spin() of destroyed mutex @ > >> /usr/src/sys/dev/twa/tw_cl_intr.c:88 > >> > >> cpuid = 1 > >> KDB: enter: panic > >> [thread pid 12 tid 100025 ] > >> Stopped at kdb_enter+0x3d: movq $0,0x40289c(%rip) > >> db> > >> > >> I wish I could provide you with more details, but unfortunately I > >> the USB bus isn't registering the fact that I'm reattaching the > >> keyboard right now and the box won't reboot automatically :( (didn't > >> set the right sysctl beforehand to panic automatically). I'll try and > >> reproduce the issue again, but I was just wondering whether or not you > >> guys had seen this problem before. > > > > Phew... it's reproducible with that kernel. Here's what I did > > exactly (because my original directions were incorrect): > > 1. Hit power button (for S5). > > 2. Disconnect keyboard RIGHT as `Uptime: ...' is displayed. > > Kernel panicked on my system again. Now to figure out if it still > > exists with a kernel compiled today, and also how to debug it if it > > still does exist :/... > > 1. It still does exist with today's kernel. > 2. Here's the backtrace: > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2a > panic() at panic+0x17d > _mtx_lock_spin_flags() at _mtx_lock_spin_flags+0x126 > tw_cl_interrupt() at tw_cl_interrupt+0x14c > twa_pci_intr() at twa_pci_intr+0x11 > intr_event_execute_handlers() at intr_event_execute_handlers+0x67 > ithread_loop() at ithread_loop+0xae > fork_exit() at fork_exit+0x12a > fork_trampoline() at fork_trampoline+0xe > --- trap 0, rip = 0, rsp = 0xffffff80751d6d30, rbp = 0 --- > KDB: enter: panic > [ithread pid 12 tid 100025 ] > Stopped at kdb_enter+0x3d: movq $0, 0x40289c(%rip) > > I'll have to wait until tomorrow to grab a PS/2 keyboard to get more > helpful info :/... > Thanks, > -Garrett > Hi, The reason you get this panic when you unplug the USB keyboard is probably because the twa interrupt handler is shared with the USB one. It does not look like a USB problem to me but rather a problem inside the twa_pci_intr() code. --HPS