This application relates generally to memory devices. More specifically, this application relates to protecting data in non-volatile semiconductor flash memory when a power loss event occurs.
Non-volatile memory systems, such as flash memory, have been widely adopted for use in consumer products. Flash memory may be found in different forms, for example in the form of a portable memory card that can be carried between host devices or as a solid state disk (SSD) embedded in a host device. During normal host operation, a write abort may occur and there is a risk of losing data that was programmed in a previous host command.
For example, binary (single-level cell “SLC”) and multi-level cell (MLC) NAND Flash Memory are forms of non-volatile memory (NVM) that are capable of high data storage densities and high performance, however, a power failure due to hot removal, brownout, blackout or the like may cause data corruption or loss due to the nature of the way in which data is written to this type of memory. Typically a “page” or group of bits at a time is written to the NVM. If a power failure occurs during a write cycle/program operation, not all of the bits of the page may be programmed successfully in the NVM. When the page containing unsuccessfully programmed bits is read back, some bits may have the new value, some will have the old value and, as a result, the page may be corrupted.
It may be desirable to identify when a power loss occurs at the earliest time possible. The prediction of a power loss before all power is lost may allow for the system/memory/NAND to initiate emergency activities, including preventing the loss of data from a write abort. A power loss prediction mechanism may utilize a data link lost signal to trigger the emergency activities. The data link lost signal may indicate that the data connection between the memory and a host has been lost. The signal indicating a data link loss may precede the actual detection of a power loss so that emergency activities, such as write abort protection, can be implemented earlier.
A flash memory system suitable for use in implementing aspects of the invention is shown in
Examples of commercially available removable flash memory cards include the CompactFlash (CF), the MultiMediaCard (MMC), Secure Digital (SD), miniSD, Memory Stick, SmartMedia, TransFlash, and microSD cards. Although each of these cards may have a unique mechanical and/or electrical interface according to its standardized specifications, the flash memory system included in each may be similar. These cards are all available from SanDisk Corporation, assignee of the present application. SanDisk also provides a line of flash drives under its Cruzer trademark, which are hand held memory systems in small packages that have a Universal Serial Bus (USB) plug for connecting with a host by plugging into the host's USB receptacle. Each of these memory cards and flash drives includes controllers that interface with the host and control operation of the flash memory within them.
Host systems that may use SSDs, memory cards and flash drives are many and varied. They include personal computers (PCs), such as desktop or laptop and other portable computers, tablet computers, cellular telephones, smartphones, personal digital assistants (PDAs), digital still cameras, digital movie cameras, and portable media players. For portable memory card applications, a host may include a built-in receptacle for one or more types of memory cards or flash drives, or a host may require adapters into which a memory card is plugged. The memory system may include its own memory controller and drivers but there may also be some memory-only systems that are instead controlled by software executed by the host to which the memory is connected. In some memory systems containing the controller, especially those embedded within a host, the memory, controller and drivers are often formed on a single integrated circuit chip.
The host system 100 of
The memory system 102 of
The system controller 118 may also include data link logic 128. In one embodiment, the data link logic may be part of any of the front end 122, the controller logic/firmware 124, or the flash management logic 126. In an alternative embodiment, the data link logic 128 may be part of a separate circuit. The data link logic 128 may receive a signal indicating whether the host system 100 is connected with the memory system 102. In particular, the signal may be referred to as a data link signal and is indicative of whether there is a data link between the host system 100 and the memory system 102 through the mating parts 104 and 106. The loss of the data connection or data link may also be referred to as front end link loss. In one embodiment, the data link logic may include a drive ready state (e.g. DR_READY) and when there is an error or unexpected condition, such as a power down, the drive may be in an error state (e.g. DR_ERROR). In one embodiment, the Serial ATA Revision 3.0 (Gold Revision), dated Jun. 2, 2009 (e.g. pp. 327-328, the disclosure of which is hereby incorporated by reference), describes exemplary drive states that utilize the data link logic for transmitting a data link loss signal.
The system controller 118 may also include power loss logic 130. In one embodiment, the power loss logic 130 may be a part of any of the front end 122, the controller logic/firmware 124, or the flash management logic 126. In alternative embodiments, the power loss logic 130 may be additional circuitry that is connected to the system controller 118. The power loss logic 130 may be part of or coupled with the data link logic 128. In particular, the power loss logic 130 may include instructions that communicate with the data link logic 128 to receive a data link loss signal from the data link logic 128. The power loss logic 130 may then transmit a power loss alert signal to the system controller 118 (e.g. the front end 122, the controller firmware 124 or the flash management 126), which is used to initiate emergency activities. Emergency activities may be referred to as data protection mechanisms and may include activities a storage device would perform upon power failure prediction such as storing critical information into non-volatile memory (e.g. NAND) or flushing host data into the NAND. Write abort protection is merely one example of an emergency activity that can be performed based on this power failure prediction. For simplicity, the description below describes write abort protection as an exemplary embodiment of an emergency activity that can be performed based on this power loss prediction.
Write abort protection may include stopping future write operations and is further described with respect to
The system controller 118 may be implemented on a single integrated circuit chip, such as an application specific integrated circuit (ASIC) such as shown in
The NANDs of
Utilizing the data link lost signal as a trigger for identifying an upcoming power loss may provide additional time for write abort prevention as opposed to the actual detection of the power loss. Other systems may monitor the power rail voltage such that when it is below a threshold, there is an event triggered (e.g. write abort protection). The threshold is typically above a power fail threshold level, which is a value below which the memory card cannot operate. If the time duration between the power fail detection until a fatal power level is long enough to accommodate the ongoing NAND or memory write operation to complete, then write abort may be prevented. Accordingly, since the data link disconnect may be identified sooner than the power supply drop, the chances of a write abort are decreased. Exemplary reasons why the data disconnect may be recognized before the power drop are discussed with respect to
Write abort protection may include completing existing NAND/memory writes, while preventing future NAND/memory writes. Since a write abort occurs when a write is not completed (which may result in data loss and/or corruption), write abort protection requires a prompt identification of a state (e.g. power loss) in which the write cannot be completed. Write abort protection may include preventing the issuance of any further commands to the NAND/memory from the controller.
Upon assertion of the Linkloss signal 514 future write operations are stopped after the write protect 510 signal is asserted. In other words, there is no N+1 write commands because the Linkloss signal 514 indicates the pending power loss. In the voltage level 506, the NAND will fail at time T4. Time T4 represents the point at which the NAND does not have sufficient power supply to operate. If there were a write operation occurring during time T4, that operation would fail and result in a write abort. Writes that are initiated before the Linkloss signal 514 are completed and future write commands are refused.
There may be a grace period in
USB devices with connectors as described above are merely one example of a type of memory device that benefits from power loss prediction based on data link loss. Due to the small dimensions of a USB flash drive there may be no printed circuit board real estate available for large capacitors to store enough energy to allow voltage drop detection followed by write abort protection procedure. Further, due to the low cost requirement of a USB flash drive there may be no justification for including costly capacitors. Finally, due to USB standard limitations the maximum amount of capacitance allowed on USB flash drive power rail (VBUS) is 10 uF. Accordingly, USB flash drives benefit from the additional period provided by triggering write abort mechanism on the data link loss. Other connectors in which the data connection is lost before the power connection include Compact Flash (CFAST) or Serial AT Attachment (SATA). Alternatively, in some devices, the data connection may not be lost before the power is lost which may eliminate the advantage (e.g. an extended grace period in
As used herein, “computer-readable medium,” “machine readable medium,” “propagated-signal” medium, and/or “signal-bearing medium” may comprise any device that includes, stores, communicates, propagates, or transports software for use by or in connection with an instruction executable system, apparatus, or device to carry out steps such as those described above. The machine-readable medium may selectively be, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium. A non-exhaustive list of examples of a machine-readable medium would include: an electrical connection “electronic” having one or more wires, a portable magnetic or optical disk, a volatile memory such as a Random Access Memory “RAM”, a Read-Only Memory “ROM”, an Erasable Programmable Read-Only Memory (EPROM or Flash memory), or an optical fiber. A machine-readable medium may also include a tangible medium upon which software is printed, as the software may be electronically stored as an image or in another format (e.g., through an optical scan), then compiled, and/or interpreted or otherwise processed. The processed medium may then be stored in a processor, memory device, computer and/or machine memory.
In an alternative embodiment, dedicated hardware implementations, such as application specific integrated circuits, programmable logic arrays and other hardware devices, can be constructed to implement one or more of the methods described herein. Applications that may include the apparatus and systems of various embodiments can broadly include a variety of electronic and computer systems. One or more embodiments described herein may implement functions using two or more specific interconnected hardware modules or devices with related control and data signals that can be communicated between and through the modules, or as portions of an application-specific integrated circuit. Accordingly, the present system encompasses software, firmware, and hardware implementations.
The illustrations of the embodiments described herein are intended to provide a general understanding of the structure of the various embodiments. The illustrations are not intended to serve as a complete description of all of the elements and features of apparatus and systems that utilize the structures or methods described herein. Many other embodiments may be apparent to those of skill in the art upon reviewing the disclosure. Other embodiments may be utilized and derived from the disclosure, such that structural and logical substitutions and changes may be made without departing from the scope of the disclosure. Additionally, the illustrations are merely representational and may not be drawn to scale. Certain proportions within the illustrations may be exaggerated, while other proportions may be minimized. Accordingly, the disclosure and the figures are to be regarded as illustrative rather than restrictive.