From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen)
To: linux@horizon.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: Sync option destroys flash!
Date: Wed, 18 May 2005 09:37:41 -0400 [thread overview]
Message-ID: <20050518133741.GS23488@csclub.uwaterloo.ca> (raw)
In-Reply-To: <20050517203117.10588.qmail@science.horizon.com>
On Tue, May 17, 2005 at 08:31:17PM -0000, linux@horizon.com wrote:
> Gee, that just happened to me! Well, actually, thanks to Linux's
> *insistence* on reading the partition table, I haven't managed to
> get I/O errors on anything bit sectors 0 through 7, but I am quite
> sure I wasn't writing those sectors when I pulled the plug:
>
> hda: read_intr: status=0x51 { DriveReady SeekComplete Error }
> hda: read_intr: error=0x10 { SectorIdNotFound }, LBAsect=6, sector=6
> hda: read_intr: status=0x51 { DriveReady SeekComplete Error }
> hda: read_intr: error=0x10 { SectorIdNotFound }, LBAsect=6, sector=6
> hda: read_intr: status=0x51 { DriveReady SeekComplete Error }
> hda: read_intr: error=0x10 { SectorIdNotFound }, LBAsect=6, sector=6
> hda: read_intr: status=0x51 { DriveReady SeekComplete Error }
> hda: read_intr: error=0x10 { SectorIdNotFound }, LBAsect=6, sector=6
> ide0: reset: success
> hda: read_intr: status=0x51 { DriveReady SeekComplete Error }
> hda: read_intr: error=0x10 { SectorIdNotFound }, LBAsect=6, sector=6
> end_request: I/O error, dev 03:00 (hda), sector 6
> unable to read partition table
Yeah that is exactly how it responds after a powerloss during write when
you have no protection against that.
> > The binary industrial grade CF cards (no longer in
> > production) had capacitors to be able to finish writing the block they
> > were doing to prevent problems.
>
> Er... are you talking about the SanDisk SDCFI or SDCFJ series?
> If they told me, I'd specify them instantly...
The model with the capacitors was the SDCFBI-size-201-80, but they are no
longer available for purchase (we were going to use them and are now
trying a few other brands). The -80 Meant industrial grade which was
the flash with capacitors to keep power failures from killing a write
in progress. None of our tests have killed a -80 yet. The -00 we have
killed by have power off during writes. They were also rated at 3 times
the write cycles of their regular grade.
We were told the new cards that they offer to OEMs have new firmware
that does some kind of journaling or timestamping or something to deal
with the problem instead. I haven't tried the new cards and given they
don't offer the needed temperature range we need, I won't be trying them
either.
> > Supposedly their new firmware now will have a rollback system so that any
> > partial write is just added back to the free pool. I had thought this
> > was always how they did it, but no apparently that is also something new.
>
> Indeed; I'm in a fix right now because this seemed to thunderingly obvious
> to me I didn't check carefully before committing to a CF-based design.
>
> > We were told by SanDisk when we asked about a dead card (it had power
> > loss during a write) and was told that is normal for the regular
> > multicell flash cards. They told us the firmware in the generation of
> > cards they are currently launching does not have a problem with that
> > anymore since it essentially journals the writes and can roll back a
> > partial block write.
>
> You wouldn't happen to know what devices those are, would you?
> The SDCFH "Ultra II" series, maybe?
Anything sold retail is anyone's guess (according to their rep) while
OEM cards you get what it says on the card. The retail cards don't
carry the same model numbers either. A retail sandisk card might not
even contain sandisk memory (only the controller is sure to be sandisk).
> I'm talking to them now, so perhaps I'll learn. As I said, since it
> specifically does out-of-place writes, a two-phase commit is
> startlingly easy to do. The basic procedure is:
>
> - For those who don't know, Flash memory technology can only be "erased"
> to all 1 bits large blocks, but can be "programmed" to 0 bits on
> a bit-by-bit basis. Also, high-density NAND flash often has bad bits,
> so ECC is required.
> - All High-density NAND flash has 512+16=528-byte sectors. The 16 bytes
> are a label area for ECC and information to identify the 512-byte payload.
> - If a write is interrupted, it's possible that the affected bit will
> read unreliably.
> - Reserve three bits (possibly each implemented with multiple physical
> bits for redundancy in the face of errors). They mean, respectively:
> - "This sector has started being programmed",
> - "This sector has finished being programmed and its contents are valid", and
> - "This sector contains stale data and should be erased".
>
> To execute a new write,
> - Choose an erased sector (or erase an unused sector if your pool of
> pre-erased sectors has been used up).
> - (Verify that the sector truly is erased. If it's not, program the
> "stale data; to be erased" bits and go back to step 1.)
> - Program the "write starting bit". This is important so that it is
> possible to tell that the sector is no longer clear without having
> to check the entire data area. Which is important when building the
> initial list of erased sectors when booting.
> - Program the data, ECC bits, etc.
> - (Verify the data was written properly. Flash memory wears out
> eventually, so bad blocks may develop during operation.)
> - Program the "finished programming bit".
> - Program the stale-data bits of the previous version of the sector.
>
> When booting, read all the label areas and build the initial
> logical/physical sector map.
>
> If you find one for which the "started programming" bit is set but the
> "finished programming" one is not, read it and verify the checksums.
> If all looks well, re-program the sector (to make sure there aren't
> any half-programmed bits) and program the "finished programming" bit.
> (This is required in case the finished programming bit was half-programmed
> when power was lost; if you don't do it, it's possible that *this* time
> you felt sure the sector wasn't finished but the next time the card is
> booted, the bit *will* read as programmed, resulting in a confused user.)
>
> Also find the pervious version of the same sector and program its
> stale bits. You need at least a 3-state sequence number to do this,
> but that's not a requirement created by atomic writing.
>
> If, on the other hand, reading the payload produces a CRC error, program
> the "stale & to be erased" bit.
Well I suspect that is along the lines of what the sandisk 201 series'
replacement is doing in it's firmware.
The new ones must be either SDCFH or SDCFJ but I can't find anything
that says what the difference is between the two lines. We were using
the SDCFBI-*-80 cards.
> Well, I can make do. If you *are* talking about SDCFI or SDCFJ, they're
> still for sale at
> https://www.californiapc.com/products/sdflash_industrial.php3
> at least...
Well we were told last buy was about a week or two ago on the
SDCFBI-*-201-80 cards. We are now playing with SLCF*JI cards from
SimpleTech and hopefully those will work out for us. It sure is hard to
do indurstrial temperature when most people don't care. Most companies
are happy to avoid the trouble since normal temperature suits 99% of the
market, so why bother with the trouble for the last 1% even if they are
willing to pay double. :)
Len Sorensen
next prev parent reply other threads:[~2005-05-18 13:38 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-14 2:43 linux
2005-05-17 13:36 ` Lennart Sorensen
2005-05-17 20:31 ` linux
2005-05-17 20:43 ` Richard B. Johnson
2005-05-18 21:08 ` Sync option destroys flash! Now I'm confused Michael H. Warfield
2005-05-19 12:50 ` Richard B. Johnson
2005-05-18 13:37 ` Lennart Sorensen [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-05-18 11:13 Sync option destroys flash! linux
2005-05-18 12:01 ` Richard B. Johnson
[not found] <43UT5-jT-3@gated-at.bofh.it>
2005-05-14 4:34 ` Robert Hancock
[not found] <43Ldl-NM-25@gated-at.bofh.it>
[not found] ` <43M9s-1B8-39@gated-at.bofh.it>
[not found] ` <43MCx-1UF-27@gated-at.bofh.it>
[not found] ` <43MVz-2hL-1@gated-at.bofh.it>
2005-05-13 23:59 ` Robert Hancock
2005-05-13 16:20 Michael H. Warfield
2005-05-13 17:17 ` Lennart Sorensen
2005-05-13 17:53 ` Michael H. Warfield
2005-05-13 18:09 ` Lennart Sorensen
2005-05-13 18:21 ` Michael H. Warfield
2005-05-13 18:26 ` Lennart Sorensen
2005-05-13 18:53 ` Michael H. Warfield
2005-05-13 17:58 ` Zan Lynx
2005-05-13 18:13 ` Lennart Sorensen
2005-05-13 18:40 ` Alan Cox
2005-05-13 19:10 ` Michael H. Warfield
2005-05-13 22:00 ` Alan Cox
2005-05-13 22:22 ` Måns Rullgård
2005-05-13 23:24 ` Jon Masters
2005-05-13 23:01 ` Jeffrey Hundstad
2005-05-13 23:27 ` Jon Masters
2005-05-14 10:17 ` Jörn Engel
2005-05-14 1:05 ` Michael H. Warfield
2005-05-17 13:30 ` Lennart Sorensen
2005-05-13 21:25 ` Lee Revell
2005-05-13 22:43 ` Alan Cox
2005-05-15 19:00 ` Denis Vlasenko
2005-05-16 0:23 ` Mark Lord
2005-05-16 9:29 ` David Woodhouse
2005-05-16 16:42 ` Pavel Machek
2005-05-16 13:01 ` Richard B. Johnson
2005-05-16 23:18 ` Helge Hafting
2005-05-18 7:03 ` Denis Vlasenko
2005-05-17 7:59 ` Colin Leroy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050518133741.GS23488@csclub.uwaterloo.ca \
--to=lsorense@csclub.uwaterloo.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@horizon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®