Hi, On Mon, Feb 08, 2010 at 04:19:55PM -0600, X Zhang wrote: > The issue I have is: > If I start a program which open the port of /dev/ttyUSB1 and > /dev/ttyUSB2 and then suspend PC (s2ram --force) and resume, I will > see > /dev/ttyUSB0 > /dev/ttyUSB3 instead of /dev/ttyUSB1 > /dev/ttyUSB4 instead of /dev/ttyUSB2 > > I didn't close /dev/ttyUSB1 and /dev/ttyUSB2 before PC suspend and my > goal is NOT to close these ports before suspend and, of course, keep > the port communication work after resume. . . . > So I think I still need to work on the driver. > > I noticed drivers/usb/serial/generic.c doesn't have suspend and resume > function. so I added as below. > static struct usb_driver generic_driver = { > .name = "usbserial_generic", > .probe = generic_probe, > .disconnect = usb_serial_disconnect, > .id_table = generic_serial_ids, > .suspend = usb_serial_suspend, ==> call usb-serial.c's > usb_serial_suspend > .resume = usb_serial_resume, ==> call usb-serial.c's > usb_serial_resume > .no_dynamic_id = 1, > }; > > But still no luck. The result is the same. Definitely sounds like you want to implement .reset_resume. These links should help: . http://www.mjmwired.net/kernel/Documentation/usb/power-management.txt . reset_resume http://www.mail-archive.com/linux-usb-devel@xxxxxxxxxxxxxxxxxxxxx/msg55788.html . http://www.opensubscriber.com/message/linux-usb-devel@xxxxxxxxxxxxxxxxxxxxx/7178380.html . http://osdir.com/ml/linux.bluez.kernel/2008-09/msg00002.html . http://marc.info/?l=linux-usb&m=121483894201937&w=2 . http://marc.info/?l=linux-usb&m=126020789127192&w=2 (guess why I had all these links ready for perusal? Right, ftdi_sio is waiting for the same thing to happen) And indeed, it's annoying as hell. ;) > I badly need instruction on this issue! Really appreciate if you could > provide any advice! HTH, Andreas Mohr -- 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