On Sun, 8 Aug 2010, Oliver Neukum wrote: > > To avoid these problems, I changed sd to make it autosuspend only when > > the device file is closed _and_ there is no medium present. The patch > > below is just a proof-of-principle; in the end we'll want something > > more flexible. Maybe a sysfs attribute to select the conditions under > > which autosuspend is allowed. > > > > What do you think? > > I agree in principle. But I don't think you can depend on sdkp->media_present > remaining constant between sd_open() and sd_release() It doesn't have to remain constant then -- it only has to remain constant between sd_release and sd_open (which of course it will, since the driver won't learn about media changes if the device file isn't open). The real requirement is that sdkp->media_present doesn't change while the device is suspended, which should always hold. Alan Stern -- 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