> Date: Sun, 9 Jul 2017 14:12:34 +0200 (CEST) > From: Stefan Fritsch <s...@sfritsch.de> > > Hi, > > there are some open issues that usb devices do not flush their caches fast > enough (at least on some boards). And my mail about shortening the wait > times in reboot(8) brought up that issue again. > > My suggestion would be to have a global variable that takes the minimum > delay for the next shutdown/reboot and affected devices could set that > value in their DVACT_SUSPEND hook. That way, if a device is removed before > the shudown, the delay won't trigger. > > The diff below is only compile tested by I think it demonstrates the idea. > > One could also do something more fancy like using different delays for > reboot and powerdown, or making umass only set a new SDEV_ flag and then > have the scsi layer only call set_powerdown_delay() if the device has been > written to. > > Opinions?
Such devices should make sure they flush their caches and properly wait for that operation to complete.