3 ms·
> Also USB bus resets are not unheard of. They're initiated by the host, not by a USB device. > Or moving devices from one port to another. If the device come
by vardump 8y ago
> Also USB bus resets are not unheard of.
They're initiated by the host, not by a USB device.
> Or moving devices from one port to another. If the device comes back within a minute or two you probably shouldn't throw out those writes.
This would be a nice feature. Although these writes would need to be buffered. Probably also throttled. There'd also be some risk with devices that have identical serial numbers. Some manufacturers give all of their USB disks / memory sticks same serial number...
- derefr 8y ago> There'd also be some risk with devices that have identical serial numbers. Some manufacturers give all of their USB disks / memory sticks same serial number... On most OSes the HW serial number of the disk is now usually supplemented in the disk management logic with the GPT “Disk GUID”, if available. Most modern disks (including removable ones like USB sticks) are GPT-formatted, since they rely on filesystems like ExFAT that assume GPT formatting. And those that aren’t are effectively already on a “legacy mode” code-path (because they’re using file systems like FAT, which also doesn’t support xattrs, or many types of filenames, or disk labels containing lower-case letters...) so users already expect an incomplete feature-set from them. Plus: SD cards, the main MBR devices still in existence, don’t even get write-buffered by any sensible OS to begin with, precisely because you’re likely to unplug them at random. So, in practice, everything that needs write-buffering (and will ever be plugged into a computer running a modern OS) does indeed have a unique disk label at some level.
- Dylan16807 8y ago> They're initiated by the host, not by a USB device. Or by a power flicker. Which can be caused by plugging in other devices too. > Although these writes would need to be buffered. Probably also throttled. You don't necessarily have to allow new writes, the more important part is preserving writes the application thinks already happened. But that could be useful too. > Some manufacturers give all of their USB disks / memory sticks same serial number... You have the partition serial number too, usually.
- vardump 8y ago> Or by a power flicker. Which can be caused by plugging in other devices too. That sounds pretty unlikely. Any references about this? The pulse needs to be pretty particular and the USB device needs to be powered.
- Dylan16807 8y agoPersonal experience, so not really. And it doesn't have to be very particular. Bad grounding can cause lots of ports to reset.
- vardump 8y agoSounds intentional, probably something sent by the USB host controller driver. I guess some hub chips might send it independently as well in some scenarios. USB bus resets (both D+ and D- down for 10ms) are a signal for the USB device software (well, firmware) to initialize device configuration. Basically to set configuration, data toggles and stalls to their defaults. (I've written USB device firmware.)
- Dylan16807 8y agoWell yes it's an intentional recovery from an error state, but the point is this can happen unexpectedly.