US 11,748,023 B2
Data storage device and non-volatile memory control method
Yu-Hsiang Chung, Zhubei (TW)
Assigned to SILICON MOTION, INC., Jhubei (TW)
Filed by Silicon Motion, Inc., Jhubei (TW)
Filed on Sep. 18, 2020, as Appl. No. 17/25,004.
Claims priority of provisional application 62/941,936, filed on Nov. 29, 2019.
Claims priority of application No. 109117980 (TW), filed on May 29, 2020.
Prior Publication US 2021/0165598 A1, Jun. 3, 2021
Int. Cl. G06F 3/06 (2006.01)
CPC G06F 3/0655 (2013.01) [G06F 3/0604 (2013.01); G06F 3/0679 (2013.01)] 16 Claims
OG exemplary drawing
 
1. A data storage device, comprising:
a non-volatile memory; and
a controller and a temporary storage device which are coupled to the non-volatile memory, wherein the controller is configured to reconstruct trimming information of the non-volatile memory in the temporary storage device,
wherein:
the controller scans the non-volatile memory according to a programming order to collect a sequence of trimming information flags, and the controller interprets a piece of storage information as a logical address or trimming data according to a corresponding trimming information flag;
in response to determining that a trimming information flag shows that a corresponding piece of storage information is a logical address, the controller uses the logical address to reconstruct a host-to-device mapping table;
in response to determining that a trimming information flag shows that a corresponding piece of storage information is trimming data, the controller uses the trimming data to determine whether a storage area in the non-volatile memory stores trimming information for medium-length trimming or for long-length trimming, wherein by the different kinds of trimming data, a management of medium-length trimming is separated from a management of long-length trimming;
in response to determining that trimming data shows that a corresponding storage area in the non-volatile memory stores trimming information for medium-length trimming, the controller updates the host-to-device mapping table to store dummy mapping data corresponding to the trimming information for medium-length trimming, to show space trimming by dummy mapping data; and
in response to determining that trimming data shows that a corresponding storage area in the non-volatile memory stores trimming information for long-length trimming, the controller reconstructs a trimming bitmap based on the trimming information for long-length trimming, wherein each bit of the trimming bitmap marks space trimming of a first length, and the trimming bitmap shows space trimming which has not yet been updated to the host-to-device mapping table as dummy mapping data.