# US 12,008,235 B2 · Data storage device and method for rewriting parameters thereof

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

- Number: US 12,008,235 B2
- Document ID: US12008235B2
- Status: Granted
- Kind: B2
- Application number: 18/336,316
- Filed: 2023-06-16
- Published: 2023-10-12
- Granted: 2024-06-11
- Earliest claimed: 2017-02-02
- Assignees: Silicon Motion, Inc.
- Applicants: Silicon Motion, Inc.
- Inventors: Te-Kai Wang; Yu-Da Chen
- Web page: https://patentgrep.com/patent/US12008235B2

## CPC

- G06F 3/0605: {by facilitating the interaction with a user or administrator}
- G06F 3/061: {Improving I/O performance}
- G06F 3/0619: {in relation to data integrity, e.g. data losses, bit errors}
- G06F 3/0634: {by changing the state or mode of one or more devices}
- 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}
- G11C 16/10: Programming or data input circuits
- G11C 16/22: Safety or protection circuits preventing unauthorised or accidental access to memory cells
- G11C 16/26: Sensing or reading circuits; Data output circuits
- G06F 2212/72: Details relating to flash memory management
- G06F 2212/7206: Reconfiguration of flash memory system
- G06F 2212/7207: management of metadata or control data
- 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)
- G11C: STATIC STORES (semiconductor memory devices H10B)

## Abstract

A data storage device with flash memory. The controller receives a mode selection command from a host. In response to the mode selection command, the controller sends a ready-to-transfer message to the host, to further receive a data out message from the host that is sent by the host in response to the ready-to-transfer message. The ready-to-transfer message and the data out message are UFS protocol information unit (UPIU) messages. The data out message is arranged to rewrite a first mode page setting among a plurality of mode page settings of firmware stored in the flash memory. In response to the data out message, the controller determines whether the data out message will change mode parameters which cannot be rewritten in the first mode page setting, to adopt or refuse new mode parameters issued through the data out message for the first mode page setting.

## Claims

### Claim 1

A data storage device comprising:
a flash memory storing a firmware, wherein the firmware comprises a plurality of mode page settings, and each mode page setting comprises a plurality of mode parameters; and
a controller receiving a mode selection command from a host, wherein, in response to the mode selection command, the controller sends a ready-to-transfer message to the host, to further receive a data out message from the host that is sent by the host in response to the ready-to-transfer message:
wherein:
the ready-to-transfer message and the data out message are universal flash storage (UFS) protocol information unit (UPIU) messages;
the data out message is arranged to rewrite a first mode page setting among the plurality of mode page settings;
in response to the data out message, the controller determines whether the data out message will change mode parameters which cannot be rewritten in the first mode page setting;
when determining that the data out message will not change the mode parameters which cannot be rewritten in the first mode page setting, the controller adopts new mode parameters issued through the data out message for the first mode page setting; and
when determining that the data out message will change the mode parameters which cannot be rewritten in the first mode page setting, the controller refuses to adopt the new mode parameters issued through the data out message for the first mode page setting.

### Claim 2 (depends on 1)

The data storage device as claimed in claim 1, wherein:
the mode selection command comprises a save page parameter; and
the save page parameter issued through the mode selection command is used to indicate whether to keep the new mode parameters issued through the data out message for the first mode page setting in the flash memory to replace preset mode parameters of the first mode page setting in the flash memory after the data storage device is turned off.

### Claim 3 (depends on 2)

The data storage device as claimed in claim 2, further comprising:
a random access memory, for temporary storage of the preset mode parameters of the first mode page setting;
wherein when the save page parameter indicates to keep the new mode parameters issued through the data out message for the first mode page setting in the flash memory, the controller applies the new mode parameters issued through the data out message for the first mode page setting to rewrite the preset mode parameters temporarily stored in the random access memory for the first mode page setting, and to rewrite the preset mode parameters of the first mode page setting in the flash memory.

### Claim 4 (depends on 3)

The data storage device as claimed in claim 3,
wherein when the save page parameter indicates not to keep the new mode parameters issued through the data out message for the first mode page setting in the flash memory, the controller applies the new mode parameters issued through the data out message for the first mode page setting to rewrite the preset mode parameters temporarily stored in the random access memory for the first mode page setting, without rewriting the preset mode parameters of the first mode page setting in the flash memory.

### Claim 5 (depends on 1)

The data storage device as claimed in claim 1,
wherein when determining that the data out message will change the mode parameters which cannot be rewritten in the first mode page setting, the controller replies to the host with an UPIU response message indicating a failure event,
wherein the UPIU response message comprises a response field, a status field, a sense data [2] field, and a sense data [12]-[13] field, and
wherein in the UPIU response message corresponding to the failure event, the response field is set as “TARGET FAILURE”, the status field is set as “CHECK CONDITION”, the sense data [2] field is set as “ILLEGAL REQUEST”, and the sense data [12]-[13] field is set as “INVALID FIELD IN PARAMETER LIST”.

### Claim 6 (depends on 1)

The data storage device as claimed in claim 1,
wherein when determining that the data out message will not change the mode parameters which cannot be rewritten in the first mode page setting, the controller further replies to the host with the UPIU response message indicating a success event,
wherein the UPIU response message comprises a response field and a status field, and
wherein in the UPIU response message corresponding to the success event, the response field is set as “TARGET SUCCESS”, the status field is set as “GOOD”.

### Claim 7 (depends on 1)

The data storage device as claimed in claim 1, wherein:
the controller determines whether the data out message will change mode parameters which cannot be rewritten in the first mode page setting by performing bitwise logic operations on the new mode parameters issued through the data out message for the first mode page setting, preset mode parameters of the first mode page setting, and rewriteable setting for each bit of the mode parameters of first mode page setting.

### Claim 8 (depends on 1)

The data storage device as claimed in claim 1, wherein:
the controller fills the new mode parameters issued through the data out message for the first mode page setting into a first array, fills preset mode parameters of the first mode page setting into a second array, and performs a bitwise XOR logic operation on the first array and the second array to obtain a first result; and
the controller fills the first result into a third array.

### Claim 9 (depends on 8)

The data storage device as claimed in claim 8, wherein:
the controller performs a bitwise AND logic operation on the third array and a fourth array and fills a second result of the bitwise AND logic operation into a fifth array;
the fourth array stores rewriteable setting for each bit of the mode parameters of first mode page setting, wherein, in the fourth array, bits corresponding to the mode parameters which cannot be rewritten are “1”, and bits corresponding to the mode parameters which can be rewritten are “0”; and
when any one of bits in the fifth array is a non-zero integer, the controller determines that the data out message will change the mode parameters which cannot be rewritten in the first mode page setting.

### Claim 10 (depends on 9)

The data storage device as claimed in claim 9, wherein:
when none of the bits in the fifth array is a non-zero integer, the controller determines that the data out message will not change the mode parameters which cannot be rewritten in the first mode page setting.

### Claim 11

A method for rewriting parameters applied in a data storage device which comprises a flash memory storing a firmware, the firmware comprising a plurality of mode page settings, each mode page setting comprising a plurality of mode parameters, and the method for rewriting parameters comprising:
receiving a mode selection command from a host;
in response to the mode selection command, sending a ready-to-transfer message to the host, to further receive a data out message from the host that is sent by the host in response to the ready-to-transfer message, wherein the ready-to-transfer message and the data out message are UFS protocol information unit (UPIU) messages, and the data out message is arranged to rewrite a first mode page setting among the plurality of mode page settings;
in response to the data out message, determining whether the data out message will change mode parameters which cannot be rewritten in the first mode page setting;
when determining that the data out message will not change the mode parameters which cannot be rewritten in the first mode page setting, adopting new mode parameters issued through the data out message for the first mode page setting; and
when determining that the data out message will change the mode parameters which cannot be rewritten in the first mode page setting, refusing to adopt the new mode parameters issued through the data out message for the first mode page setting.

### Claim 12 (depends on 11)

The method as claimed in claim 11, wherein:
the mode selection command comprises a save page parameter; and
the save page parameter issued through the mode selection command is used to indicate whether to keep the new mode parameters issued through the data out message for the first mode page setting in the flash memory to replace preset mode parameters of the first mode page setting in the flash memory after the data storage device is turned off.

### Claim 13 (depends on 12)

The method as claimed in claim 12, wherein:
the data storage device further uses a random access memory, for temporary storage of the preset mode parameters of the first mode page setting;
when the save page parameter indicates to keep the new mode parameters issued through the data out message for the first mode page setting in the flash memory, applying the new mode parameters issued through the data out message for the first mode page setting to rewrite the preset mode parameters temporarily stored in the random access memory for the first mode page setting, and to rewrite the preset mode parameters of the first mode page setting in the flash memory.

### Claim 14 (depends on 13)

The method as claimed in claim 13,
wherein when the save page parameter indicates not to keep the new mode parameters issued through the data out message for the first mode page setting in the flash memory, applying the new mode parameters issued through the data out message for the first mode page setting to rewrite the preset mode parameters temporarily stored in the random access memory for the first mode page setting, without rewriting the preset mode parameters of the first mode page setting in the flash memory.

### Claim 15 (depends on 11)

The method as claimed in claim 11, further comprising:
when determining that the data out message will change the mode parameters which cannot be rewritten in the first mode page setting, replying to the host with an UPIU response message indicating a failure event,
wherein the UPIU response message comprises a response field, a status field, a sense data [2] field, and a sense data [12]-[13] field, and
wherein in the UPIU response message corresponding to the failure event, the response field is set as “TARGET FAILURE”, the status field is set as “CHECK CONDITION”, the sense data [2] field is set as “ILLEGAL REQUEST”, and the sense data [12]-[13] field is set as “INVALID FIELD IN PARAMETER LIST”.

### Claim 16 (depends on 11)

The method as claimed in claim 11, further comprising:
when determining that the data out message will not change the mode parameters which cannot be rewritten in the first mode page setting, replying to the host with the UPIU response message indicating a success event,
wherein the UPIU response message comprises a response field and a status field, and
wherein in the UPIU response message corresponding to the success event, the response field is set as “TARGET SUCCESS”, the status field is set as “GOOD”.

### Claim 17 (depends on 11)

The method as claimed in claim 11, further comprising:
determining whether the data out message will change mode parameters which cannot be rewritten in the first mode page setting by performing bitwise logic operations on the new mode parameters issued through the data out message for the first mode page setting, preset mode parameters of the first mode page setting, and rewriteable setting for each bit of the mode parameters of first mode page setting.

### Claim 18 (depends on 11)

The method as claimed in claim 11, further comprising:
filling the new mode parameters issued through the data out message for the first mode page setting into a first array, filling preset mode parameters of the first mode page setting into a second array, and performing a bitwise XOR logic operation on the first array and the second array to obtain a first result; and
filling the first result into a third array.

### Claim 19 (depends on 18)

The method as claimed in claim 18, further comprising:
performing a bitwise AND logic operation on the third array and a fourth array and filling a second result of the bitwise AND logic operation into a fifth array, wherein the fourth array stores rewriteable setting for each bit of the mode parameters of first mode page setting and, in the fourth array, bits corresponding to the mode parameters which cannot be rewritten are “1”, and bits corresponding to the mode parameters which can be rewritten are “0”; and
when any one of bits in the fifth array is a non-zero integer, determining that the data out message will change the mode parameters which cannot be rewritten in the first mode page setting.

### Claim 20 (depends on 19)

The method as claimed in claim 19, further comprising:
when none of the bits in the fifth array is a non-zero integer, t determining that the data out message will not change the mode parameters which cannot be rewritten in the first mode page setting.
