a:3:{s:7:"#markup";O:25:"Drupal\Core\Render\Markup":1:{s:9:"*string";s:22073:"<span>Yaffs NAND flash failure mitigation</span>

      <div class="field field--name-upload field--type-file field--label-hidden field--items">
              <div class="field--item"><span class="file file--mime-application-pdf file--application-pdf icon-before"><span class="file-icon"><span class="icon glyphicon glyphicon-file text-primary" aria-hidden="true"></span></span><span class="file-link"><a href="https://yaffs.net/sites/default/files/downloads/YaffsNandFailureMitigation.pdf" type="application/pdf; length=235109" title="Open file in new window" target="_blank" data-toggle="tooltip" data-placement="bottom">YaffsNandFailureMitigation.pdf</a></span><span class="file-size">229.6 KB</span></span></div>
          </div>
  
            <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item">
<p>&nbsp;</p>
<h2>1 Purpose</h2>
<p>The purpose of this document is to give an understanding of NAND failure modes and the measures that Yaffs takes to mitigate against these.</p>
<p>This document is intended to be easy reading, but some very light-weight physics is required to understand the way NAND works.</p>
<h2>2 The NAND Cell</h2>
<p>This section explains the internal construction of a NAND device which helps to explain the way that it fails. Each NAND cell consists of a floating gate field effect transistor, described below.</p>
<h3>2.1 Floating Gate Field Effect Transistor</h3>
<p>A FET is the fundamental switching element used in almost all digital electronics. A FET is a a semiconductor element that conducts when a charge is applied to the gate.</p>
<p><img alt="" src="/sites/yaffs.net/files/images/fets.gif" /></p>
<p>A FET is a type of semiconductor device with a semiconducting region between the the source and drain connections, an insulating oxide and a gate region. The oxide prevents current from flowing from the gate to the oxide, but applying a voltage to the gate injects charge into the gate, creating an electric field which influences the conductive properties of the semiconductor region.</p>
<p>In a regular FET, a conductive channel is formed between the source and drain when a suitable control voltage is applied to the gate. The current passed by the channel is dependent on the voltage (ie. the strength of the gate field). For now we will ignore analogue levels and just consider binary levels where the gate is either conducting or not. This effectively makes a switch that is controlled by the control gate.</p>
<p>The floating gate FET is just like a regular FET except that it has an extra floating gate. This floating gate is able to trap charge between the two insulating layers. The trapped charge modifies the local electric field and thus modifies the effect of the control gate. If the floating gate has extra electrons (negative charge) then the control gate must be raised to a higher voltage to make the FET conduct.</p>
<p>So a regular FET is conductive (on) when the control gate is high and is non-conductive (off) when the control gate is low. A floating gate FET, however, is only non-conductive (off) when the floating gate is charged and the gate is low. This gives us an output that is dependent on the floating gate and a way to read it (the gate).</p>
<table>
<colgroup>
 <col /> <col /> <col />
</colgroup>
<tbody>
 <tr>
  <td>
  <p><strong>Floating gate charge</strong></p>
   </td>
  <td>
  <p><strong>Control gate</strong></p>
   </td>
  <td>
  <p><strong>Source/drain channel</strong></p>
   </td>
 </tr>
 <tr>
  <td>
  <p>Neutral(unprogrammed)</p>
   </td>
  <td>
  <p>High</p>
   </td>
  <td>
  <p>On (1)</p>
   </td>
 </tr>
 <tr>
  <td>
  <p>Neutral(unprogrammed)</p>
   </td>
  <td>
  <p>Low</p>
   </td>
  <td>
  <p>On (1)</p>
   </td>
 </tr>
 <tr>
  <td>
  <p>Charged(programmed)</p>
   </td>
  <td>
  <p>High</p>
   </td>
  <td>
  <p>On (1)</p>
   </td>
 </tr>
 <tr>
  <td>
  <p>Charged(programmed)</p>
   </td>
  <td>
  <p>Low</p>
   </td>
  <td>
  <p>Off (0)</p>
   </td>
 </tr>
</tbody>
</table>
<p><br />
&nbsp;</p>
<p>The tunneling oxide is insulating at low voltages but allows quantum tunneling (Fowler-Nordheim tunneling) at higher voltages. This FN-tunneling provides a mechanism to inject or remove charge from the floating gate by applying high voltages to the control gate or the body.</p>
<p><img alt="" src="/sites/yaffs.net/files/images/fn-tunnelling.gif" /></p>
<p>By applying a high positive voltage to the control gate, electrons are drawn into the floating gate, resulting in a programmed gate. Erasing is accomplished by the reverse operation which draws electrons out of the gate.</p>
<p>So a floating gate FET is effectively a readable, programmable switch. In other words: memory!</p>
<h3>2.2 NAND array layout</h3>
<p>NAND flash gets its name from the way that the cells are arranged. NAND cells are arranged in chains called <em><strong>strings</strong></em>, typically 1 string per bit-position in the page n(for SLC). The length of the chain is the same as the number of pages per block. This arrangement uses far less silicon area than the NOR flash arrangement which reduces NAND cost and increases density. It does however also introduce some operational and reliability problems.</p>
<p><img alt="" src="/sites/yaffs.net/files/images/nand-page-select.gif" /></p>
<p>NAND is read by biasing the unselected pages with a high bias voltage and the selected pages with the low bias voltage. This means that the unselected cells are always on and the selected cells will be on or off according to the state of the floating gate.</p>
<p>This means we have a matrix where:</p>
<ul>
<li>
<p>All unselected cells are on.</p>
 </li>
<li>
<p>Selected unprogrammed cells are on</p>
 </li>
<li>
<p>Selected programmed cells are off.</p>
 </li>
</ul>
<p>Since only one cell in a string is selected at a time, the whole string is on if the selected cell is unprogrammed and is off if the selected cell is programmed. Thus, even though the cells in a string are all in series we can still access them individually.</p>
<p>Well, that's how it would work in a perfect world anyway!</p>
<p>The string and block arrangement means that it takes quite a while ( typically a few µsec) for the voltage of the string to stabilize after the selection has been made. This stabilization time is the cause of the “access time” delay when accessing NAND flash.</p>
<h3>3 Fault Modes</h3>
<p>Sit back for a moment and consider everything that must come together for the NAND flash to work and all the ways things can go wrong:</p>
<ul>
<li>
<p>Of course there can be fabrication faults where defects cause short circuits and open circuits within the chip. These types of fault apply to all chips type, not just flash.</p>
 </li>
<li>
<p>Each cell has two oxide layers trapping the floating gate charge, one of which is semi-permeable to support tunneling. If either of these layers is too thick, the gate will be unresponsive. If they are too thin then the gate will tunnel too easily or will leak. If there are impurities in the oxide then the layers may become resistive and “leak”, thus causing the charge to change and possibly causing the state to change.</p>
 </li>
<li>
<p>The floating gate state can change by either gaining or losing charge. If charge is lost, then a programmed cell may become unprogrammed (a 0 changes to a 1). If charge is gained, then an unprogrammed cell can become programmed.</p>
 </li>
<li>
<p>In very extreme cases, a programmed cell can gain further negative charge and become over-programmed. This means that even if the high read bias voltage is applied to the control gate the FET does not become conductive. In this state, a cell will read as programmed (0) even if it is not selected. This means that the whole string will always read zero irrespective of which page is selected. This fault mode will persist until the cell is erased.</p>
 </li>
<li>
<p>These devices are made very cheaply. Flash parts with tens of billions of NAND cells cost only a few dollars. There is little money to spend on individual part testing.</p>
 </li>
</ul>
<p>Extending the previous state/selection table with the over-programmed fault state, we now have:</p>
<table>
<colgroup>
 <col /> <col /> <col />
</colgroup>
<tbody>
 <tr>
  <td>
  <p><strong>Floating gate charge</strong></p>
   </td>
  <td>
  <p><strong>Control gate</strong></p>
   </td>
  <td>
  <p><strong>Source/drain channel</strong></p>
   </td>
 </tr>
 <tr>
  <td>
  <p>Neutral(unprogrammed)</p>
   </td>
  <td>
  <p>High</p>
   </td>
  <td>
  <p>On (1)</p>
   </td>
 </tr>
 <tr>
  <td>
  <p>Neutral(unprogrammed)</p>
   </td>
  <td>
  <p>Low</p>
   </td>
  <td>
  <p>On (1)</p>
   </td>
 </tr>
 <tr>
  <td>
  <p>Charged(programmed)</p>
   </td>
  <td>
  <p>High</p>
   </td>
  <td>
  <p>On (1)</p>
   </td>
 </tr>
 <tr>
  <td>
  <p>Charged(programmed)</p>
   </td>
  <td>
  <p>Low</p>
   </td>
  <td>
  <p>Off(0)</p>
   </td>
 </tr>
 <tr>
  <td>
  <p>Over-charged(over-programmed)</p>
   </td>
  <td>
  <p>High</p>
   </td>
  <td>
  <p>Off(0)</p>
   </td>
 </tr>
 <tr>
  <td>
  <p>Over-charged(over-programmed)</p>
   </td>
  <td>
  <p>Low</p>
   </td>
  <td>
  <p>Off(0)</p>
   </td>
 </tr>
</tbody>
</table>
<h2>4 Fault Mechanisms</h2>
<p>This section explains some of the common NAND flash failure modes.</p>
<h3>4.1 General chip fault</h3>
<p>A NAND is a chip built with normal fabrication techniques and is thus prone to fail just like any other chip. Some of these faults can be isolated by marking faulty blocks. In some cases (eg. Damaged inter-block logic) the whole chip is discarded.</p>
<p>Yaffs does not use the bad blocks, so they have no negative impact on the performance of the file system 9apart from a small reduction in the amount of storage available).</p>
<h3>4.2 Oxide degradation</h3>
<p>Every programming/erasure cycle causes some degradation of the oxide layers. Over many cycles this has a tendency to degrade the properties of the oxide layer. Excessive degradation can cause the cell to fail to erase or program, but more commonly just makes the other fault modes more prevalent.</p>
<p>The primary mechanism of oxide degradation is that charge becomes permanently trapped within the oxide layer in a way that it is not cleared by programming and erasure. The resulting field disrupts both the FET's conductive channel and the effectiveness of the F-N tunneling.</p>
<p>As a result of this field disruption, two things happen:</p>
<ul>
<li>
<p>The FN tunneling is disrupted which means that the programming and erasure take longer to complete. Eventually programming and erasure might fail (see Program/erase failure below).</p>
 </li>
<li>
<p>The programming and erasure is far more marginal meaning that less leakage is required to corrupt a bit value (see Charge leakage below).</p>
 </li>
</ul>
<p>This degradation is permanent and incremental and is not cleared by erasure. This degradation is the cause of the endurance term in the NAND specification. Typical NAND flash endurance is 10,000 (MLC) to 100,000(SLC) program/erasure cycles.</p>
<p>Endurance issues are largely minimized by wear leveling and write-path caching.</p>
<p>Blocks that become too unreliable are retired from use.</p>
<h3>4.3 Program/erase failure</h3>
<p>Programming and erase operations are controlled by a built-in state machine that applies the programming/erasure voltages for a while then check whether the operation has succeeded. This is typically performed by an iterative algorithm that will time out if too many cycles are required.</p>
<p>A failure is signaled in the chip status register when the built-in programming/erasure mechanisms fail to accomplish the programming or erasure within the maximum program/erasure time.</p>
<p>It is important to realize that a programming failure is only checked on bits being set to a zero. If one bits are inadvertently set to zero then these are not raised as programming errors but are considered to be program disturb errors.</p>
<p>Program/erase errors are generally the result of excessive oxide degradation.</p>
<p>Yaffs handles programming/erasure errors as unrecoverable “hard errors”. If these are encountered then useful data is copied off the block and the whole block is permanently retired by marking the block as a bad block.</p>
<p>These are the only failures that the NAND devices will actually identify. All other failures need to be detected in software.</p>
<h3>4.4 Charge leakage</h3>
<p>The oxide isolating the floating gate is not a perfect insulator and charge can escape very slowly, particularly at temperature extremes and when the oxide had been degraded by extensive use. High radiation environments can also make this worse.</p>
<p>An effective way to handle charge leakage is to use ECC to detect and correct errors. Blocks with errors are rewritten on a fresh block allowing the data to be recreated before unrecoverable errors occur.</p>
<h3>4.5 Program disturb</h3>
<p>Program disturb happens when a bit is unintentionally programmed (1 to 0) during a programming operation. The affected bit can be in the same page or elsewhere in the block.</p>
<p>Program disturb is caused by bias conditions in the flash block during programming. Even though full programming voltage is only applied to the cells being programmed, the other cells are also subject to lesser voltages and minor tunneling can occur. This effect is far less than regular programming but is more than read disturb. However, since a page is only programmed once before the block is erased, there is no multiplier effect as there is in read disturb.</p>
<p>This condition is made worse by random programming in the block and by applying multiple partial writes to the pages.</p>
<p>Yaffs1 only writes pages in a block in sequential order and writes pages only once, except for writing deletion markers.</p>
<p>Yaffs2 does not write deletion markers and thus only programs pages sequentially and only once.</p>
<p>Thus, Yaffs2 is far less likely to cause write disturb. Yaffs1 should only be used with devices that are tolerant of partial page programming.</p>
<p>Program disturb within the same page can be corrected by verifying the page after programming.</p>
<p>ECC provides a mechanism to correct infrequent program disturb errors.</p>
<h3>4.6 Read disturb</h3>
<p>Whenever a page is read, the other pages in the block are biased at a read-inhibit voltage to turn them on. While this voltage is not as high as the programming voltage, some very slight F-N tunneling can occur. With sufficient leakage the cell state may change, or the cell may become over-programmed. This effect is known as read disturb.</p>
<p>Read disturb only impacts the pages in the block that are <em><strong>not</strong></em> <strong></strong>being read. This makes it difficult to detect in some systems. For example, consider a block where only the first page is read repeatedly. Other pages in the block may be incurring read disturb but these are happening without the effect being noticed by software. By the time the pages are eventually read, the read disturb may have caused more bit errors than the ECC is able to fix.</p>
<p>Thankfully the problem is seldom that bad. Read disturb is very gradual. Under worst case conditions read disturb effects are expected to happen only after approximately 1 million page reads on the block for SLC flash or 100,000 page reads on the block for most MLC flash (or in other words, 10 times the endurance number).</p>
<p>Be warned though that as process sizes shrink, read disturb is getting more problematic. Some flash parts are prone to read disturb after 20,000 page reads.</p>
<p>The read disturb effect for a single read is far less than the write disturb effect for a single write. However, each page is only written once per block erase cycle but may be read many times. Therefore the cumulated effect of many read disturbs can cause problems.</p>
<p>Read disturb effects are cleared by erasing the block.</p>
<p>Various mechanisms are being implemented to correct read disturb in Yaffs, though these have not yet been implemented.</p>
<p>The first mechanism is to count the number of page reads on each block. When a certain threshold is reached (say 50,000 reads for an MLC part), the block is rewritten and the count is zeroed.</p>
<p>The second mechanism is to periodically read pages in the block. eg. Every 256 times a block has a page read we read an additional page to check for read disturb. If read disturb has happened then copy onto a fresh page.</p>
<p>In addition, ECC does provide some benefit, but is insufficient on its own.</p>
<h2>5 Decoding NAND reliability statistics</h2>
<p>Many variables contribute to NAND reliability. These variables are inter-related in complex ways which mean that is is very difficult to try to isolate the variables from each other to fully characterize them. The major variables are:</p>
<table>
<colgroup>
 <col /> <col />
</colgroup>
<tbody>
 <tr>
  <td>
  <p>Temperature</p>
   </td>
  <td>
  <p>Temperature impacts the performance of the materials and thus impacts the movement of charge within the NAND cells.</p>
   </td>
 </tr>
 <tr>
  <td>
  <p>Storage time</p>
   </td>
  <td>
  <p>This is related to the cell leakage. The leakage integrates over time so the longer the cells are stored, the more it changes.</p>
   </td>
 </tr>
 <tr>
  <td>
  <p>Manufacturing variance</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
 </tr>
 <tr>
  <td>
  <p>Operating voltage</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
 </tr>
 <tr>
  <td>
  <p>Erasure/programming cycles</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
 </tr>
 <tr>
  <td>
  <p>Read cycles</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
 </tr>
</tbody>
</table>
<h2>6 MLC vs SLC</h2>
<p>Both multi-level cell (MLC) and single-level cell (SLC) NAND cells work by trapping charge in the floating gate. By trapping different amounts of charge in the gate it is possible to modify the conductance of the string. MLC store two bits in once cell by using three threshold voltages to distinguish different cell charge levels<a href="#sdfootnote1sym">1</a>.</p>
<p><img alt="" src="/sites/yaffs.net/files/images/nand-mlc-vs-slc-cell-voltages.gif" /></p>
<p>In the case of SLC, the cells are erased by the erasure state machine until the cell voltage is below V erase. Programming is accomplished by programming until the voltage exceeds Vprog. On reading, the voltage is compared with Vread.</p>
<p>MLC programming is accomplished in the same way, except that there are multiple Vprogs and Vreads. This means that there is far less margin for error and cell disturbance is far more likely to cause state changes.</p>
<p>For this reason, MLC is less reliable, has lower endurance numbers and lower read-disturb numbers. MLC thus requires far better ECC strategies to ensure reliable storage.</p>
<p>But MLC is cheaper!</p>
<h2>7 Summary</h2>
<p>In summary, NAND flash has many failure modes but these can be corrected in software to provide a reliable storage solution. Any flash storage mechanisms that do not provide sufficient coverage of different fault modes should be considered suspect.</p>
<table>
<colgroup>
 <col /> <col /> <col /> <col /> <col /> <col /> <col />
</colgroup>
<tbody>
 <tr>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p><strong>Chip Fault</strong></p>
   </td>
  <td>
  <p><strong>Degradation</strong></p>
   </td>
  <td>
  <p><strong>P/E failure</strong></p>
   </td>
  <td>
  <p><strong>Leakage</strong></p>
   </td>
  <td>
  <p><strong>Write Disturb</strong></p>
   </td>
  <td>
  <p><strong>Read Disturb</strong></p>
   </td>
 </tr>
 <tr>
  <td>
  <p><strong>NAND self check</strong></p>
   </td>
  <td>
  <p>Yes</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>Yes</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
 </tr>
 <tr>
  <td>
  <p><strong>Block retirement</strong></p>
   </td>
  <td>
  <p>Yes</p>
   </td>
  <td>
  <p>Yes</p>
   </td>
  <td>
  <p>Yes</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
 </tr>
 <tr>
  <td>
  <p><strong>Wear levelling</strong></p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>Yes</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
 </tr>
 <tr>
  <td>
  <p><strong>Write Verification</strong></p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>Yes</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
 </tr>
 <tr>
  <td>
  <p><strong>Read counting/ re-write</strong></p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>Future</p>
   </td>
 </tr>
 <tr>
  <td>
  <p><strong>Infrequent read checking</strong></p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>Future</p>
   </td>
  <td>
  <p>Future</p>
   </td>
  <td>
  <p>Future</p>
   </td>
 </tr>
 <tr>
  <td>
  <p><strong>ECC</strong></p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>Yes</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>Yes</p>
   </td>
  <td>
  <p>Yes</p>
   </td>
  <td>
  <p>Yes</p>
   </td>
 </tr>
 <tr>
  <td>
  <p><strong>Occasional rewrite of oldest data</strong></p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>Yes</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>Yes</p>
   </td>
  <td>
  <p>&nbsp;</p>
   </td>
  <td>
  <p>Yes</p>
   </td>
 </tr>
</tbody>
</table>
<p>Thus all fault mechanisms are covered by at least two corrective mechanisms (read disturb correcting features are planned).</p>
<p><a href="#sdfootnote1anc">1</a>Some MLC parts store more than 2 bits per cell, Storing n bits requires 2n levels.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
      ";}s:9:"#attached";a:0:{}s:6:"#cache";a:3:{s:8:"contexts";a:4:{i:0;s:28:"languages:language_interface";i:1;s:5:"theme";i:2;s:17:"url.path.is_front";i:3;s:16:"user.permissions";}s:4:"tags";a:4:{i:0;s:30:"config:filter.format.full_html";i:1;s:7:"file:83";i:2;s:8:"node:455";i:3;s:9:"node_view";}s:7:"max-age";i:-1;}}