Patent ID: 7529879

Claim:
A method of controlling a flash memory, the method comprising: receiving a command to the flash memory from a host processor; determining whether the flash memory is executing an incremental merge operation for copying data that is not to be erased to another block of the flash memory, the incremental merge operation including a plurality of merge stages, wherein determining whether the flash memory is executing an incremental merge operation comprises evaluating merge state information that indicates a next merge stage to be performed; executing the next merge stage of the plurality of merge stages responsive to determining that the flash memory is executing the incremental merge operation, wherein the next merge stage is completed within a time-out time of the host processor, and wherein the plurality of merge stages of the incremental merge operation is not completed within the time-out time; determining whether an incremental merge operation is required to execute the received command; executing a first merge stage of the incremental merge operation if an incremental merge operation is required; updating the merge state information responsive to executing the first merge stage; executing the received command if the flash memory is not executing an incremental merge operation or if the received command is a read command; storing data for subsequent writing to the flash memory if the flash memory is executing an incremental merge operation; and responding to a host processor that the command has completed.