On Tuesday, January 29, 2013 03:45:28 PM Martin Mokrejs wrote: > Hi, > > Paul Bolle wrote: > > On Tue, 2013-01-29 at 12:35 +0100, Rafael J. Wysocki wrote: > >> On Tuesday, January 29, 2013 11:35:32 AM Paul Bolle wrote: > >>> Thanks. So should the fix here be to actually suspend and remove this > >>> device? (Note that pciehp_suspend() is now basically a NOP.) > >> > >> I think it wouldn't be useful to remove devices on all suspends, but then there > >> are a few different situations that resume has to consider and handle correctly: > >> > >> 1) Device has been removed while suspended. > >> 2) Device was present before suspend and is still there. > >> 3) Device has been added while suspended. > > > > Obviously, I care about situation 2) here. (It would be quite a feat to > > remove or add a wireless card while the laptop is suspended.) > > I don't use suspend on my laptop to avoid possible problems with crashes > and data loss (so I rather quit my apps and shutdown). Therefore I have no > experience with that ... but it is my impression that the obvious use is to > close the lid, unplug an external mouse/keyboard and go elsewhere, maybe > re-plug the mouse/keyboard into different slots (hey, I can't remember > whether I had mouse in this or the other socket) and open the lid. Even > being unintentionally nasty to the OS and re-plugging the devices after > I opened the laptop lid! I understand one is in all these scenarios just > doing the bad thing and just asking for a trouble ... but that's why I > don't use that feature. My memory is leaky and my behavior is error-prone > so I am sure once I would screw the order. Maybe OS could force disconnect of all > external devices which are reasonably safe (mouse and keyboard while not > say external USB drive)? > > Nevertheless, is it possible to have an external drive connection preserved > through suspend so that it survives under same device id? I don't know if this > a possible at all ... If not, then OS could could unplug even external drives. This is possible for PCI devices. The IDs won't change if the device is plugged in all the time. Moreover, in some cases there's no way to tell the difference between "internal" and "external". The OS just has to handle all of the possible situations during resume correctly. If it doesn't, then there is a bug that needs to be fixed. And avoiding a given feature just because you're scared of it doesn't lead to any progress. If you instead use it and report problems with it, then chances are those problems will be addressed over time. I use suspend all the time and it works for me. I don't have any PCIe hotplug devices, though, so any information on whether or not it works for people is quite valuable to me. I'll have a look at the pciehp driver's resume, but that's going to take some time. Thanks, Rafael -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center. -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html