History

mmc: core: Add discard support to sd

SD spec v5.1 adds discard support. The flows and commands are similar to mmc, so just set the discard arg in CMD38. A host which supports DISCARD shall check if the DISCARD_SUPPORT (b313) is set in the SD_STATUS register. If the card does not support discard, the host shall not issue DISCARD command, but ERASE command instead. Post the DISCARD operation, the card may de-allocate the discarded blocks partially or completely. So the host mustn't make any assumptions concerning the content of the discarded region. This is unlike ERASE command, in which the region is guaranteed to contain either '0's or '1's, depends on the content of DATA_STAT_AFTER_ERASE (b55) in the scr register. One more important difference compared to ERASE is the busy timeout which we will address on the next patch.

Avri Altman committed 7 years ago

Commit bc47e2f1 parent 85236d23 files · +14 −5Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/mmc/sd.h+1−0
@@ -95,5 +95,6 @@ · 94 unmodified lines
9595 * Erase/discard
9696 */
9797 #define SD_ERASE_ARG 0x00000000
98+#define SD_DISCARD_ARG 0x00000001
9899
99100 #endif /* LINUX_MMC_SD_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t