4 ms·
I really wonder why a $10 capacitor add-on (a capacitor, a diode, two connectors) plugged in between main board power supply and a disk power receptacle is not
by nine_k 9y ago
I really wonder why a $10 capacitor add-on (a capacitor, a diode, two connectors) plugged in between main board power supply and a disk power receptacle is not a common item.
Or maybe it is, but I have no idea?
- marshray 9y agoA common minimum voltage requirement for the nominal +5V supply is 4.5 V. Let's assume a voltage below that won't damage the drive, but it won't operate. The diode is going to drop 0.6V, leaving you with only 4.4 V max for the drive. Then the capacitor is going to immediately start dropping in voltage as soon as you start pulling the stored energy out of it. So, in practice, to do a quality job of this it will probably need a DC-DC converter. These aren't necessarily expensive, but definitely more complicated than the old diode trick.
- nine_k 9y agoThis makes sense! OTOH low-drop diodes do exist [1], and the drive likely needs just a (small) fraction of a second to flush the caches; it's SSD, not need to wait for the disk to rotate to the right position or move heads. I suppose the power loss signal from the controller still propagates, even if the computer's PSU plug is just yanked out of socket. [1]: https://electronics.stackexchange.com/a/282471/9909 https://electronics.stackexchange.com/a/282471/9909
- jotux 9y agoI implemented a power-loss circuit on a custom USB memory device (battery-backed LPDDR disks) and used something similar: the MAX40200[1]. [1]https://www.maximintegrated.com/en/products/analog/amplifiers/MAX40200.html https://www.maximintegrated.com/en/products/analog/amplifier...
- londons_explore 9y agoThe caches on some SSD's can be multiple gigabytes. They also frequently cache data which can be difficult (slow) to write, for example a single modified 4kb page which is part of a large unmodified area. Completing that write would involve reading the original data, erasing the entire erase-block, and rewriting the new data. SSD's with built in power loss prevention typically reserve an area on the SSD which is pre-erased ready to dump the contents of the cache into. Then on powerup, they reload the cache and properly flush the data to the actual place it's supposed to be.
- jotux 9y agoYou also need to limit in-rush current without dropping that voltage and account for capacitor degradation over the life of the device.
- pkaye 9y agoI worked on SSD power loss implementation in the past. You also need a signal into the controller indicating power failed. At this point the controller will minimally stop all less critical tasks, prioritize the buffered user data to be written and make sure the FFS is in consistent state for recovery.
- 21 9y agoDesktop power supplies already have that, they can keep the power on for 50-100 ms or so, and they do notify the OS about the imminent power loss. I'm not sure what OSes do with that.
- gsich 9y agoHow do they notify?
- londons_explore 9y agoATX power supplies have a PWR_OK pin, which goes low when power is lost. Most motherboards don't report that to the OS though, instead they simply reset all the hardware. To be fair, it's probably preferable to reset stuff than to operate when the power supply isn't healthy, since that will lead to a lot of weird undefined behaviour.