Bug 143408 - cdc-acm OOPSES with SuSE 10.0 and Samsung mobile phone.
Summary: cdc-acm OOPSES with SuSE 10.0 and Samsung mobile phone.
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Kernel (show other bugs)
Version: Final
Hardware: 32bit SuSE Linux 10.0
: P5 - None : Major
Target Milestone: ---
Assignee: Vojtech Pavlik
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-16 18:25 UTC by Wolfgang Glas
Modified: 2006-02-22 05:41 UTC (History)
0 users

See Also:
Found By: Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
dmesg of cdc-acm kernel oops. (27.22 KB, text/plain)
2006-01-16 18:28 UTC, Wolfgang Glas
Details
output of hwinfo with my Samsung phone plugged in. (206.24 KB, text/plain)
2006-01-17 07:59 UTC, Wolfgang Glas
Details
Yet another OOPS with cdc-acm. (124.25 KB, text/plain)
2006-01-19 10:31 UTC, Wolfgang Glas
Details
Yet, yet another OOPS with my Samsung phone ()swsusp related). (27.78 KB, text/plain)
2006-01-19 13:45 UTC, Wolfgang Glas
Details
output of 'strace wvdial' (14.29 KB, text/plain)
2006-01-19 13:56 UTC, Wolfgang Glas
Details
strace of wvdial of a working wvdial session under Debian sarge. (45.07 KB, text/plain)
2006-01-19 17:44 UTC, Wolfgang Glas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Glas 2006-01-16 18:25:40 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
Comment 1 Wolfgang Glas 2006-01-16 18:28:48 UTC
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
Comment 2 Greg Kroah-Hartman 2006-01-16 18:45:28 UTC
Can you attach the output of 'hwinfo' with your phone plugged into the machine?
Comment 3 Wolfgang Glas 2006-01-17 07:59:48 UTC
Created attachment 63521 [details]
output of hwinfo with my Samsung phone plugged in.
Comment 5 Forgotten User ZhJd0F0L3x 2006-01-17 11:06:24 UTC
JFTR: cdc-acm is working on other hardware for me.
Comment 6 Vojtech Pavlik 2006-01-17 15:49:58 UTC
No oopses on disconnect, Stefan?
Comment 7 Vojtech Pavlik 2006-01-17 15:52:44 UTC
Wolfgang, is the oops repeatable?
Comment 8 Forgotten User ZhJd0F0L3x 2006-01-17 16:36:54 UTC
(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
Comment 9 Vojtech Pavlik 2006-01-17 16:58:25 UTC
I wanted to say rmmod of course. With the device plugged in.
Comment 10 Forgotten User ZhJd0F0L3x 2006-01-17 17:03:35 UTC
that's what i tried first, after that i tried disconnect without rmmod. Both worked for me.
Comment 11 Vojtech Pavlik 2006-01-19 10:01:13 UTC
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.
Comment 12 Wolfgang Glas 2006-01-19 10:31:49 UTC
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.
Comment 13 Vojtech Pavlik 2006-01-19 11:44:38 UTC
Interesting. This one oopses at a different place, again with a nonsensical
pointer.
Comment 14 Forgotten User ZhJd0F0L3x 2006-01-19 13:25:10 UTC
see bug#144041 - don't know if it is a duplicate.
Comment 15 Wolfgang Glas 2006-01-19 13:45:53 UTC
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.
Comment 16 Wolfgang Glas 2006-01-19 13:56:04 UTC
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.
Comment 17 Vojtech Pavlik 2006-01-19 14:27:16 UTC
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. 
Comment 18 Forgotten User ZhJd0F0L3x 2006-01-19 14:55:11 UTC
(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.
Comment 19 Forgotten User ZhJd0F0L3x 2006-01-19 14:55:58 UTC
what we do during suspend is unloading uhci-hcd. Maybe cdc-acm does not like to get the hostcontroller pulled out under its feet?
Comment 20 Forgotten User ZhJd0F0L3x 2006-01-19 14:59:06 UTC
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.
Comment 21 Wolfgang Glas 2006-01-19 15:02:48 UTC
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.
Comment 22 Forgotten User ZhJd0F0L3x 2006-01-19 15:41:55 UTC
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
Comment 23 Wolfgang Glas 2006-01-19 16:23:51 UTC
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.
Comment 24 Forgotten User ZhJd0F0L3x 2006-01-19 16:28:25 UTC
wvdial has obviously no problem with the mission ioctl, so there is no urgent need to try all this.
Comment 25 Wolfgang Glas 2006-01-19 17:44:35 UTC
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.
Comment 26 Greg Kroah-Hartman 2006-01-19 18:01:48 UTC
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.
Comment 27 Wolfgang Glas 2006-01-19 22:03:05 UTC
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
Comment 28 Wolfgang Glas 2006-01-20 14:57:25 UTC
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.
Comment 29 Vojtech Pavlik 2006-02-07 12:49:57 UTC
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.
Comment 30 Wolfgang Glas 2006-02-07 17:12:59 UTC
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.
Comment 31 Wolfgang Glas 2006-02-07 17:29:27 UTC
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
Comment 32 Wolfgang Glas 2006-02-14 08:20:25 UTC
Just one short question: Is this patch included in the recent kernel update 2.6.13-15.8 ?

  TIA, Wolfgang
Comment 33 Greg Kroah-Hartman 2006-02-22 05:41:48 UTC
No, I do not think so.