Data writing method for a flash memory, and controller and storage system using the same
First Claim
1. A data writing method for ensuring data writing correctly from a host system into a flash memory chip, wherein the flash memory chip includes a plurality of physical blocks, and each of the physical blocks has a plurality of physical pages, the data writing method comprising:
- grouping the physical blocks into at least a data area, a spare area and a replacement area;
receiving a host write command and write data corresponding to the host write command from the host system and executing the host write command by the flash memory controller;
giving a data program command to the flash memory chip during the execution of the host write command to write the write data into one of the physical blocks of the spare area; and
giving a read command to the flash memory chip before sending an acknowledgement message informing that the host write command is completed to the host system to determine whether at least a portion of data stored in one of the physical pages in the one of the physical blocks corresponding to the host write command has at least one error bit,wherein if the at least a portion of data stored in the one of the physical pages in the one of the physical blocks has the at least one error bit and the number of the at least one error bit is not larger than the maximum number of error correcting bits and is larger than an error bit threshold value, moving data stored in the one of the physical block to another physical block selected from the replacement area, and marking the one of the physical block as a bad physical block,wherein if the at least a portion of data stored in the one of the physical pages in the one of the physical blocks has the at least one error bit and the number of the at least one error bit is not larger than an error bit threshold value, marking the one of the physical block as an unreliable physical block,wherein the unreliable physical block is used for writing data only when the physical blocks of the replacement area are exhausted.
1 Assignment
0 Petitions
Accused Products
Abstract
A data writing method for writing data from a host system into a flash memory chip is provided, and the flash memory chip has a plurality of physical blocks. The method includes receiving a host writing command and write data thereof, and executing the host writing command. The method also includes giving a data program command for writing the write data into one of the physical blocks of the flash memory chip, and giving a command for determining whether data stored in the physical block has any error bit. Accordingly, the method can effectively ensure the correctness of data to be written into the flash memory chip.
-
Citations
13 Claims
-
1. A data writing method for ensuring data writing correctly from a host system into a flash memory chip, wherein the flash memory chip includes a plurality of physical blocks, and each of the physical blocks has a plurality of physical pages, the data writing method comprising:
-
grouping the physical blocks into at least a data area, a spare area and a replacement area; receiving a host write command and write data corresponding to the host write command from the host system and executing the host write command by the flash memory controller; giving a data program command to the flash memory chip during the execution of the host write command to write the write data into one of the physical blocks of the spare area; and giving a read command to the flash memory chip before sending an acknowledgement message informing that the host write command is completed to the host system to determine whether at least a portion of data stored in one of the physical pages in the one of the physical blocks corresponding to the host write command has at least one error bit, wherein if the at least a portion of data stored in the one of the physical pages in the one of the physical blocks has the at least one error bit and the number of the at least one error bit is not larger than the maximum number of error correcting bits and is larger than an error bit threshold value, moving data stored in the one of the physical block to another physical block selected from the replacement area, and marking the one of the physical block as a bad physical block, wherein if the at least a portion of data stored in the one of the physical pages in the one of the physical blocks has the at least one error bit and the number of the at least one error bit is not larger than an error bit threshold value, marking the one of the physical block as an unreliable physical block, wherein the unreliable physical block is used for writing data only when the physical blocks of the replacement area are exhausted. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A flash memory controller for ensuring data writing correctly from a host system into a flash memory chip, wherein the flash memory chip includes a plurality of physical blocks, and each of the physical blocks has a plurality of physical pages, the flash memory controller comprising:
-
a microprocessor unit; a flash memory interface unit, coupled to the microprocessor unit, and configured to connect to the flash memory chip; a host interface unit, coupled to the microprocessor unit and configured to receive a host write command and write data corresponding to the host write command from the host system; and a physical memory management unit, coupled to the microprocessor unit and configured to group the physical blocks into at least a data area, a spare area and a replacement area, wherein the physical memory management unit gives a data program command to the flash memory chip during execution of the host write command to write the write data into one of the physical blocks of the spare area, wherein the physical memory management unit gives a read command to the flash memory chip before sending an acknowledgement message informing that the host write command is completed to the host system to determine whether at least a portion of data stored in one of the physical pages in the one of the physical blocks corresponding to the host write command has at least one error bit, wherein if the at least a portion of data stored in the one of the physical pages in the one of the physical blocks has the at least one error bit and the number of the at least one error bit is not larger than the maximum number of error correcting bits and is larger than an error bit threshold value, the physical memory management unit moves data stored in the one of the physical blocks to another physical block selected from the replacement area and marks the one of the physical blocks as a bad physical block, wherein if the at least a portion of data stored in the one of the physical pages in the one of the physical blocks has the at least one error bit and the number of the at least one error bit is not larger than an error bit threshold value, the physical memory management unit marks the one of the physical blocks as an unreliable physical block, wherein the physical memory management unit uses the unreliable physical block for writing data only when the physical blocks of the replacement area are exhausted. - View Dependent Claims (7, 8, 9)
-
-
10. A flash memory storage system for ensuring data writing correctly, comprising:
-
a flash memory chip having a plurality of physical blocks, wherein each of the physical blocks has a plurality of physical pages; a connector, configured to connect to a host system and to receive a host write command and write data corresponding to the host write command from the host system; and a flash memory controller, coupled to the flash memory chip and the connector, and configured to group the physical blocks into at least a data area, a spare area and a replacement area, wherein the flash memory controller gives a data program command to the flash memory chip during execution of the host write command to write the write data into one of the physical blocks of the spare area, wherein the flash memory controller gives a read command to the flash memory chip before sending an acknowledgement message informing that the host write command is completed to the host system to determine whether at least a portion of data stored in one of the physical pages in the one of the physical blocks corresponding to the host write command has at least one error bit, wherein if at least a portion of data stored in the one of the physical pages in the one of the physical blocks has the at least one error bit and the number of the at least one error bit is not larger than the maximum number of error correcting bits and is larger than an error bit threshold value, the flash memory controller moves data stored in the one of the physical blocks to another physical block selected from the replacement area and marks the one of the physical blocks as a bad physical block, wherein if the at least a portion of data stored in the one of the physical pages in the one of the physical blocks has the at least one error bit and the number of the at least one error bit is not larger than an error bit threshold value, the flash memory controller marks the one of the physical blocks as an unreliable physical block, wherein the flash memory controller uses the unreliable physical block for writing data only when the physical blocks of the replacement area are exhausted. - View Dependent Claims (11, 12, 13)
-
Specification