diff options
author | Adrian Hunter <adrian.hunter@nokia.com> | 2010-08-11 17:17:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-12 11:43:30 -0400 |
commit | dfe86cba7676d58db8de7e623f5e72f1b0d3ca35 (patch) | |
tree | ed7e6a267c50e0ba2374dc6895515d7a100961a3 /Documentation/mmc | |
parent | 81d73a32d775ae9674ea6edf0b5b721fc3bc57d9 (diff) |
mmc: add erase, secure erase, trim and secure trim operations
SD/MMC cards tend to support an erase operation. In addition, eMMC v4.4
cards can support secure erase, trim and secure trim operations that are
all variants of the basic erase command.
SD/MMC device attributes "erase_size" and "preferred_erase_size" have been
added.
"erase_size" is the minimum size, in bytes, of an erase operation. For
MMC, "erase_size" is the erase group size reported by the card. Note that
"erase_size" does not apply to trim or secure trim operations where the
minimum size is always one 512 byte sector. For SD, "erase_size" is 512
if the card is block-addressed, 0 otherwise.
SD/MMC cards can erase an arbitrarily large area up to and
including the whole card. When erasing a large area it may
be desirable to do it in smaller chunks for three reasons:
1. A single erase command will make all other I/O on the card
wait. This is not a problem if the whole card is being erased, but
erasing one partition will make I/O for another partition on the
same card wait for the duration of the erase - which could be a
several minutes.
2. To be able to inform the user of erase progress.
3. The erase timeout becomes too large to be very useful.
Because the erase timeout contains a margin which is multiplied by
the size of the erase area, the value can end up being several
minutes for large areas.
"erase_size" is not the most efficient unit to erase (especially for SD
where it is just one sector), hence "preferred_erase_size" provides a good
chunk size for erasing large areas.
For MMC, "preferred_erase_size" is the high-capacity erase size if a card
specifies one, otherwise it is based on the capacity of the card.
For SD, "preferred_erase_size" is the allocation unit size specified by
the card.
"preferred_erase_size" is in bytes.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: Jens Axboe <axboe@kernel.dk>
Cc: Kyungmin Park <kmpark@infradead.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ben Gardiner <bengardiner@nanometrics.ca>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/mmc')
-rw-r--r-- | Documentation/mmc/00-INDEX | 4 | ||||
-rw-r--r-- | Documentation/mmc/mmc-dev-attrs.txt | 56 |
2 files changed, 60 insertions, 0 deletions
diff --git a/Documentation/mmc/00-INDEX b/Documentation/mmc/00-INDEX new file mode 100644 index 000000000000..fca586f5b853 --- /dev/null +++ b/Documentation/mmc/00-INDEX | |||
@@ -0,0 +1,4 @@ | |||
1 | 00-INDEX | ||
2 | - this file | ||
3 | mmc-dev-attrs.txt | ||
4 | - info on SD and MMC device attributes | ||
diff --git a/Documentation/mmc/mmc-dev-attrs.txt b/Documentation/mmc/mmc-dev-attrs.txt new file mode 100644 index 000000000000..ff2bd685bced --- /dev/null +++ b/Documentation/mmc/mmc-dev-attrs.txt | |||
@@ -0,0 +1,56 @@ | |||
1 | SD and MMC Device Attributes | ||
2 | ============================ | ||
3 | |||
4 | All attributes are read-only. | ||
5 | |||
6 | cid Card Identifaction Register | ||
7 | csd Card Specific Data Register | ||
8 | scr SD Card Configuration Register (SD only) | ||
9 | date Manufacturing Date (from CID Register) | ||
10 | fwrev Firmware/Product Revision (from CID Register) (SD and MMCv1 only) | ||
11 | hwrev Hardware/Product Revision (from CID Register) (SD and MMCv1 only) | ||
12 | manfid Manufacturer ID (from CID Register) | ||
13 | name Product Name (from CID Register) | ||
14 | oemid OEM/Application ID (from CID Register) | ||
15 | serial Product Serial Number (from CID Register) | ||
16 | erase_size Erase group size | ||
17 | preferred_erase_size Preferred erase size | ||
18 | |||
19 | Note on Erase Size and Preferred Erase Size: | ||
20 | |||
21 | "erase_size" is the minimum size, in bytes, of an erase | ||
22 | operation. For MMC, "erase_size" is the erase group size | ||
23 | reported by the card. Note that "erase_size" does not apply | ||
24 | to trim or secure trim operations where the minimum size is | ||
25 | always one 512 byte sector. For SD, "erase_size" is 512 | ||
26 | if the card is block-addressed, 0 otherwise. | ||
27 | |||
28 | SD/MMC cards can erase an arbitrarily large area up to and | ||
29 | including the whole card. When erasing a large area it may | ||
30 | be desirable to do it in smaller chunks for three reasons: | ||
31 | 1. A single erase command will make all other I/O on | ||
32 | the card wait. This is not a problem if the whole card | ||
33 | is being erased, but erasing one partition will make | ||
34 | I/O for another partition on the same card wait for the | ||
35 | duration of the erase - which could be a several | ||
36 | minutes. | ||
37 | 2. To be able to inform the user of erase progress. | ||
38 | 3. The erase timeout becomes too large to be very | ||
39 | useful. Because the erase timeout contains a margin | ||
40 | which is multiplied by the size of the erase area, | ||
41 | the value can end up being several minutes for large | ||
42 | areas. | ||
43 | |||
44 | "erase_size" is not the most efficient unit to erase | ||
45 | (especially for SD where it is just one sector), | ||
46 | hence "preferred_erase_size" provides a good chunk | ||
47 | size for erasing large areas. | ||
48 | |||
49 | For MMC, "preferred_erase_size" is the high-capacity | ||
50 | erase size if a card specifies one, otherwise it is | ||
51 | based on the capacity of the card. | ||
52 | |||
53 | For SD, "preferred_erase_size" is the allocation unit | ||
54 | size specified by the card. | ||
55 | |||
56 | "preferred_erase_size" is in bytes. | ||