Storage system and method for executing file-based firmware commands and collecting response data

A storage system and method for executing file-based firmware commands and collecting response data are provided. In one embodiment, a storage system is provided comprising a memory and a controller. The controller is configured to: receive a request from a host in communication with the storage system to write data in a file, wherein the file is identified by a file path name; determine whether the file path name matches a predetermined file path name; in response to determining that the file path name does not match the predetermined file path name, write the data in the file; and in response to determining that the file path name matches the predetermined file path name, execute a command represented by the data. Other embodiments are provided.

BACKGROUND

Some storage systems are used by hosts that communicate with the storage system via an application layer, sending requests to read and write files in a particular file path in a file system directory. By communicating via the application layer, such hosts access the storage system via the file system and not via logical block addresses (LBAs). However, certain diagnostic and configuration functionality of the storage system may only be accessed via logical block addresses. As such, it may be necessary for a user to return the storage system to the manufacturer to perform that functionality.

DETAILED DESCRIPTION

Overview

By way of introduction, the below embodiments relate to a storage system and method for executing file-based firmware commands and collecting response data. In one embodiment, a storage system is provided comprising a memory and a controller in communication with the memory. The controller is configured to: receive a request from a host in communication with the storage system to write data in a file, wherein the file is identified by a file path name; determine whether the file path name matches a predetermined file path name; in response to determining that the file path name does not match the predetermined file path name, write the data in the file; and in response to determining that the file path name matches the predetermined file path name, execute a command represented by the data.

In some embodiments, the controller is further configured to write, in the file, a response to the command after the command is executed.

In some embodiments, the controller is further configured to: receive a request from the host to read the file; and in response to receiving the request from the host to read the file, send the response to the command to the host.

In some embodiments, the command is encrypted, and wherein the controller is further configured to decrypt the command prior to executing the command.

In some embodiments, the controller is further configured to identify a logical block address associated with the file path name, and wherein the controller is configured to determine whether the file path name matches a predetermined file path name by determining whether the logical block address associated with the file path name matches a predetermined logical block address.

In some embodiments, the command comprises a diagnostic command.

In some embodiments, the command comprises a configuration command.

In some embodiments, the memory comprises a three-dimensional memory.

In some embodiments, the storage system is removably connected to the host.

In another embodiment, a method for executing a command in a storage system is provided. The method is performed in a storage system comprising a memory. The method comprises: receiving a request from a host to write data in a file in the memory; based on a location of the file in a directory structure of the memory, determining that the data represents a command to be executed and not data to be written in the file; and executing the command.

In some embodiments, the method further comprises writing a response to the command after the command is executed.

In some embodiments, the method further comprises receiving a request from the host to read the file; and sending the response to the command to the host.

In some embodiments, the command is encrypted, and wherein the method further comprises decrypting the command prior to execution.

In some embodiments, the storage system identifies the location of the file in the directory structure based on an associated logical block address.

In some embodiments, the command comprises a diagnostic command.

In some embodiments, the command comprises a configuration command.

In some embodiments, the memory comprises a three-dimensional memory.

In some embodiments, the storage system is removably connected to the host.

In another embodiment, a storage system is provided comprising a memory; means for identifying a file-based request for executing a firmware command in the memory system; and means for executing the firmware command.

In some embodiments, the memory comprises a three-dimensional memory.

Embodiments

Storage systems suitable for use in implementing aspects of these embodiments are shown inFIGS. 1A-1C.FIG. 1Ais a block diagram illustrating a non-volatile storage system100according to an embodiment of the subject matter described herein. Referring toFIG. 1A, non-volatile storage system100includes a controller102and non-volatile memory that may be made up of one or more non-volatile memory die104. As used herein, the term die refers to the collection of non-volatile memory cells, and associated circuitry for managing the physical operation of those non-volatile memory cells, that are formed on a single semiconductor substrate. Controller102interfaces with a host system and transmits command sequences for read, program, and erase operations to non-volatile memory die104.

As used herein, a non-volatile memory controller is a device that manages data stored on non-volatile memory and communicates with a host, such as a computer or electronic device. A non-volatile memory controller can have various functionality in addition to the specific functionality described herein. For example, the non-volatile memory controller can format the non-volatile memory to ensure the memory is operating properly, map out bad non-volatile memory cells, and allocate spare cells to be substituted for future failed cells. Some part of the spare cells can be used to hold firmware to operate the non-volatile memory controller and implement other features. In operation, when a host needs to read data from or write data to the non-volatile memory, it can communicate with the non-volatile memory controller. If the host provides a logical address to which data is to be read/written, the non-volatile memory controller can convert the logical address received from the host to a physical address in the non-volatile memory. (Alternatively, the host can provide the physical address.) The non-volatile memory controller can also perform various memory management functions, such as, but not limited to, wear leveling (distributing writes to avoid wearing out specific blocks of memory that would otherwise be repeatedly written to) and garbage collection (after a block is full, moving only the valid pages of data to a new block, so the full block can be erased and reused).

Non-volatile memory die104may include any suitable non-volatile storage medium, including resistive random-access memory (ReRAM), magnetoresistive random-access memory (MRAM), phase-change memory (PCM), NAND flash memory cells and/or NOR flash memory cells. The memory cells can take the form of solid-state (e.g., flash) memory cells and can be one-time programmable, few-time programmable, or many-time programmable. The memory cells can also be single-level cells (SLC), multiple-level cells (MLC), triple-level cells (TLC), or use other memory cell level technologies, now known or later developed. Also, the memory cells can be fabricated in a two-dimensional or three-dimensional fashion.

The interface between controller102and non-volatile memory die104may be any suitable flash interface, such as Toggle Mode200,400, or800. In one embodiment, storage system100may be a card based system, such as a secure digital (SD) or a micro secure digital (micro-SD) card. In an alternate embodiment, storage system100may be part of an embedded storage system.

Although, in the example illustrated inFIG. 1A, non-volatile storage system100(sometimes referred to herein as a storage module) includes a single channel between controller102and non-volatile memory die104, the subject matter described herein is not limited to having a single memory channel. For example, in some storage system architectures (such as the ones shown inFIGS. 1B and 1C), 2, 4, 8 or more memory channels may exist between the controller and the memory device, depending on controller capabilities. In any of the embodiments described herein, more than a single channel may exist between the controller and the memory die, even if a single channel is shown in the drawings.

FIG. 1Billustrates a storage module200that includes plural non-volatile storage systems100. As such, storage module200may include a storage controller202that interfaces with a host and with storage system204, which includes a plurality of non-volatile storage systems100. The interface between storage controller202and non-volatile storage systems100may be a bus interface, such as a serial advanced technology attachment (SATA), peripheral component interface express (PCIe) interface, or dual-date-rate (DDR) interface. Storage module200, in one embodiment, may be a solid state drive (SSD), or non-volatile dual in-line memory module (NVDIMM), such as found in server PC or portable computing devices, such as laptop computers, and tablet computers.

FIG. 1Cis a block diagram illustrating a hierarchical storage system. A hierarchical storage system250includes a plurality of storage controllers202, each of which controls a respective storage system204. Host systems252may access memories within the storage system via a bus interface. In one embodiment, the bus interface may be an NVMe or fiber channel over Ethernet (FCoE) interface. In one embodiment, the system illustrated inFIG. 1Cmay be a rack mountable mass storage system that is accessible by multiple host computers, such as would be found in a data center or other location where mass storage is needed.

FIG. 2Ais a block diagram illustrating components of controller102in more detail. Controller102includes a front end module108that interfaces with a host, a back end module110that interfaces with the one or more non-volatile memory die104, and various other modules that perform functions which will now be described in detail. A module may take the form of a packaged functional hardware unit designed for use with other components, a portion of a program code (e.g., software or firmware) executable by a (micro)processor or processing circuitry that usually performs a particular function of related functions, or a self-contained hardware or software component that interfaces with a larger system, for example. Modules of the controller102may include a file-system-to-LBA module111, which is discussed in more detail below, and can be implemented in hardware or software/firmware. The file-system-to-LBA module111can be configured to perform the algorithms and methods discussed below and shown in the attached drawings.

Referring again to modules of the controller102, a buffer manager/bus controller114manages buffers in random access memory (RAM)116and controls the internal bus arbitration of controller102. A read only memory (ROM)118stores system boot code. Although illustrated inFIG. 2Aas located separately from the controller102, in other embodiments one or both of the RAM116and ROM118may be located within the controller. In yet other embodiments, portions of RAM and ROM may be located both within the controller102and outside the controller.

Front end module108includes a host interface120and a physical layer interface (PHY)122that provide the electrical interface with the host or next level storage controller. The choice of the type of host interface120can depend on the type of memory being used. Examples of host interfaces120include, but are not limited to, SATA, SATA Express, SAS, Fibre Channel, USB, PCIe, and NVMe. The host interface120typically facilitates transfer for data, control signals, and timing signals.

The storage system100also includes other discrete components140, such as external electrical interfaces, external RAM, resistors, capacitors, or other components that may interface with controller102. In alternative embodiments, one or more of the physical layer interface122, RAID module128, media management layer138and buffer management/bus controller114are optional components that are not necessary in the controller102.

FIG. 2Bis a block diagram illustrating components of non-volatile memory die104in more detail. Non-volatile memory die104includes peripheral circuitry141and non-volatile memory array142. Non-volatile memory array142includes the non-volatile memory cells used to store data. The non-volatile memory cells may be any suitable non-volatile memory cells, including ReRAM, MRAM, PCM, NAND flash memory cells and/or NOR flash memory cells in a two dimensional and/or three dimensional configuration. Non-volatile memory die104further includes a data cache156that caches data. Peripheral circuitry141includes a state machine152that provides status information to the controller102.

Turning again to the drawings,FIG. 3is a block diagram of a host50and storage system100of an embodiment. For simplicity, this diagram only shows some of the possible components in the host50and storage system100. Any suitable type of storage system and host can be used. For illustration purposes only, the host50can take the form of a mobile computing device (e.g., a mobile phone), and the storage system100can take the form of a memory card (e.g., a microSD card). It should be noted that these are merely examples and that other forms of a host and storage system can be used.

As shown inFIG. 3, in this embodiment, the host50comprises a processor54that runs an application (“app”)52. For example, computer-readable program code for the app52can be read from memory56and executed by the processor54. In this embodiment, the app52communicates with the storage system100using read and write file requests. While the app52understands the file system structure of the memory104in the storage system100, the app does not address logical block addresses (LBAs) in the memory104. Instead, the storage system100, which is not aware of files, uses the file-system-to-LBA module111in the controller102to convert the read/write file requests from the app52in the host50to logical block addresses, which can then be converted to physical addresses in the memory104by the controller102.

As mentioned above, in situations, such as inFIG. 3, where the host50communicates with the storage system100on an application layer and not via logical block addresses, the host50cannot access diagnostic and configuration functionality of the storage system100, as such functionality is only accessible via logical block addresses. This may occur, for example, in certain situations when a microSD card is used with an Android host. As such, it may be necessary for a user to return the storage system100to the manufacturer to perform that functionality.

For example, once the storage system100is released to the market, there may be no way for the host50to perform a diagnostic function and collect debug information from the field because the host50cannot execute firmware commands from the application layer. This is because LBA-level access is blocked by certain hosts. So, reporting firmware field failures and performing usage analysis may require the user to return the storage system100to the manufacturer, so the manufacturer can access the “raw” LBAs on the storage system100and run diagnostic commands.

As another example, by the host50not being able to execute firmware commands from the application layer, once the storage system100is released to the market, there may be no way for the host50to change firmware configurations. Configuring the storage system parameters for high performance may be important because host vendors can recommend different classes of products for different performance and endurance requirements of their applications (e.g., high performance or endurance partitioning). More specifically, different categories of storage systems may have different levels of endurance and performance. For a particular application that requires more performance or endurance, a more-expensive storage system100may be needed. For example, a 4k resolution video recording application with a 30 MBps speed requirement would not be able to use a storage system that operates only at 4 MBps or 10 MBps. Similar constraints may apply for a low-endurance product category with respect to the application for which it can be used. Thus, it is desirable for the host50to be able to configure the storage system100to suit a specific application in the field

The following embodiments can be used to allow the host50to send application layer commands to the storage system100, so that the storage system100can execute diagnostic and/or configuration commands from the field. In general, the storage system100has hardware and/or software to identify a file-based request from the host50for executing a firmware command in the memory system100. In one embodiment, the storage system100receives a request from the host50to write data in a file identified by a file path name. The storage system100then determines whether the file path name matches a predetermined file path name. For example, the storage system100can use the file-system-to-LBA module111to identify a logical block address associated with the file path name and then determine whether that logical block address matches a predetermined logical block address. If the file path name does not match the predetermined file path name, the storage system100can treat the write request as a normal write request and write the data in the file in memory104(e.g., at the physical address mapped to the determined logical block address). However, if the file path name matches the predetermined file path name, the storage system100recognize that the data actually represents a command to be executed and is not actually data to be written in the file. As such, the storage system100can execute the command.

FIG. 4is a flow chart illustrating the operation of this embodiment. Here, the app52running on the host50is responsible for interacting with the storage system100. Of course, this is just one example, and other implementations are possible. As shown inFIG. 4, in this example, the app52in the host500first creates a file with a specific name in the app-specific directory of the app (act410). As noted above, in this embodiment, the app52does not have direct access the LBAs of the storage system100, as it accesses the storage system using a file system. By creating a file in a specific path in the file system of the storage system100, the storage system100can intelligently detect that the app52is sending the storage system100a particular firmware custom command and execute it. In one embodiment, the specific file path is hardcoded in the storage system100as the triggering file path for executing a special command (and not merely a location for storage of data). In this particular example, the triggering file is called “.debug” under the app specific directory “/Manufacture/data/com. company.app/files/”. Of course, this is merely an example, and any desirable, suitable file path can be used. Next, the app52optionally encrypts the custom command (act420). The app52then writes the command as data to the created file (act430).

When the storage system100receives the write command, it checks to see if the file path matches the hardcoded, triggering file path (e.g., based on a location of the file in a directory structure of the memory104) (act440). This hardcoded path within the file system is where the storage system100anticipates where the diagnostic file writes will happen. For example, in one implementation, in the fresh state of the firmware, the storage system100monitors writes to LBA0. LBA0either has the master boot record (MBR) or the partition boot record (PBR). LBA0is typically written during creation of the file system image by the host50. The MBR points to the PBR, and the PBR points to the root directory. This address is stored in the storage system100. Writes to the root directory are monitored to see if the next leaf path is created, and the directory address of that folder is acquired. For example, if the file path is ./Manufacturer/data/com.company.app, the root directory is monitored for creation of the “Manufacturer” directory, and, using that, the address of that directory is acquired. Writes to this directory are monitored to determine if the next leaf path “data” directory is created or not and so on until the final destination directory's address is acquired. Writes to this directory can be monitored to see if the special diagnostic file is created. If creation of this file is detected, the contents of this file are read. If the signature matches the diagnostic signature, then the card goes ahead and detects the opcode and translates it to specific functions like error log read, hot count data read, etc.

As discussed above, the structure of the file path in this example is that the MBR has the PBR address, the PBR has the root directory's address, the root directory has the next child directory's address, and so on. In case of a closed-ended write command (e.g., block count input by the host50in advance), the implementation can have overhead only if the command contains the already identified MBR, PBR, directory, etc. The front-end firmware can monitor the start LBA and the block count and if any of the special structures already learned during the format time are part of the command, then the RAM location of the incoming data to those structures can be parsed by the firmware to understand if the address of the child structures are modified. If the addresses of the child structures are modified, they can be updated in the memory104(e.g., in a special firmware structure). In case of open-ended commands, the front-end firmware may not be able to predict if the addresses of the special structures it has already remembered are going to be part of that write or not. A hardware mechanism called auto transfer can handle the transfer of data from the host interface module to the flash interface module with minimal firmware involvement. In this case, there can be several ways to minimize the overhead. For example, the firmware can input the addresses of the special structures to a hardware engine, and an interrupt mechanism can be used to wake up a component to parse the data to these special addresses to see if the next child file system structure's address is updated or not. As another example, low-level firmware can perform these functions.

Returning toFIG. 4, if the file path does not match the hardcoded, triggering file path, the storage system100writes the data to the file in a normal write operation (act450). However, if the file path does match the hardcoded, triggering file path, the storage system100recognizes that the data is actually a custom command. If the custom command was encrypted, the storage system100can decrypt it (act470). The storage system100then determines if the custom command exists in the storage system100(act470). If the custom command does not exist, the storage system100writes the data in the file in a normal write operation (act450). However, if the custom command does exist, the storage system100executes the command and writes the response to the command (e.g., as required per the custom command spec) in the file (act490). For example, if the command was a diagnostic command, the storage system100can write the debug response to the file.

Turning again to the drawings,FIG. 5is a flow chart of a method of an embodiment for collecting response data to an executed file-based firmware command. As shown inFIG. 5, after the storage system100acknowledges that the command was successfully executed, the app52can send a request to the storage system100to read the file (act510). The storage system100responds to this request by performing a normal read operation of the file and returning the data stored therein, which, in this example, is the result of a diagnostic operation (e.g., an error log read and a hot count data read) (act520). The app52then decodes the returned data and can send it to a server or another external component (e.g., after getting permission from the user) (act530).

It should be noted that the command sent by the app52can take any suitable form and can be for any suitable operation. For example, through an option in the app52, a user can create permanent or temporary high-performance partitions or folders by permanently or temporarily sacrificing capacity. In one implementation, the user can create a folder and select the high performance option and then select an amount of data to give high performance for. This can be at the cost of capacity loss based on the high performance amount of data, which can require approved from the user. If the partition is a temporary high performance partition, after its use is completed, the user can select an option to clean up the partition during idle time, thus gaining back the lost capacity. Also, an already-created partition or folder can be converted to high performance. There can be several options to create a high performance partition/folder without compromising capacity but with endurance compromise. The endurance percentage loss can be announced to the user.

As another example, through an option in the app52, a user can create a permanent or temporary high-endurance partition or folder. In one implementation, copied data will have more endurance, and the endurance benefit will be announced to the user. There can be several options (e.g., a high-endurance partition with capacity reduction and better performance, and a high-endurance partition without capacity reduction but compromising performance). The capacity or performance reduction percentage can be announced to the user. Also, an already-created partition or folder can be converted to high endurance, so that it will be applicable to files to be copied after that.

There are several advantages associated with these embodiments. For example, these embodiment can enable low-cost storage systems to be used for high performance/endurance applications. These embodiments also allow the host50to collect usage data and failure analysis in real-time without the need to return the storage system100to the manufacturer. Such data can be used to design better storage system in the future.

One of skill in the art will recognize that this invention is not limited to the two dimensional and three dimensional structures described but cover all relevant memory structures within the spirit and scope of the invention as described herein and as understood by one of skill in the art.