Bugzilla – Bug 143408
cdc-acm OOPSES with SuSE 10.0 and Samsung mobile phone.
Last modified: 2006-02-22 05:41:48 UTC
I'm using SuSE 10.0 with the recent kernel update 2.6.13-15.7 and a Samsung mobile phone type 'SGH-Z500'. When plug this phone to my USB 1.1 port, various issues occur: 1) visor driver is loaded. This driver supposedly should enable (Palm-OS like ?) synchronization facilities, but unfortunately this driver is unable to deal with my phone. I get an error message like 'ttyUSB0: The port number lies above the number of ports' in dmesg. 2) wvdial cannot get serial information from cdc_acm. When IS completely remove the visor-module, I end up with cdc_acm loadded by the hotplugging system and I have /dev/ttyACM0 avaiable. When I use this device with wvdial, I get the following error message: ttyACM0: Cannot get information for serial port. 3) Kernel OOPS when removing the cdc_acm module: Finally, I tried to remove the cdc_acm module and I got a kernel OOPS, which is attached to this message. TIA for any help and best regards, Wolfgang
Created attachment 63509 [details] dmesg of cdc-acm kernel oops. This is the dmesg ouput. BTW, my handy is working well with Debain Sarge 3.1 and kernel-2.6.11-1-686
Can you attach the output of 'hwinfo' with your phone plugged into the machine?
Created attachment 63521 [details] output of hwinfo with my Samsung phone plugged in.
JFTR: cdc-acm is working on other hardware for me.
No oopses on disconnect, Stefan?
Wolfgang, is the oops repeatable?
(In reply to comment #6) > No oopses on disconnect, Stefan? no. plugging in and after that rmmod cdc-acm: usb 2-2: new full speed USB device using uhci_hcd and address 2 cdc_acm 2-2:1.1: ttyACM0: USB ACM device cdc_acm 2-2:1.3: ttyACM1: USB ACM device usbcore: registered new driver cdc_acm drivers/usb/class/cdc-acm.c: v0.23:USB Abstract Control Model driver for USB modems and ISDN adapters usbcore: deregistering driver cdc_acm now "modprobe cdc-acm" and disconnecting the device: cdc_acm 2-2:1.1: ttyACM0: USB ACM device cdc_acm 2-2:1.3: ttyACM1: USB ACM device usbcore: registered new driver cdc_acm drivers/usb/class/cdc-acm.c: v0.23:USB Abstract Control Model driver for USB modems and ISDN adapters usb 2-2: USB disconnect, address 2 no oops. I am pretty sure that i would have noticed any problems with this. Hardware is a sony-ericsson k600i. susi:~ # uname -a Linux susi 2.6.13-SL100_BRANCH_20051213150629-default #1 Tue Dec 13 15:06:29 UTC 2005 i686 i686 i386 GNU/Linux
I wanted to say rmmod of course. With the device plugged in.
that's what i tried first, after that i tried disconnect without rmmod. Both worked for me.
I need to know if the oops can be reproduced with the phone. If yes, I'll make a patch to see what part of the URB/bus struct got corrupted and cause the oops.
Created attachment 63944 [details] Yet another OOPS with cdc-acm. Sorry for the delay, but now I had good luck in reproducing the OOPS. I had to plugin the phone, call wvdial, unplug the phone several times (5 or 6, just look in the dmesg-file...) and afterward I had to rmmod the cdc-acm module with the phone plugged in.
Interesting. This one oopses at a different place, again with a nonsensical pointer.
see bug#144041 - don't know if it is a duplicate.
Created attachment 64005 [details] Yet, yet another OOPS with my Samsung phone ()swsusp related). The OOPS I observe is definitely swsups-related. I tried to reproduce the oops with my feeshly booted laptop and had no chance to reproduce it. Then I suspended (to disk) the laptop with my phone plugged in and the cdc-acm module loaded. After resuming the laptop with the same configuration I observe the attached OOPS. Supposedly, all my other OOPSES have occurred after a suspend-to-disk, because I suspend laptop twice a day.
Created attachment 64009 [details] output of 'strace wvdial' Nevertheless, the problem which bothers me most is the problem, that I can't use my phone as a modem, which is unrelated to swsusp. The attached file is strace of wvdial, which has been produced after a fresh reboot of my lpatop and my Samsung phone. You see, that the TIOCGSERIAL-ioctl call fails wwith EINVAL.
Well, TIOCGSERIAL simply never has been implemented for ACM. It's an optional ioctl, and it's sad that wvdial now requires it. It shouldn't be too hard to add it. The fact that the oops happens only after suspend means the problem doesn't necessarily have to be in the acm driver itself.
(In reply to comment #17) > Well, TIOCGSERIAL simply never has been implemented for ACM. It's an optional > ioctl, and it's sad that wvdial now requires it. It shouldn't be too hard to > add it. wvdial seems not to require it. I just dialled in via cdc-acm: Jan 19 15:53:27 strolchi wvdial[5228]: PPP negotiation detected. Jan 19 15:53:27 strolchi pppd[5222]: Serial connection established. Jan 19 15:53:27 strolchi pppd[5222]: Renamed interface ppp0 to modem0 Jan 19 15:53:27 strolchi pppd[5222]: Using interface modem0 Jan 19 15:53:27 strolchi pppd[5222]: Connect: modemU <--> /dev/ttyACM0 Jan 19 15:53:28 strolchi pppd[5222]: Remote message: Congratulations! > The fact that the oops happens only after suspend means the problem doesn't > necessarily have to be in the acm driver itself. I use cdc-acm less frequent than bluetooth, so i cannot comment on this, sorry.
what we do during suspend is unloading uhci-hcd. Maybe cdc-acm does not like to get the hostcontroller pulled out under its feet?
i unloaded uhci-hcd, then reloaded it, then disconnected / reconnected the phone, unloaded / reloaded cdc-acm, etc.pp. No oopsen for me. It even still works ;-) Excuse the lots of small comments, but since i expected the machine to crash, i wanted to "save my data" first.
Well Stefan, could you then please run 'strece wvdial' with a working modem connection via cdc_acm. This way wee can prove, whether wvdial really needs TIOCGSERIAL. Then, Vojtech could communicate with the wvdial developers on when and how wvdial needs the info returned by TIOCGSERIAL, if he doesn'd mind.
i have no idea on how to use wvdial, i just use kinternet/smpppd which in turn seems to use wvdial. wvdial alone fails spectacularly for me: seife@strolchi:~> wvdial --> WvDial: Internet dialer version 1.54.0 --> Cannot open /dev/modem: No such file or directory --> Cannot open /dev/modem: No such file or directory --> Cannot open /dev/modem: No such file or directory
wvdial uses a simple config file (default location /etc/wvdial.conf). You could dial up using kinternet and when the connection is open, try to find the command line of wvdial using ps -ef | grep wvdial You should end up with sth like 'wvdial --config /some/path'. Afterwards, enter the retrieved command line together with strace just like in 'strace wvdial --config /some/path' If the config file of kinternet is remvoed after connection is closed, try to copy the autogenerated config file to an appropriate path.
wvdial has obviously no problem with the mission ioctl, so there is no urgent need to try all this.
Created attachment 64070 [details] strace of wvdial of a working wvdial session under Debian sarge. This is an strace of a working cdc_acm Modem connection using debian sarge. This is just here in order to illustrate, that even here the TIOCGSERIAL ioctl is issued and fails too. The difference is, that debian's wvdial does ignore this problem and continues with the dialup, wereas under SuSE 10.0 wvdial quits after this error. So supposedly my bug report falls into 2 parts: 1) Misunderstandings between wvdial and cdc_acm about the significance of the TIOCGSERIAL ioctl. Here I'd kindly ask Voijtech and the wvdial developers to discuss the topic and to sort out, whether wvdial should ignore TIOCGSERIAL problems or cdc_acm should have this ioctl implemented. 2) Kernel oopes with cdc_acm after suspend-to-disk This is the harder part to fix. Maybe we can find a solution here in the long run. In the meanwhile I have to remove the USB modules before software suspend as a workaround.
This patch: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=83ef344a7539aa55a787790bc036f0bf3466e191 might fix problem 2 in comment #25 if someone could try it out.
BTW, I can now use my phone as a modem by using smppd and kinternet ;-) These tools call wvdial in a way, that the TIOCGSERIAL ioctl call is not issued. Thanks for any help so far. Nevertheless, I'd be very happy, if the OOPSES with swsusp could be resolved. TIA, Wolfgang
Concerning comment #26 of Greg Kroah-Hartman: I had a look at the patch, but as far as I can judge, this patch is already part of my SuSE-kernel 2.6.13-15.7 (Just look a the newly introduced function acm_tty_unregister...) The patch is dated from June 2005 and obviously has been integrated in the kernel mainline after 2.6.13rc3.
This patch: http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/usb/usb-fix-oops-in-acm-disconnect.patch may fix your problem. Please try it. See bug #144041 for more info.
The patch seems alright to me the system did survive several rmmod/modprobe cycles as well as a software suspend. Please note, that I have cdc_acm listed in UNLOAD_MODULES_BEFORE_SUSPEND2DISK inside /etc/sysconfig/powersave/sleep, but not uhci_hcd. I could try to keep the module loaded during software suspend, if you like to do me so. Nevertheless the patch is an improvement compared to 2.6.13-15.7 and I think it is worth be included with the next SuSE kernel update.
FYI, I just suspended my laptop twice with cdc_acm being loaded during supend/resume (I temp. removed cdc_acm from UNLOAD_MODULES_BEFORE_SUSPEND2DISK). Everything is running fine after this experiment, so please apply this path upstream ;-) Thanks for your help, Wolfgang
Just one short question: Is this patch included in the recent kernel update 2.6.13-15.8 ? TIA, Wolfgang
No, I do not think so.