Re: FTDI-SIO hang on ftdi_close()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 22 Nov 2010 david.schueler@xxxxxxxxxxxxxxxxxxx wrote:

> -----Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: -----
> 
> >Try one more test: While the ws2500 program is running, make a copy
> >of
> >both the "async" and "registers" files in
> >/sys/kernel/debug/usb/ohci/0000:00:02.0/.  Then try to make a second
> >copy after shutting down the program and causing it to hang.
> 
> Hmm this is really hard because the ws2500 just reads waetherdata when
> started and then pipes it to a file. I have to be very very fast to copy
> the async files.
> But, i rebooted, launched gdb and set a breakpoint while teh progeam reads
> some data.
> (gdb) r
> Starting program: /var/www/localhost/htdocs/ws2000/ws2500-1.7/ws2500
> -p /dev/ttyWeather -n -t -i
> 
> Breakpoint 1, getData (ws2500Data=0x7ffff05c43c0, dcfInfo=0x7ffff05c4580,
> ws2500Stat=0x7ffff05c4510) at ws2500.c:1298
> 1298       DEBUG1("start getData\n");
> (gdb)
> 
> Then i tried to get the needed files:
> Server ws2500-1.7 # mount -t debugfs none /sys/kernel/debug
> Server ws2500-1.7 # cd /sys/kernel/debug
> Server debug # cd usb/
> devices  ehci/    ohci/    usbmon/
> Server debug # cd usb/ohci/0000\:00\:02.0/
> Server 0000:00:02.0 # ls -al
> total 0
> drwxr-xr-x 2 root root 0 Nov 22  2010 .
> drwxr-xr-x 4 root root 0 Nov 22  2010 ..
> -r--r--r-- 1 root root 0 Nov 22  2010 async
> -r--r--r-- 1 root root 0 Nov 22  2010 periodic
> -r--r--r-- 1 root root 0 Nov 22  2010 registers
> Server 0000:00:02.0 # cat async
> Killed
> Server 0000:00:02.0 # cat registers
> 
> Okay. I'm unable to get the contents of that file. The 'cat' locks up. I'm
> not able to get into a new shell. No more processes will be launched. I can
> input characters but nothing happens. No output on the log console, still
> nothing. But it's reponding to ping over the network. Strange. I
> experienced this with kernel 3.6.36 more often.
> At least, i'm able to switch the console but i have to use the sysreq-key
> to sync, remount readonly and reboot the whole system.
> 
> After the reboot i tried a second time, with nearly the same result. I
> tried to cat async two times. *LOCK*. But i was fast enough to get the
> dmesg output:
> [  146.618442] BUG: unable to handle kernel paging request at
> ffff88018859efff

Wow.

> [  146.618446] IP: [<ffffffff81253603>] vsnprintf+0xcb/0x42a
> [  146.618452] PGD 1a0a063 PUD 0
> [  146.618454] Oops: 0002 [#1] SMP
> [  146.618456] last sysfs
> file: /sys/devices/pci0000:00/0000:00:10.0/0000:03:00.0/0000:04:03.0/resource
> 
> [  146.618459] CPU 0
> [  146.618460] Modules linked in: vboxnetadp vboxnetflt vboxdrv w83791d
> hwmon_vid ds3000 cx23885 cx2341x v4l2_common videodev v4l1_compat
> v4l2_compat_ioctl32 videobuf_dma_sg videobuf_dvb dvb_core videobuf_core
> ir_common btcx_risc tveeprom ir_core k10temp asus_atk0110 ftdi_sio
> usbserial
> [  146.618472]
> [  146.618475] Pid: 6311, comm: cat Not tainted 2.6.34-gentoo-r12 #6
> CROSSHAIR II FORMULA/System Product Name
> [  146.618477] RIP: 0010:[<ffffffff81253603>]  [<ffffffff81253603>]
> vsnprintf+0xcb/0x42a
> [  146.618481] RSP: 0018:ffff88008864dd28  EFLAGS: 00010002
> [  146.618482] RAX: 0000000000000005 RBX: ffff88008864dd88 RCX:
> 0000000000000001
> [  146.618484] RDX: ffffffff8182ac6a RSI: ffffffff8182ac6a RDI:
> ffff88018859efff
> [  146.618486] RBP: ffff88008864dd78 R08: 0000000000000005 R09:
> 00000000000001fd
> [  146.618487] R10: 0000000000000005 R11: 0000000000000020 R12:
> ffff88018859efff
> [  146.618489] R13: ffff88018859f000 R14: ffff88018859efff R15:
> ffffffff8182ac6f
> [  146.618491] FS:  00007f5556aee6f0(0000) GS:ffff880001e00000(0000)
> knlGS:0000000000000000
> [  146.618492] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [  146.618494] CR2: ffff88018859efff CR3: 00000000885b3000 CR4:
> 00000000000006f0
> [  146.618495] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> 0000000000000000
> [  146.618497] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
> 0000000000000400
> [  146.618499] Process cat (pid: 6311, threadinfo ffff88008864c000, task
> ffff880136f2eac0)
> [  146.618500] Stack:
> [  146.618501]  ffffffff8182ac6a 0000000000000001 0000000000000000
> 00000000000080d0
> [  146.618504] <0> 0000000000000000 0000000000000001 ffff880005822108
> 0000000000000001
> [  146.618506] <0> ffff88018859efff ffffffff81815151 ffff88008864dde8
> ffffffff812539f2
> [  146.618509] Call Trace:
> [  146.618512]  [<ffffffff812539f2>] scnprintf+0x38/0x4b
> [  146.618515]  [<ffffffff81386631>] show_list+0x196/0x1f8
> [  146.618518]  [<ffffffff813866e5>] fill_async_buffer+0x52/0x6d
> [  146.618520]  [<ffffffff81386a2c>] debug_output+0x56/0xa6
> [  146.618523]  [<ffffffff81212b35>] ? security_file_permission+0x11/0x13
> [  146.618526]  [<ffffffff810ddbb6>] vfs_read+0xa6/0x103
> [  146.618528]  [<ffffffff810ddcc9>] sys_read+0x45/0x69
> [  146.618531]  [<ffffffff8100296b>] system_call_fastpath+0x16/0x1b
> [  146.618532] Code: ce ff 24 cd 90 76 64 81 4d 39 ec 73 20 4c 89 ee 48 63
> f8 44 89 e9 4c 29 e6 44 29 e1 48 39 f7 4c 89 e7 48 89 d6 0f 4e c8 48 63 c9
> <f3> a4 4d 01 c4 e9 1c 03 00 00 8b 13 83 fa 2f 77 0d 89 d0 83 c2
> [  146.618549] RIP  [<ffffffff81253603>] vsnprintf+0xcb/0x42a
> [  146.618552]  RSP <ffff88008864dd28>
> [  146.618553] CR2: ffff88018859efff
> [  146.618555] ---[ end trace 40e07890eee9b1e2 ]---
> 
> Here is what lspci spits out, because in the log it says something like:
> "last sysfs
> file /sys/devices/pci0000:00/0000:00:10.0/0000:03:00.0/0000:04:03.0/resource".

Forget about that; it doesn't matter.

> Looks like a kernel problem? Or a graphics card problem? (I use the
> integrated graphics.) But a hang in scnprintf, what the hell...?
> I'm really confused, now.

It's memory corruption of some kind.  Hard to tell what the cause is, 
but I suspect the OHCI controller.

Anyway, let's start off small.  Here's a short patch which hopefully 
will get rid of the BUG you saw, although it may also get rid of most 
of the useful information.  If this allows you to read the "async" 
file both before and after the hang, we'll move forward from there.

Alan Stern


Index: 2.6.34/drivers/usb/host/ohci-dbg.c
===================================================================
--- 2.6.34.orig/drivers/usb/host/ohci-dbg.c
+++ 2.6.34/drivers/usb/host/ohci-dbg.c
@@ -471,6 +471,7 @@ show_list (struct ohci_hcd *ohci, char *
 		size -= temp;
 		buf += temp;
 
+#if 0
 		list_for_each (entry, &ed->td_list) {
 			u32		cbp, be;
 
@@ -493,6 +494,7 @@ show_list (struct ohci_hcd *ohci, char *
 			size -= temp;
 			buf += temp;
 		}
+#endif
 
 		temp = scnprintf (buf, size, "\n");
 		size -= temp;

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux