]> www.infradead.org Git - mtd-www.git/commitdiff
mtd-www: UBI: Add sections about UBI power-cut testing
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Mon, 13 Feb 2017 21:31:18 +0000 (22:31 +0100)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Mon, 20 Feb 2017 13:50:39 +0000 (14:50 +0100)
Add remark about UBI power-cut testing and reference in
UBIFS section.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
doc/ubi.xml
faq/ubi.xml
faq/ubifs.xml

index 3192fbce3144e61865b0eb19195f59e0ce74caab..299b0f15d7b662051f559780f089961619364674 100644 (file)
@@ -15,6 +15,7 @@
 <ol>
        <li><a href="ubi.html#L_rednote">Big red note</a></li>
        <li><a href="ubi.html#L_overview">Overview</a></li>
+       <li><a href="ubi.html#L_powercut">Power-cuts tolerance</a></li>
        <li><a href="ubi.html#L_source">Source code</a></li>
        <li><a href="ubi.html#L_ml">Mailing list</a></li>
        <li><a href="ubi.html#L_usptools">User-space tools</a></li>
@@ -188,6 +189,16 @@ technology imposes.</p>
 
 
 
+<h2><a name="L_powercut">Power-cuts tolerance</a></h2>
+
+<p>Both UBI and UBIFS are designed with tolerance to power-cuts in mind.</p>
+
+<p>UBI has an internal debugging infrastructure that can emulate power
+failures for testing. The advantage of the emulation is that it emulates
+power failures at the critical points where control data structures are
+written to the device whereas the probability of interrupting the system at
+those precise moments with physical power cut testing is rather low.</p>
+
 <h2><a name="L_source">Source code</a></h2>
 
 <p>UBI is in the main-line Linux kernel starting from version
index f8c40f64044db11dea8efe684916525320d048ad..fdd7abbda6e91e65039d21e226a444b5c10ac2d5 100644 (file)
@@ -898,6 +898,41 @@ similar, just a bit simpler. Here is a similar table for UBI.</p>
 </tr>
 </table>
 
+<h3><a name="L_how_debug_recovery">Power-cut recovery testing</a></h3>
+
+<p>UBI suppors power-cut emulation for testing which emulates power-cuts after
+a random number of writes. When a power-cut is emulated, UBI switches to
+read-only mode and disallows any further write to the UBI volume, thus
+emulating a power cut. The main idea of this mode is to emulate power cuts in
+interesting places, e.g. when writing the vid header.</p>
+
+<p>Use the <code>tst_emulate_power_cut</code> debugfs file to set flags for
+when to enable power-cut emulation. Possible flags for power-cut testing
+can be seen in the table below.</p>
+
+<p>Use the files <code>tst_emulate_power_cut_min</code> and
+<code>tst_emulate_power_cut_max</code> to set the minimum and maximum number
+of successful writes, respectively, before a power-cut is emulated.</p>
+
+<p>Note that UBIFS has its own power-cut emulation functions. Please, refere
+to the corresponding
+<a href="ubifs.html#L_how_debug_recovery">Power-cut recovery testing</a>
+section.</p>
+
+<table border="2" cellpadding="4" cellspacing="0">
+<tr>
+       <td><b>Emulation type</b></td>
+       <td><b>Flag value</b></td>
+</tr>
+<tr>
+       <td>Allow power-cut to be emulated during EC header write</td>
+       <td>1</td>
+</tr>
+<tr>
+       <td>Allow power-cut to be emulated during VID header write</td>
+       <td>2</td>
+</tr>
+</table>
 
 <h2><a name="L_how_send_bugreport">How do I send an UBI bug report?</a></h2>
 
index 2b724f3e74698d6fc51505f5f83756e6e4fb1894..e223ee405c993b73b65cb5bad05a921052184b92 100644 (file)
@@ -1405,6 +1405,11 @@ the <code>ro_error</code> file.</p>
 repository) is aware of UBIFS power cut recovery testing mode and can be used
 for UBIFS power-cut testing.</p>
 
+<p>Note that UBI also supports power-cut emulation for UBI testing. Please,
+refere to the corresponding
+<a href="ubi.html#L_how_debug_recovery">Power-cut recovery testing</a>
+section.</p>
+
 
 <h2><a name="L_how_send_bugreport">How do I send an UBIFS bug report?</a></h2>