From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Simon Slavin
> > That's the usual scenario with spinning media.  I'm less familiar with the
> > internal workings of flash memory controllers.  But people tell me that they
> > fail in similar ways.
>
> Yes yes and yes.  With normal settings set, SSD storage controllers lie to 
> the OS in the same way:
> once it has accepted the new write commands it
> acknowledges them as written immediately rather than saying "Hold on while I 
> do that.".
>
> Most bulk storage devices apart from the cheapest do have pin settings 
> (or tiny switches, or some hardware equivalent) which defeat this.  
> That makes them act properly and not acknowledge writes until the data really 
> has been written.  
> However, you would not want to use storage set up this way as the boot drive 
> for a computer.  

I've downloaded eMMC spec from www.jedec.org and it's very interesting:

JESD84-A441
ยง 7.6.7
In general, an interruption to a write process should not cause corruption in 
existing data at any other
address. However, the risk of power being removed during a write operation is 
different in different
applications. Also, for some technologies used to implement e.MMC, there is a 
tradeoff between
protecting existing data (e.g., data written by the previous completed write 
operations), during a power
failure, and write performance. When the write data reliability parameters 
(WR_DATA_REL_USR,
WR_DATA_REL_1, WR_DATA_REL_2, WR_DATA_REL_3 and WR_DATA_REL_4) in EXT_CSD
(WR_REL_SET) are set to 1 it will indicate to the host that the write mechanism 
in the associated partition
has been implemented to protect existing data in that partition. This means 
that once a device indicates to
the host that a write has successfully completed, the data that was written, 
along with all previous data
written, cannot be corrupted by other operations that are host initiated, 
controller initiated or accidental. A
value of 0 for these bits will indicate that there is some risk to previously 
written data in those partitions if
power is removed.

Reliable Write: Multiple block write with pre-defined block count and Reliable 
Write parameters. This
transaction is similar to the basic pre-defined multiple-block write (defined 
in previous bullet) with the
following exceptions. The old data pointed to by a logical address must remain 
unchanged until the
new data written to same logical address has been successfully programmed. This 
is to ensure that the
target address updated by the reliable write transaction never contains 
undefined data. Data must
remain valid even if a sudden power loss occurs during the programming.

I will check what is implemented in our driver.
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to