Bug#640391: Possible fix ark3116
2011/10/25 ael law_ence@ntlworld.com: On Tue, Oct 25, 2011 at 08:40:09PM +0200, Bart Hartgers wrote: I think I got it. The ark seems sensitive to a specific combination of setting the termios and enabling interrupts/submitting the interrupt urb. The old driver does not suffer because it does not use the interrupt urb. Success! Congratulations. Great! So wonderful. Thanks for all the work. Just a quick reply for tonight: you can stop biting your fingernails... Thanks! I'll create a patch and submit it to the kernel. Okay if I include you as tester in a Tested-by:-tag? Groeten, Bart -- Bart Hartgers - New e-mail: bart.hartg...@gmail.com -- To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/CAK7h4yfjFYVR8UNSN3xdGCpEU=ha_tf5fgk+1cj_k9szxzy...@mail.gmail.com
Bug#640391: [bart.hartg...@gmail.com: [PATCH] ark3116 initialisation fix]
Hi, I just sent the message patch below to linux-usb. Groeten, Bart - Forwarded message from Bart Hartgers bart.hartg...@gmail.com - Date: Wed, 26 Oct 2011 13:29:42 +0200 From: Bart Hartgers bart.hartg...@gmail.com To: linux-...@vger.kernel.org, GregKH gre...@suse.de Cc: ael law_ence@ntlworld.com Subject: [PATCH] ark3116 initialisation fix User-Agent: Mutt/1.5.21 (2010-09-15) Hi, This patch for the usb serial ark3116 driver fixes an initialisation ordering bug that gets triggered on hotplug when using at least recent debian/ubuntu userspace. Without it, ark3116 serial cables don't work. Patch is against 3.1. Groeten, Bart Signed-off-by: Bart Hartgers bart.hartg...@gmail.com Tested-by: law_ence@ntlworld.com --- Move set_termios below dma setup to prevent hardware crash with recent userspace. diff -ur linux-3.1.orig//drivers/usb/serial/ark3116.c linux-3.1/drivers/usb/serial/ark3116.c --- linux-3.1.orig//drivers/usb/serial/ark3116.c2011-10-24 09:10:05.0 +0200 +++ linux-3.1/drivers/usb/serial/ark3116.c 2011-10-26 09:16:41.776874595 +0200 @@ -42,7 +42,7 @@ * Version information */ -#define DRIVER_VERSION v0.6 +#define DRIVER_VERSION v0.7 #define DRIVER_AUTHOR Bart Hartgers bart.hartgers+ark3...@gmail.com #define DRIVER_DESC USB ARK3116 serial/IrDA driver #define DRIVER_DEV_DESC ARK3116 RS232/IrDA @@ -380,10 +380,6 @@ goto err_out; } - /* setup termios */ - if (tty) - ark3116_set_termios(tty, port, NULL); - /* remove any data still left: also clears error state */ ark3116_read_reg(serial, UART_RX, buf); @@ -406,6 +402,10 @@ /* enable DMA */ ark3116_write_reg(port-serial, UART_FCR, UART_FCR_DMA_SELECT); + /* setup termios */ + if (tty) + ark3116_set_termios(tty, port, NULL); + err_out: kfree(buf); return result; - End forwarded message - -- To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20111026113431.GA1955@blackbox
Bug#640391: Possible fix ark3116
Hi ael, I think I got it. The ark seems sensitive to a specific combination of setting the termios and enabling interrupts/submitting the interrupt urb. The old driver does not suffer because it does not use the interrupt urb. I think the new driver on previous ubuntu 11.04 did not suffer because (it seems) userspace handled hotplugging a serial port differently. But new userspace and new driver failed. Simply moving the termios bit in the driver fixed it for me. No real idea why, but that is the joy of undocumented hardware. Could you please try the attached files? Almost the same procedure as previously: $ make # modprobe usbserial # rmmod ark3116 # insmod ./ark3116new.ko Thanks. Groeten, Bart -- Bart Hartgers - New e-mail: bart.hartg...@gmail.com ark3116new.tar.gz Description: GNU Zip compressed data
Bug#640391: usb autosuspend
Hi ael, I made some progress of sorts. I booted into Ubuntu's 3.0.0-12, and I my ark3116 also does not seem to transmit anything anymore. Also if I toggle inputs on the ark, it gets kicked off the USB bus. Note that exactly the same (except for a few unimportant function argument changes) driver worked for me on 2.6.38. From this, it seems as if something else than the driver is causing the problem. I'll ask around on linux-usb, see if they have an idea. However, that does not match with your observation that your ark3116 failed on 2.6.34. You mentioned that you sometimes have a problem with a flaky connection to your gps. Could that play a role here? Unfortunately, as you might have figured, my current work/private situation leaves me very little time to spent on all of this, so I hope you'll bear with me while I make very slow progress. Groeten, Bart -- Bart Hartgers - New e-mail: bart.hartg...@gmail.com -- To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/CAK7h4yfTDE+mgMj7=p4AeKkxPyuABw6izP6yoyPTHFnFX1=z...@mail.gmail.com
Bug#640391: usb autosuspend
2011/10/23 ael a.e.lawre...@lboro.ac.uk: On Sun, Oct 23, 2011 at 02:48:50PM +0200, Bart Hartgers wrote: Well it is nice to know that you can now see the problem directly. However, that does not match with your observation that your ark3116 failed on 2.6.34. You mentioned that you sometimes have a problem with a flaky connection to your gps. Could that play a role here? Not sure. I can't remember when I tested 2.6.34, but I think that was when I was away from home and so my instruments. But I usually tried several times and often checked on the working kernel, so I am pretty confident that I had a good connection. Also IIRC, that was the current debian kernel when I first reported the bug. And I would not report a bug without first checking carefully. The plot thickens: ubuntu's 2.6.38 kernel with ubuntu 11.04's userspace works. But the same 2.6.38 on 11.10 userspace does not work. So your report on 2.6.34 is most likely accurate. Somehow userspace is what it is triggering the problem. But then again, would the version on the debian 2.6.34 be the same as you were trying on 2.6.38? IIRC, 2.6.34 is the first version with the updated driver. After that, there are only unimportant interface changes to keep up with the rest of the kernel. So 2.6.34 should work as well as 2.6.38 or even 3.0. Well thanks for trying and indeed the original driver... For the moment, I should be able to go back to the old kernel until some upgrade on debian testing prevents that :-) Hmm, maybe I should try 2.6.32 on the 11.10 userspace and see what happens. Groeten, Bart ael -- Bart Hartgers - New e-mail: bart.hartg...@gmail.com -- To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/CAK7h4ycW6uQ0sTm=ce52jh2uyiace1krmurmxf2gw776o6q...@mail.gmail.com
Bug#640391: Test result
2011/10/9 ael law_ence@ntlworld.com: On Sat, Oct 08, 2011 at 10:40:01PM +0200, Bart Hartgers wrote: Does this new version make any difference? To confuse you, I did not include a version number in the filenames ;-). However, I fear that neither of the test versions that you sent make any difference. The UART end of the ark3116 continues to behave as if it is switched off, as you said. I can't think of any sensible suggestions apart from porting the old version to the new kernel essentially unchanged: which I am sure you have already considered. And then incrementally change to the new version. I can test the intermediate versions, and maybe pick up the critical change. Hi ael, Yeah, I guess that is about the only option left. I'll start with porting the old driver to 3.0. That way we can make absolutely sure that the driver is the problem. I am beginning to wonder if there isn't something else going on entirely. For example, perhaps usb autosuspend triggers on the new kernel and not on the old? Anyway, as said, porting the old driver will eliminate this possibility, provide a starting point to find the problem, and it will allow you to use your gps on 3.0 ;-). Unfortunately in about 1 week, I will be away from my instruments for a time, perhaps up to a month. But I should still have email (dongle) and the gps, so I could still test basic functionality. I wish that I could be of more help:-( I could maybe hack around with the source a bit trying to change register bits. I must have a 16450 datasheet somewhere which should help a bit with avoiding messing up the known bits. By all means, please try. I am running out of ideas, so a fresh pair of eyes could be useful. Thanks! Groeten, Bart -- Bart Hartgers - New e-mail: bart.hartg...@gmail.com -- To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/CAK7h4yfOs4kj11EQ5RCF2149zdcr3XziS=k5opuzobiegvc...@mail.gmail.com
Bug#640391: linux-image-3.0.0-1-686-pae: ark3116 driver regression
2011/9/21 ael law_ence@ntlworld.com: I have just done another test. This because that garmin odd connector often fails to make proper contact. So in this case I first verified that I could use gpsbabel successfully with the old kernel, so confirming a proper connection. Then I just used $ gpsbabel -w -i garmin -f /dev/ttyUSB0 -o gpx -F test.gpx [ERROR] GPS_Packet_Read: Timeout. No data received. GARMIN:Can't init /dev/ttyUSB0 Hi ael, I finally managed to find some time to test this on my own hardware on 2.6.38. I do not have a garmin gps, so I connect my ark3116 to a second serial interface. I used the same gpsbabel command as you to connect to my ark3116, and I could see data coming in on the second port and if I sent a reply the other way, it is received by gpsbabel. In short, everything seems to work as it should, which is not helping. Your traces show that gpsbabel never receives anything in your case, so somehow something is behaving different. I am running out of ideas. Would it be possible for you to do a similar experiment with a second serial port? That way we might learn if data actually makes it to the serial output when sending or if data is received on the serial input but not forwarded to the USB bus. Another thing to try could be to use picoterm or some other terminal program to send some characters to the gps (9600N8), to see what happens, and then directly afterwards try the gpsbabel command again. If the underlying problem has to do with somekind of timing mismatch, or initialisation problem, this might help. Thanks. Groeten, Bart -- Bart Hartgers - New e-mail: bart.hartg...@gmail.com -- To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/cak7h4ydudcvb0jtvt9h1ivaes6jtxppvctkq+ad+hwmesvr...@mail.gmail.com
Bug#640391: linux-image-3.0.0-1-686-pae: ark3116 driver regression
2011/9/18 ael law_ence@ntlworld.com: On Fri, Sep 16, 2011 at 01:17:51PM +0200, Bart Hartgers wrote: [Previous messages are logged at http://bugs.debian.org/640391. I have now tested properly with debug=1. Unfortunately, the problem remains, and I can't see anything new in the messages. # rmmod ark3116; modprobe ark3116 debug=1 # uname -a Linux elf 3.0.0-1-686-pae #1 SMP Sat Aug 27 16:41:03 UTC 2011 i686 GNU/Linux Sep 18 08:56:47 elf kernel: [ 357.253199] usb 2-1: ark3116 using RS232 mode Sep 18 08:56:47 elf kernel: [ 357.253590] usb 2-1: ark3116 converter now attached to ttyUSB0 Sep 18 08:56:47 elf mtp-probe: bus: 2, device: 2 was not an MTP device Sep 18 08:56:47 elf kernel: [ 357.544206] usb 2-1: ark3116: don't know how to do software flow control Sep 18 08:56:47 elf kernel: [ 357.557194] usb 2-1: ark3116: don't know how to do software flow control Sep 18 08:56:47 elf kernel: [ 357.567194] usb 2-1: ark3116: don't know how to do software flow control Sep 18 08:56:47 elf kernel: [ 357.674193] usb 2-1: ark3116: don't know how to do software flow control Sep 18 08:57:00 elf kernel: [ 370.017895] usb 2-1: ark3116: don't know how to do software flow control Sep 18 08:57:21 elf kernel: [ 391.615318] usb 2-1: ark3116: don't know how to do software flow control Strange. The rmmod and modprobe shoudl set the debug flag, so I would expect some debug messages around the 'software flow control' stuff. Did you check the output of 'dmesg'? (The prefixes suggest these are coming through syslogd.) Perhaps the debug messages end up in a different log or something? By the way, the 'software flow control' warnings are relatively harmless. They appear when software flow control is asked for, because that cannot be done reliably without somekind of support in the hardware. But at 9600 baud that should not be a factor. Groeten, Bart -- Bart Hartgers - New e-mail: bart.hartg...@gmail.com -- To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/CAK7h4yeq-84M2ZF0msuj79Z=VaG25rjDWzwtEq5031Lntyj5=q...@mail.gmail.com
Bug#640391: linux-image-3.0.0-1-686-pae: ark3116 driver regression
2011/9/13 ael law_ence@ntlworld.com: On Tue, Sep 13, 2011 at 08:56:54PM +0200, Bart Hartgers wrote: [Previous messages are logged at http://bugs.debian.org/640391. truncated the termios data. Could you please rerun the strace with the '-v' option? Ok. Attached. Hi ael, As far as I can tell from the logs, gpsbabel does not enable handshaking. Unfortunately I do not another idea of what might be the problem. Another thing to try would be to load the ark3116 module with the debug=1 flag. Maybe something will appear in the kernel log/dmesg that gives a clue to what is going on. I'll see if I can find my ark3116 and hook it up with a null modem to try to reproduce the problem myself. But it will take a while before I can spend some time on that. Groeten, Bart -- Bart Hartgers - New e-mail: bart.hartg...@gmail.com -- To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/cak7h4yc3rcmp4r-6dzmpecbmpk9pgojcbejdijc2ad6pztk...@mail.gmail.com
Bug#640391: linux-image-3.0.0-1-686-pae: ark3116 driver regression
2011/9/11 ael law_ence@ntlworld.com: On Thu, Sep 08, 2011 at 06:33:29PM +0200, Bart Hartgers wrote: Op 8 sep. 2011 16:56 schreef Ben Hutchings b...@decadent.org.uk het volgende: [Previous messages are logged at http://bugs.debian.org/640391. tl,dr: gpsbabel times-out when trying to read through ark3116.] 2.6.32-5 (working) and 2.6.34-1 (failing). Bart, what can ael do to help debug this? I suppose an strace log of gpsbabel under Linux 3.0 would be helpful? Hi Ben, ael, I am reading this on my phone and will not be able to look into this properly (ie access a computer) before next week. In the mean time: strace logs would be very useful. And maybe the problen has to do with the new driver doing real handshaking while the old one effectively ignored hs signals iirc. strace log attached. I didn't set any special switches, but I think it captures the necessary. I did think of truncating the very long tail of timeouts (the file is 291K long), but decided I had better let it stand. Hi ael, Thanks for the strace. It seems that gpsbabel is treating the device as a tty and not just a plain file. My main suspect is still a problem with the cts/rts handshaking. Unfortunately, I cannot tell what exactly gpsbabel does to the handshake signals because strace truncated the termios data. Could you please rerun the strace with the '-v' option? You do not have to send the full log, just this part (lines 69-74) open(/dev/ttyUSB0, O_RDWR)= 3 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 opost isig icanon echo ...}) = 0 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 opost isig icanon echo ...}) = 0 ioctl(3, SNDCTL_TMR_CONTINUE or TCSETSF, {B9600 -opost -isig -icanon -echo ...}) = 0 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 -opost -isig -icanon -echo ...}) = 0 ioctl(3, TCFLSH, 0x2) = 0 Also the output of 'stty -a /dev/ttyUSB0' might give a clue. Thanks. Groeten, Bart -- Bart Hartgers - New e-mail: bart.hartg...@gmail.com -- To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/cak7h4ydzkdnoufyknfbbamvbd7bvfapaq_y0tcdplhkjth2...@mail.gmail.com
Bug#640391: linux-image-3.0.0-1-686-pae: ark3116 driver regression
Op 8 sep. 2011 16:56 schreef Ben Hutchings b...@decadent.org.uk het volgende: [Previous messages are logged at http://bugs.debian.org/640391. tl,dr: gpsbabel times-out when trying to read through ark3116.] On Thu, 2011-09-08 at 14:08 +0100, ael wrote: On Tue, Sep 06, 2011 at 04:16:11AM +0100, Ben Hutchings wrote: Regression in the ark3116 (perhaps interaction with usbserial). available from http://snapshot.debian.org/package/linux-2.6/) to Probably the most useful one to test would be: http://snapshot.debian.org/package/linux-2.6/2.6.34-1~experimental.2/ I just checked in snapshot.debian.org/package/linux-2.6/ and I can't see any kernel to test between 2.6.32-5 (working) and 2.6.34-1 (failing). Is there any point in alerting upstream, presumably Bart Hartgers bart.hartgers+ark3...@gmail.com, to this bug report, or is he already aware? Right, the changes between 2.6.32 and 2.6.34 were mostly made by Bart. I asked you to test 2.6.34 in order to find out whether the regression was likely to be related to these or to later changes by other developers. I doubt that it is a debian specific bug... Indeed, probably not. Bart, what can ael do to help debug this? I suppose an strace log of gpsbabel under Linux 3.0 would be helpful? Hi Ben, ael, I am reading this on my phone and will not be able to look into this properly (ie access a computer) before next week. In the mean time: strace logs would be very useful. And maybe the problen has to do with the new driver doing real handshaking while the old one effectively ignored hs signals iirc. Groeten, Bart Ben. -- Ben Hutchings I say we take off; nuke the site from orbit. It's the only way to be sure.