# US 2023/0266906 A1 · Data storage device and control method for non-volatile memory

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0266906 A1
- Document ID: US20230266906A1
- Status: Published application
- Kind: A1
- Application number: 17/835,183
- Filed: 2022-06-08
- Published: 2023-08-24
- Earliest claimed: 2022-02-18
- Assignees: Silicon Motion, Inc.
- Applicants: Silicon Motion, Inc.
- Inventors: Yu-Hao CHANG; Yu-Han HSIAO; Po-Sheng CHOU
- Web page: https://patentgrep.com/patent/US20230266906A1

## CPC

- G06F 3/0647: {Migration mechanisms}
- G06F 3/0604: {Improving or facilitating administration, e.g. storage management}
- G06F 3/0619: {in relation to data integrity, e.g. data losses, bit errors}
- G06F 3/0623: {in relation to content}
- G06F 3/0656: {Data buffering arrangements}
- G06F 3/0679: {Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]}
- G06F 12/0246: {in block erasable memory, e.g. flash memory}
- G06F 2212/7205: Cleaning, compaction, garbage collection, erase control
- G06F 2212/7209: Validity control, e.g. using flags, time stamps or sequence numbers
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A solution for deteriorated non-volatile memory is shown. When a controller determines that raw data read from the non-volatile memory is undesirable data, the controller performs safety moving of valid data of an erasure unit that contains the raw data to safely move the valid data of the erasure unit, wherein the erasure unit is a high-risk block, and the raw data in the non-volatile memory is regarded as being in a deteriorated physical address. Prior to being moved in the safety moving, the raw data is changed so that it is different from the undesirable data. In an exemplary embodiment, the undesirable data is all-1's data or all-0's data.

## Claims

### Claim 1

A data storage device, comprising:
a non-volatile memory; and
a controller, coupled to the non-volatile memory,
wherein:
when determining that raw data read from the non-volatile memory is undesirable data, the controller performs safety moving of valid data of an erasure unit that contains the raw data to safely move the valid data of the erasure unit, wherein the erasure unit is a high-risk block, and the raw data in the non-volatile memory is regarded as being in a deteriorated physical address, and
prior to being moved in the safety moving, the raw data is changed so that it is different from the undesirable data.

### Claim 2 (depends on 1)

The data storage device as claimed in claim 1, wherein:
the undesirable data is all-1's data or all-0's data.

### Claim 3 (depends on 2)

The data storage device as claimed in claim 2, wherein:
the controller comprises a scrambling and descrambling module, which performs data scrambling before writing data into the non-volatile memory, and performs data descrambling after reading data from the non-volatile memory;
the controller operates the scrambling and descrambling module to descramble the raw data to obtain a read data, and performs error checking and correction on the read data; and
when the read data fails the error checking and correction, the controller determines whether the raw data without data descrambling is the undesirable data.

### Claim 4 (depends on 3)

The data storage device as claimed in claim 3, further comprising:
a random access memory, temporarily storing the read data;
wherein:
in the random access memory, the controller changes the read data to a specific data; and
the controller reads the specific data from the random access memory, operates the scrambling and descrambling module to scramble the specific data to a scrambled result that is different from the undesirable data, and moves the scrambled result, rather than the undesirable data, for safety moving.

### Claim 5 (depends on 4)

The data storage device as claimed in claim 4, wherein:
the controller accesses the non-volatile memory through a plurality of channels;
the controller provides a plurality of registers correspond one-to-one with the channels; and
when determining that the raw data is the undesirable data, the controller programs a register corresponding to a channel reading the undesirable data to flag the channel as a flagged channel.

### Claim 6 (depends on 5)

The data storage device as claimed in claim 5, wherein:
the controller plans the random access memory to provide a first-in-first-out buffer to buffer physical addresses of the non-volatile memory that a host requests to read, wherein each physical address includes channel information;
the controller checks the first-in-first-out buffer to get physical address candidates corresponding to the flagged channel; and
according to the physical address candidates, the controller reads the non-volatile memory to determine the deteriorated physical address of the raw data that is the undesirable data.

### Claim 7 (depends on 6)

The data storage device as claimed in claim 6, wherein:
according to each physical address candidate, the controller reads a spare information area of the non-volatile memory; and
when reading all-1's bits or all-0's bits from a spare information area, the controller determines that the corresponding physical address candidate is the deteriorated physical address.

### Claim 8 (depends on 7)

The data storage device as claimed in claim 7, wherein:
the controller reads the non-volatile memory according to each physical address candidate without reading a user data area indicated by each physical address candidate.

### Claim 9 (depends on 7)

The data storage device as claimed in claim 7, wherein:
the controller builds a deterioration data structure in the random access memory, and uses an item in the deterioration data structure to store the physical address candidates as well as a temporary storage address in which the random access memory stores the read data;
the controller obtains the physical address candidates from the item in the deterioration data structure to read the non-volatile memory for determination of the deteriorated physical address;
after determining the deteriorated physical address, the controller obtains the temporary storage address from the item in the deterioration data structure; and
in the temporary storage address of the random access memory, the controller changes the read data to the specific data.

### Claim 10 (depends on 9)

The data storage device as claimed in claim 9, wherein:
when the specific data is read, the controller determines that deterioration has occurred.

### Claim 11

A control method for a non-volatile memory, comprising:
when determining that raw data read from the non-volatile memory is undesirable data, performing safety moving of valid data of an erasure unit that contains the raw data to safely move the valid data of the erasure unit, wherein the erasure unit is a high-risk block, and the raw data in the non-volatile memory is regarded as being in a deteriorated physical address;
prior to moving the raw data in the safety moving, changing the raw data so that it is different from the undesirable data.

### Claim 12 (depends on 11)

The control method as claimed in claim 11, wherein:
the undesirable data is all-1's data or all-0's data.

### Claim 13 (depends on 12)

The control method as claimed in claim 12, further comprising:
descrambling the raw data to obtain a read data;
performing error checking and correction on the read data; and
when the read data fails the error checking and correction, determining whether the raw data without data descrambling is the undesirable data.

### Claim 14 (depends on 13)

The control method as claimed in claim 13, further comprising:
temporarily storing the read data in a random access memory;
in the random access memory, changing the read data to a specific data; and
reading the specific data from the random access memory, scrambling the specific data to a scrambled result that is different from the undesirable data, and moving the scrambled result, rather than the undesirable data, for safety moving.

### Claim 15 (depends on 14)

The control method as claimed in claim 14, further comprising:
accessing the non-volatile memory through a plurality of channels;
providing a plurality of registers correspond one-to-one with the channels; and
when determining that the raw data is the undesirable data, programing a register corresponding to a channel reading the undesirable data to flag the channel as a flagged channel.

### Claim 16 (depends on 15)

The control method as claimed in claim 15, further comprising:
providing a first-in-first-out buffer in the random access memory to buffer physical addresses of the non-volatile memory that a host requests to read, wherein each physical address includes channel information;
checking the first-in-first-out buffer to get physical address candidates corresponding to the flagged channel; and
according to the physical address candidates, reading the non-volatile memory to determine the deteriorated physical address of the raw data that is the undesirable data.

### Claim 17 (depends on 16)

The control method as claimed in claim 16, further comprising:
according to each physical address candidate, reading a spare information area of the non-volatile memory; and
when reading all-1's bits or all-0's bits from a spare information area, determining that the corresponding physical address candidate is the deteriorated physical address.

### Claim 18 (depends on 17)

The control method as claimed in claim 17, further comprising:
reading the non-volatile memory according to each physical address candidate without reading a user data area indicated by each physical address candidate.

### Claim 19 (depends on 17)

The control method as claimed in claim 17, further comprising:
building a deterioration data structure in the random access memory, and using an item in the deterioration data structure to store the physical address candidates as well as a temporary storage address in which the random access memory stores the read data;
obtaining the physical address candidates from the item in the deterioration data structure to read the non-volatile memory for determination of the deteriorated physical address;
after determining the deteriorated physical address, obtaining the temporary storage address from the item in the deterioration data structure; and
in the temporary storage address of the random access memory, changing the read data to the specific data.

### Claim 20 (depends on 19)

The control method as claimed in claim 19, further comprising:
when reading the specific data, determining that deterioration has occurred.
