Configurable command revocation method and apparatus therefor

By introducing a cancellation processing unit and a cancellation enable port into the information processing device, the problem of cancellation commands being difficult to take effect in queue communication is solved, thereby improving the performance of storage devices and reducing wear on storage media.

CN111176726BActive Publication Date: 2026-02-17XIAMEN JINGCUN SEMICON TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201911412331.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-31
Publication Date
2026-02-17
Estimated Expiration
2039-12-31

AI Technical Summary

Technical Problem

In queued communication, existing technologies struggle to effectively revoke submitted but unprocessed commands, making it difficult for command processing devices to respond to revocation requests in a timely manner, which affects the performance of storage devices and the wear and tear of storage media.

Method used

By introducing an undo processing unit, the command submission queue is traversed to identify commands to be undone, and the undo result is added to the command completion queue, thus avoiding the transfer of commands to the command processing device or the direct forwarding of commands when the undo enable port is not set.

Benefits of technology

This enables timely cancellation of commands in the queue, reduces the amount of data written to the storage medium, reduces wear and tear on storage devices, improves the performance of storage devices, and minimizes the impact on the operation of existing information processing devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111176726B_ABST
    Figure CN111176726B_ABST
Patent Text Reader

Abstract

A configurable command revocation method and apparatus thereof are provided. The provided information processing apparatus includes a command submission queue, a command completion queue, a revocation processing unit, and a command processing device. The revocation processing unit is coupled to the command submission queue and the command processing device. In response to a first command obtained from the command submission queue, the revocation processing unit traverses the command submission queue to identify whether the first command is to be revoked. If the first command is to be revoked, the revocation processing unit adds a processing result indicating that the first command is revoked to the command completion queue. If the first command is not to be revoked, the revocation processing unit hands over the first command to the command processing device.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to information processing technology, and in particular, to a method for canceling a command issued in advance among a plurality of information processing units communicating through a queue and an apparatus thereof. BACKGROUND

[0002] Figure 1A A block diagram of an information processing apparatus based on queue communication is shown.

[0003] A typical information processing apparatus processes a command externally submitted to it, including a command submission queue, a command completion queue and a command processing unit. An external apparatus adds a command to the command submission queue. The command processing unit acquires the command from the command submission queue and processes it, and also adds the processing result of the command to the command completion queue, while the external apparatus takes the command processing result from the command completion queue.

[0004] The operation of adding a command to a queue occurs at the tail of the queue, and the operation of taking a command from a queue occurs at the head of the queue. By exchanging commands through a queue, the speed difference between the external component generating the command and the information processing apparatus processing the command is shielded, and the command that cannot be processed in time is buffered in the queue.

[0005] Figure 1BA block diagram of a storage device is shown. The storage device 102 is coupled with a host to provide storage capabilities for the host. The host and the solid-state storage device 102 can be coupled in various ways, including but not limited to, through a connection such as SATA (Serial Advanced Technology Attachment), SCSI (Small Computer System Interface), SAS (Serial Attached SCSI), IDE (Integrated Drive Electronics), USB (Universal Serial Bus), PCIE (Peripheral Component Interconnect Express), NVMe (NVM Express), UFS (Universal Flash Storage), eMMC (embedded MMC (MultiMediaCard)), Ethernet, Fibre Channel, a wireless communication network, etc. The host can be an information processing device capable of communicating with the storage device through the above ways, such as a personal computer, a tablet computer, a server, a portable computer, a network switch, a router, a cellular phone, a personal digital assistant, etc. The storage device 102 includes an interface 103, a control component 104, one or more NVM chips 105, and optionally a DRAM (Dynamic Random Access Memory) 110.

[0006] NAND flash memory, phase change memory, FeRAM (Ferroelectric RAM), MRAM (Magnetic Random Access Memory), RRAM (Resistive Random Access Memory), XPoint memory, etc. are common NVMs.

[0007] The interface 103 can be adapted to exchange data with the host through, for example, SATA, IDE, USB, PCIE, NVMe, SAS, UFS (Universal Flash Storage), Ethernet, Fibre Channel, etc.

[0008] The control component 104 is configured to control data transfer between the interface 103, the NVM chip 105, and the DRAM 110, and is also configured to perform storage management, mapping of host logical addresses to flash physical addresses, erase leveling, bad block management, etc. The control component 104 can be implemented in various manners, such as software, hardware, firmware, or a combination thereof. For example, the control component 104 can be in the form of an FPGA (Field-programmable gate array), an ASIC (Application Specific Integrated Circuit), or a combination thereof. The control component 104 can also include a processor or a controller, in which software is executed to manipulate the hardware of the control component 104 to process IO (Input / Output) commands. The control component 104 can also be coupled to the DRAM 110 and can access data of the DRAM 110. The DRAM can store the FTL table and / or buffered IO command data.

[0009] The control component 104 includes a flash interface controller (or referred to as a media interface controller, a flash channel controller) coupled to the NVM chip 105 and configured to issue commands to the NVM chip 105 in a manner compliant with an interface protocol of the NVM chip 105 to operate the NVM chip 105 and receive results of command execution output from the NVM chip 105. Known NVM chip interface protocols include “Toggle”, “ONFI”, etc.

[0010] UFS (Universal Flash Storage) is an interface standard for flash storage devices developed by the JEDEC standard organization, with a standard number such as JESD220C. The UFS protocol exchanges commands between a host and a storage device in UPIU (UFS Protocol Information Unit) as a transmission unit. The UPIU includes various types, such as a command unit, an RTT unit, a read data unit, a write data unit, and a response unit, etc.

[0011] In addition to read commands and write commands, the UFS protocol also defines task management commands, advisory commands, eject commands, null commands, etc. The task management commands include, for example, an Abort function, which instructs to abort one or more commands previously submitted to the UFS storage device. SUMMARY

[0012] The queue has the feature of first-in first-out, the command added to the queue earlier is processed earlier, and the command added to the queue later is processed later. This brings the advantage of orderliness. But it brings great obstacle when the command added to the queue before the revocation is needed to be revoked. The information processing device has difficulty in obtaining the existence of the revocation command in time when processing the command in front of the queue to be revoked, and thus the revocation command is difficult to take effect.

[0013] Particularly, the revocation function of the task management command is defined in the UFS protocol. The UFS storage device needs to process the revocation command issued by the host. And proper processing of the revocation command can also reduce the amount of data written to the flash storage medium, reduce the wear of the storage medium, and improve the performance of the storage device due to the reduction of the commands to be processed.

[0014] And the support of the revocation function also hopes to have as little impact as possible on the existing information processing device.

[0015] According to a first aspect of the present application, a first information processing device according to the first aspect of the present application is provided, comprising: a command submission queue, a command completion queue, a revocation processing unit and a command processing device; the revocation processing unit is coupled to the command submission queue and the command processing device; the revocation processing unit traverses the command submission queue to identify whether the first command is to be revoked in response to the first command obtained from the command submission queue; if the first command is to be revoked, the revocation processing unit adds the processing result indicating that the first command is revoked to the command completion queue; if the first command is not to be revoked, the revocation processing unit hands over the first command to the command processing device.

[0016] According to the first information processing device of the first aspect of the present application, a second information processing device according to the first aspect of the present application is provided, wherein each command in the command submission queue comprises a command identifier and a command body, and the command identifier uniquely identifies the command being processed by the information processing device.

[0017] According to the first or second information processing device of the first aspect of the present application, a third information processing device according to the first aspect of the present application is provided, wherein to identify whether the first command is to be revoked, the revocation processing unit traverses the command submission queue from the head to the tail to access the revocation command in the command submission queue, and identifies whether the first command is to be revoked according to whether the command identifier of the first command is the same as the command identifier indicated by one or more revocation commands in the command submission queue.

[0018] According to the third information processing device of the first aspect of the present application, a fourth information processing device according to the first aspect of the present application is provided, wherein if the command body of the revocation command found by the revocation processing unit from the command submission queue records the command identifier of the first command, the revocation processing unit identifies that the first command is to be revoked.

[0019] According to the third or fourth information processing apparatus of the first aspect of this application, a fifth information processing apparatus according to the first aspect of this application is provided, wherein if the command body of one or more revocation commands in the command submission queue does not record the command identifier of the first command, or the command submission queue does not include a revocation command, the revocation processing unit identifies that the first command is not to be revoked.

[0020] According to one of the first to fifth information processing apparatuses of the first aspect of the present application, a sixth information processing apparatus according to the first aspect of the present application is provided, wherein in response to the cancellation processing unit handing over a first command to the command processing unit, the cancellation processing unit continues to obtain other commands from the command submission queue.

[0021] According to one of the first to sixth information processing apparatuses of the first aspect of this application, a seventh information processing apparatus according to the first aspect of this application is provided, wherein in response to obtaining a revocation command from a command submission queue, the revocation processing unit adds the processing result of the revocation command to a command completion queue without transferring the revocation command to the command processing apparatus.

[0022] According to the seventh information processing apparatus of the first aspect of this application, an eighth information processing apparatus according to the first aspect of this application is provided, wherein if a first command is to be revoked, the revocation processing unit further records the command identifier of the first command and the command identifier of the first revocation command indicating the revocation of the first command in association; in response to obtaining the first revocation command from the command submission queue, the revocation processing unit records the command identifier of one or more commands that were successfully revoked in the processing result of the first revocation command.

[0023] According to one of the first to eighth information processing apparatuses of the first aspect of the present application, a ninth information processing apparatus according to the first aspect of the present application is provided, further comprising a deactivation enable port; in response to the deactivation enable port being set, a deactivation processing unit traverses the command submission queue to identify whether the first command is to be deactivated in response to a first command obtained from the command submission queue.

[0024] According to the ninth information processing apparatus of the first aspect of this application, a tenth information processing apparatus according to the first aspect of this application is provided, wherein in response to the cancellation enable port not being set, the cancellation processing unit forwards the first command to the command processing apparatus in response to the first command obtained from the command submission queue, without recognizing whether the first command is to be cancelled.

[0025] According to one of the first to eighth information processing apparatuses of the first aspect of the present application, an eleventh information processing apparatus according to the first aspect of the present application is provided, further comprising a deregulation enable port; in response to a first command obtained from a command submission queue, the deregulation processing unit further accesses the deregulation enable port; in response to the deregulation enable port being set, the deregulation processing unit traverses the command submission queue to identify whether the first command is to be deregistered.

[0026] According to the eleventh information processing apparatus of the first aspect of this application, a twelfth information processing apparatus according to the first aspect of this application is provided, wherein in response to the cancellation enable port not being set, the cancellation processing unit forwards the first command to the command processing apparatus in response to the first command obtained from the command submission queue, without recognizing whether the first command is to be cancelled.

[0027] According to one of the first to twelfth information processing apparatuses of the first aspect of this application, a thirteenth information processing apparatus according to the first aspect of this application is provided, wherein the command processing apparatus includes a scheduling unit, a state storage unit and one or more command processing units; the state storage unit stores the context of each command being processed by the command processing unit.

[0028] The scheduling unit schedules commands, and one of the command processing units processes commands; the command processing unit processes commands in response to being scheduled.

[0029] According to the thirteenth information processing apparatus of the first aspect of this application, a fourteenth information processing apparatus according to the first aspect of this application is provided, wherein in response to obtaining a first revocation command from a command submission queue, a revocation processing unit accesses a state storage unit according to the command identifier of the command to be revoked indicated by the first revocation command, and sets a revocation flag in the context of commands with the same command identifier stored in the state storage unit.

[0030] According to the fourteenth information processing apparatus of the first aspect of this application, a fifteenth information processing apparatus according to the first aspect of this application is provided, wherein the command processing unit, in response to a cancellation flag being set in the context of one or more second commands it is processing, decides whether to continue processing the second commands.

[0031] According to the fifteenth information processing apparatus of the first aspect of this application, a sixteenth information processing apparatus according to the first aspect of this application is provided, wherein if the command processing unit decides to continue processing the second command, after the processing of the second command is completed, the normal command processing result is added to the command completion queue.

[0032] According to the fifteenth or sixteenth information processing apparatus of the first aspect of this application, a seventeenth information processing apparatus according to the first aspect of this application is provided, wherein if the command processing unit decides to terminate the processing of the second command, a command processing result indicating that the second command has been revoked is generated and added to the command completion queue.

[0033] According to one of the first to seventeenth information processing apparatuses of the first aspect of this application, an eighteenth information processing apparatus according to the first aspect of this application is provided, wherein the information processing apparatus is a media interface controller.

[0034] According to a second aspect of this application, a first UFS storage device according to the second aspect of this application is provided, including a control component and an NVM chip; the control component includes a host interface, a UFS command processing unit, and a media interface controller according to claim 18; the media interface controller is coupled to the NVM chip and sends NVM commands to the NVM chip.

[0035] According to the first UFS storage device of the second aspect of this application, a second UFS storage device according to the second aspect of this application is provided, wherein a UFS command received by the host interface is provided to a UFS command processing unit; the UFS command processing unit, in response to receiving a UFS command, generates a command to be added to the command submission queue of the media interface controller.

[0036] According to the second UFS storage device of the second aspect of this application, a third UFS storage device according to the second aspect of this application is provided, wherein if the UFS command is a task management command indicating an undo function, the UFS command processing unit generates an undo command and adds it to the command submission queue of the media interface controller; wherein the command body of the undo command indicates a command identifier of one or more commands that the UFS command processing unit has provided to the media interface controller.

[0037] According to the third UFS storage device of the second aspect of this application, a fourth UFS storage device according to the second aspect of this application is provided, wherein in response to adding a generated revocation command to the command submission queue of the media interface controller, the UFS command processing unit further sets the revocation enable port of the media interface controller.

[0038] According to one of the first to fourth UFS storage devices of the second aspect of this application, a fifth UFS storage device according to the second aspect of this application is provided, wherein the UFS command processing unit obtains the processing result of the command from the command completion queue of the media interface controller.

[0039] According to the fifth UFS storage device of the second aspect of this application, a sixth UFS storage device according to the second aspect of this application is provided, wherein the UFS command processing unit knows which commands that the revocation command intended to revoke have been successfully revoked based on the processing result of the revocation command obtained from the command completion queue of the media interface controller.

[0040] According to the fifth or sixth UFS storage device of the second aspect of this application, a seventh UFS storage device according to the second aspect of this application is provided, wherein the UFS command processing unit knows which commands that the revocation command intended to revoke have been successfully revoked based on the processing result of the revocation command obtained from the command completion queue of the media interface controller and the processing results of other commands.

[0041] According to a third aspect of this application, a first information processing method according to the third aspect of this application is provided, comprising: obtaining a first command from a command submission queue; traversing the command submission queue to identify whether the first command needs to be revoked; if the first command needs to be revoked, adding a processing result indicating that the first command has been revoked to a command completion queue; and if the first command does not need to be revoked, processing the first command.

[0042] According to the first information processing method of the third aspect of this application, a second information processing method according to the third aspect of this application is provided, wherein each command in the command submission queue includes a command identifier and a command body, and the command identifier uniquely identifies the command being processed.

[0043] According to the first or second information processing method of the third aspect of this application, a third information processing method according to the third aspect of this application is provided, wherein, in order to identify whether a first command is to be revoked, a command submission queue is traversed from the head to the tail to access the revocation commands in the command submission queue, and whether the first command is to be revoked is identified based on whether one or more command identifiers indicated by one or more revocation commands in the command submission queue are the same as the command identifier of the first command.

[0044] According to the third information processing method of the third aspect of this application, a fourth information processing method according to the third aspect of this application is provided, wherein if the command body of the revocation command found in the command submission queue records the command identifier of the first command, it is identified that the first command is to be revoked. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings.

[0046] Figure 1A This is a block diagram of an existing information processing device;

[0047] Figure 1B This is a block diagram of a storage device in the prior art;

[0048] Figure 2A A schematic diagram illustrating a command received by an information processing apparatus according to an embodiment of this application is shown;

[0049] Figure 2B A block diagram of an information processing apparatus according to an embodiment of this application is shown;

[0050] Figure 2C A flowchart illustrating the revocation command according to an embodiment of this application is shown;

[0051] Figure 3A and Figure 3B A schematic diagram illustrating a revocation order according to yet another embodiment of this application is shown;

[0052] Figure 4 A block diagram of an information processing apparatus according to another embodiment of this application is shown;

[0053] Figure 5 A block diagram of a UFS storage device according to yet another embodiment of this application is shown; and

[0054] Figure 6 A block diagram of a UFS storage device according to yet another embodiment of this application is shown. Detailed Implementation

[0055] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0056] Figure 2A A schematic diagram illustrating a command received by an information processing apparatus according to an embodiment of this application is shown.

[0057] To instruct the information processing device to revoke a previous command, a revocation command is provided. An external unit issues a revocation command to the information processing device, which can receive and process the revocation command. The revocation command has a similar structure (e.g., the same size) to other commands processed by the information processing device, and can therefore be added to the command submission queue.

[0058] The information processing device receives various commands through a command submission queue. Figure 2AThe text demonstrates read, write, and undo commands. Understandably, the information processing device may also accept other types of commands.

[0059] Each command added to the command submission queue also has a command identifier. The command identifier uniquely identifies a command that is being processed. A command that has been added to the command submission queue and whose processing result has not yet been retrieved from the command completion queue is called a command that is being processed.

[0060] Figure 2A The undo command shown includes a command identifier "03" and its command body. The command body of the undo command includes a command type (indicating "Undo Command") and one or more command identifiers. The command identifier carried in the command body of the undo command indicates the identifier of the target command that the undo command wishes to revoke. Optionally, the command body of the undo command indicates a special command identifier, which indicates that all commands being processed should be revokeed.

[0061] Command identifiers are attached to commands by external units and added to the command submission queue. This allows external units to know which command identifiers are being used and which commands they are associated with. Thus, by specifying a command identifier in the command body of a revocation command, the target command can be indicated for revocation. Understandably, the revocation command itself also has a command identifier, but the meaning of the command identifier in the revocation command differs from the command identifier in the command body that indicates the target command to be revoked.

[0062] Optionally, the revocation order is not mandatory. The information processing device may, according to its own capabilities, revoke one, part, or all of the orders it has instructed that it wishes to revoke.

[0063] Alternatively, the result of the revoked command can also be communicated to the external unit using the information processing device via the command completion queue.

[0064] Figure 2B A block diagram of an information processing apparatus according to an embodiment of this application is shown.

[0065] The information processing apparatus includes a command submission queue 210, a command completion queue 220, and a command processing unit 260. The information processing apparatus also includes a cancellation processing unit 240 and a cancellation enable port 245.

[0066] The external unit adds a cancellation command to the command submission queue 210. The external unit also sets a cancellation enable port 245 to indicate that a cancellation command has been submitted to the information processing device. The cancellation enable port 245 is, for example, a one-bit register. If the cancellation enable port 245 is not set, the cancellation unit 240 does not operate, and the command processing unit 260 directly retrieves the command to be processed from the command submission queue 210. Alternatively, if the cancellation enable port 245 is not set, the cancellation unit 240 directly forwards the command retrieved from the command submission queue 210 to the command processing unit.

[0067] If the revocation enable port 245 is set, the revocation unit 240 intervenes in processing the command obtained from the command submission queue 210. The revocation unit 240 retrieves the command (the current command) from the command submission queue 210 and extracts its command identifier (denoted as CID). The revocation unit 240 also traverses the command submission queue 210 to search for possible revocation commands. When a revocation command is found, the command identifier carried in the command body of the revocation command is extracted. If one of the command identifiers extracted from the revocation command matches the command identifier CID of the current command, the command is revoked. The revocation processing unit generates a command processing result for the command, indicating that the command has been revoked, and adds the command processing result to the command completion queue 210. The revocation processing unit does not forward the command to the command processing unit 260. In response to the current command being revoked, the revocation processing unit 240 completes the processing of the current command, then obtains the next command from the command submission queue 210 and repeats the above processing procedure.

[0068] If any command identifier extracted from the undo command is inconsistent with the command identifier CID of the current command, the undo processing unit 240 continues to traverse the command submission queue 210 to find other undo commands, and performs the same operation as above on the found undo commands to determine whether to revoke the current command.

[0069] If the command submission queue 210 has been traversed without finding any undo commands, or if any undo commands found do not carry the command identifier (CID), it means that the current command does not need to be undone. Therefore, the undo processing unit 240 forwards the current command to the command processing unit 260 for processing. The command processing unit 260 processes the current command and adds the command processing result to the command completion queue 220.

[0070] If the command obtained by the revocation processing unit 240 from the command submission queue 210 is a revocation command, the revocation processing unit 240 generates a command processing result for the revocation command and adds it to the command completion queue 220 to indicate that the processing of the revocation command is complete. The command processing result of the revocation command may be, for example, the revocation command itself or the command identifier of the revocation command.

[0071] If the cancellation enable port 245 is not set, the command obtained by the cancellation unit 240 from the command submission queue 210 is a cancellation command. The cancellation processing unit 240 also generates a command processing result for the cancellation command and adds it to the command completion queue 220 to indicate that the processing of the cancellation command is complete.

[0072] By providing the cancellation processing unit 240, the information processing device is able to process cancellation commands and cancel target commands that were added to the command submission queue 210 earlier, based on cancellation commands that were added later to the command submission queue 210.

[0073] Understandably, according to embodiments of this application, a revocation command may not necessarily revoke any command currently being processed. Some commands have already been forwarded to command processing unit 260 for processing. Revocation processing unit 240 checks whether commands obtained from command submission queue 210 should be revoked, but does not check whether commands being processed by command processing unit 260 should be revoked. Thus, even if a command is indicated to be revoked by a revocation command, command unit 260 can still process it normally and add the result of normal processing to command completion queue 220.

[0074] Figure 2C A flowchart illustrating the revocation command according to an embodiment of this application is provided.

[0075] The external unit submits commands to the command submission queue 210 of the information processing device (see also...) Figure 2B The external unit generates a revocation command that indicates the target command to be revoked in order to revoke a command submitted to the information processing device. The external unit also provides a revocation enable port 245.

[0076] Figure 2C The processing flow of the cancellation processing unit 240 of the information processing device is shown.

[0077] The revocation processing unit 240 retrieves the first command from the command submission queue 210 (270). The revocation processing unit 240 checks whether the revocation enable port 245 is set (272). If the revocation enable port 245 is not set (272), the revocation processing unit 240 forwards the retrieved first command to the command processing unit 260 (290). Next, the revocation processing unit 240 retrieves the next command from the head of the command submission queue 210 (e.g., returning to step 270).

[0078] If the deregulation enable port 245 is set (272), the deregulation processing unit 240 extracts the command identifier (274) from the first command. The deregulation processing unit 240 also traverses the command submission queue 210 from the head to the tail (276). During the traversal of the command submission queue 210, it identifies whether each queue contains a deregulation command (278). For non-deregulation commands, it skips directly and continues to access the next command in the queue; for deregulation commands, it obtains the identifier of the target command to be deregistered recorded in its command body. Understandably, during the traversal of the command submission queue 210 by the deregulation processing unit 240, each accessed command remains in the command submission queue 210.

[0079] The cancellation processing unit 240 compares the identifier of the target command obtained from the cancellation command with the identifier of the first command (280). If the identifier of the target command obtained from the cancellation command is the same as the identifier of the first command (280), it means that a cancellation command to be cancelled for the first command has been found. In response, a command processing result is generated for the first command and added to the command completion queue 220 (282). For example, the cancellation processing unit 240 adds the first command to the command completion queue 220, or adds the first command with the cancellation mark attached to the command completion queue 220. Next, the cancellation processing unit 240 retrieves the next command from the head of the command submission queue 210 (e.g., returns to step 270).

[0080] If the identifier of any target command obtained from the revocation command is different from the identifier of the first command (280), it means that no revocation command to revoke the first command has been found. In response, the revocation processing unit 240 returns to step 276 to continue traversing the command submission queue 210 to the tail of the queue.

[0081] If the entire command submission queue 210 has been traversed and no undo command (278) is found to undo the first command, proceed to step 290, where the undo processing unit 240 forwards the first command to the command processing unit 260 (290). Next, the undo processing unit 240 retrieves the next command from the head of the command submission queue 210 (e.g., returns to step 270).

[0082] Figure 3A and Figure 3B A schematic diagram illustrating a revocation command according to yet another embodiment of this application is shown.

[0083] See Figure 3ACommands are added to the command submission queue of the information processing device, with their respective command identifiers being "00", "01", ... and "07". The command with identifier "00" is at the head of the queue, while commands with identifiers "04" and "06" are cancellation commands. The command body of the cancellation command with identifier "04" indicates that commands with identifiers "03" and "01" should be cancelled, while the command body of the cancellation command with identifier "06" indicates that commands with identifiers "05" and "00" should be cancelled.

[0084] The revocation processing unit retrieves the command with the command identifier "00" from the head of the command submission queue. Figure 3A As indicated by (1). The cancellation processing unit then obtains whether the cancellation enable port is set ( Figure 3A (As indicated by (2)). Figure 3A In the example, the undo enable port has been set, and the undo processing unit, in response, traverses the command submission queue to identify whether to revoke the command with the command identifier "00" obtained from the command submission queue.

[0085] The cancellation unit traverses the command submission queue from front to back, identifying that commands with identifiers "01", "02", and "03" are not cancellation commands, while the command with identifier "04" is a cancellation command. Figure 3A (As indicated by (3)). The cancellation unit obtains the command body of the cancellation command with command identifier "04", and obtains the command identifiers to be cancelled indicated therein as "03" and "01". These two command identifiers to be cancelled, "03" and "01", are different from the command identifier "00" obtained from the head of the queue. Therefore, the cancellation unit completes the check on the cancellation command with command identifier "04" and continues to traverse the command submission queue.

[0086] The cancellation unit continues to traverse the command submission queue towards the tail, identifying that the command with the identifier "05" is not a cancellation command, while the command with the identifier "06" is a cancellation command. Figure 3A (As indicated by (4)). The cancellation unit obtains the command body of the cancellation command with command identifier "06", and obtains the command identifiers to be cancelled indicated therein as "05" and "00". These two command identifiers to be cancelled, "05" and "00", include the command identifier "00" currently obtained from the head of the queue, so the cancellation unit cancels the command currently obtained from the head of the queue with command identifier "00".

[0087] Continue reading Figure 3B The undo unit appends an "undo" flag to the command body of a command with command identifier "00" and adds it to the command completion queue. Figure 3A (as indicated by (5)).

[0088] Since the command with command identifier "00" has been revoked, even though the tail of the command submission queue has not yet been traversed, the revocation unit no longer continues to search for revocation commands in the command submission queue. Instead, it has completed processing the command with command identifier "00" obtained from the head of the queue. The head of the command submission queue now contains the command with command identifier "01," and the revocation unit continues to obtain and process commands from the head of the queue.

[0089] Figure 4 A block diagram of an information processing apparatus according to another embodiment of this application is shown.

[0090] The information processing device includes a command submission queue 410, a command completion queue 420, a cancellation processing unit 440, a cancellation enable port 445, multiple command processing units (460, 462, 464 and 446), a status storage unit 452 and a scheduling unit 454.

[0091] The external unit adds the revocation command to the command submission queue 410. The external unit also sets the revocation enable port 445 to indicate that a revocation command has been submitted to the information processing device. If the revocation enable port 445 is not set, the revocation unit 440 does not work, and the revocation unit 440 directly forwards the command obtained from the command submission queue 410 to the scheduling unit 454.

[0092] The scheduling unit 454 schedules one of the command processing units (460, 462, 464, or 446) to process the command based on the received command and its status. The command processing unit's processing of the command includes multiple stages. The status storage unit 452 records the context and processing stage of each processed command, so that the command processing unit can temporarily store intermediate results of command processing or continue processing commands that have not yet been completed based on the information in the status storage unit 452.

[0093] If the deactivation enable port 445 is set, the deactivation unit 440 intervenes in the processing of commands obtained from the command submission queue 410.

[0094] According to one embodiment of this application, the cancellation unit 440 retrieves a command (the current command) from the command submission queue 410 and traverses the command submission queue 410 to determine if there is a cancellation command to be cancelled in the command submission queue 410. If the current command is cancelled, the cancellation processing unit 440 adds the processing result of the current command to the command completion queue 420 without forwarding it to the scheduling unit 454. If there is no cancellation command to be cancelled in the command submission queue 410, the cancellation processing unit 440 forwards the current command to the scheduling unit 454. In this embodiment, the cancellation command is for commands pending processing in the command submission queue 410. If a command has already been retrieved from the command submission queue 410 and processed by the command processing unit, it cannot be cancelled.

[0095] In response to the current command retrieved from the head of the command submission queue 410 being an undo command, the undo processing unit 440 generates a processing result for the undo command and adds it to the command completion queue 420, so that the external unit can know from the command completion queue 420 that the undo command has been processed. In response to obtaining an undo command, the undo processing unit 440 no longer traverses the command submission queue 440 to check if there are any commands to be undone in the command submission queue 440. Therefore, an undo command can only undo commands added to the command submission queue 440 before it, and will not affect commands added to the command submission queue 440 after it.

[0096] Optionally, according to another embodiment of this application, in response to receiving a revocation command, the revocation processing unit 440, in addition to adding the processing result of the revocation command to the command completion queue 420, also accesses the state storage unit 452. The revocation processing unit 440 searches the state storage unit 452 for a context of a command with the same command identifier recorded in the state storage unit 452, based on the command identifier of the command that the revocation command wishes to revoke. For the context of a command with the same command identifier recorded in the state storage unit 452, the revocation processing unit 440 also sets a revocation flag in that context. The revocation flag in the command context indicates to the command processing unit that the command wishes to be revoked. In response to the revocation flag being set in the context of the command it is processing, the command processing unit decides whether to continue processing the command. If the command processing unit decides to continue processing the command, after processing the command, it adds a normal command processing result to the command completion queue. If the command processing unit decides to terminate processing the command, it generates a command processing result indicating that the command has been revoked and adds it to the command completion queue. Therefore, if a revocation command is added to the command submission queue 410, and the command that is to be revoked has already been taken from the command submission queue 410 and processed, the revocation processing unit 440 still has the opportunity to request the command processing unit to revoke the command when processing the revocation command.

[0097] Furthermore, the revocation processing unit 440 also records the command identifier of each command it revokes and the command identifier of the corresponding revocation command. Thus, when the revocation processing unit 440 retrieves a revocation command from the command submission queue 410, it can determine whether one or more commands to be revoked indicated by the retrieved revocation command have been revoked by the recorded revocation command identifier and the command identifier of the revoked command. If all the commands to be revoke by the revocation command have been revoked by the revocation processing unit 440, the revocation processing unit does not need to set a revocation flag in the state storage unit 452 according to the revocation command. If one or more commands to be revoke by the revocation command have not yet been revoked by the revocation processing unit 440, the revocation processing unit then accesses the state storage unit 452 according to the revocation command to search for the context of a command with the same command identifier recorded in the state storage unit 452, and sets a revocation flag in that context.

[0098] In response to being scheduled by the scheduling unit 454 to process a command, the command processing unit (460, 462, 464, or 446) retrieves the context and processing stage of the command to be processed from the state storage unit 452 and continues processing the command. Further, before continuing to process a command in response to the scheduling unit 454, the command processing unit (460, 462, 464, or 446) also identifies whether a cancellation flag is set in the command's context. For commands with a cancellation flag set, the processing stage of the command determines whether to terminate the processing of the command. For example, if the command is a read command and the current processing stage is waiting for the storage medium to output the data to be read, in response to the command having a cancellation flag set, the command processing unit no longer waits for the storage medium to output the data to be read, or does not provide the data output by the storage medium to the external unit. As another example, the command is an erase command. The storage command processing takes about 10ms (milliseconds). The command processing stage indicates that the storage medium has processed the erase command for 9.5ms (near completion). Then, the command processing unit does not terminate the processing of the command, but completes the processing and adds the command completion queue 420 according to the erase command processing result given by the storage medium.

[0099] Figure 5 A block diagram of a UFS storage device according to yet another embodiment of this application is shown.

[0100] UFS storage devices include a control unit and one or more NVM chips. The control unit includes a host interface, a UFS command processing unit 500, a media interface controller, and optional memory. The media interface controller couples to one or more NVM chips, sends NVM commands to the NVM chips, and receives the processing results of the NVM chips on the NVM commands. NVM commands are instructions for operating the NVM chips.

[0101] The media interface controller includes a command submission queue 510, a command completion queue 520, a cancellation processing unit 540, a cancellation enable port 545, and a 5NVM command processing unit 560.

[0102] The host interface receives data packets of the UFS protocol, extracts the UFS command, and provides it to the UFS command processing unit 500. In response to the UFS command, the UFS command processing unit 500 generates a command and provides it to the media interface controller through the command submission queue 510, and obtains the processing result of the command from the command completion queue 520.

[0103] The UFS command processing unit 500 attaches a command identifier to each command added to the command submission queue 510. The command identifier uniquely identifies the command being processed by the media interface controller.

[0104] In response to receiving a task management command indicating the revocation function of the UFS protocol, the USF command processing unit 500 generates a revocation command and adds it to the command submission queue 510. The command body of the generated revocation command indicates the command identifier of one or more commands that have been provided to the media interface controller. The USF command processing unit 500 also sets a revocation enable port 545 to instruct the media interface controller's revocation processing unit 540 to check whether the retrieved command should be revoked when retrieving a command from the command submission queue 510.

[0105] For commands that have not been revoked and are retrieved from the command submission queue 510, the revocation processing unit 540 forwards them to the NVM command processing unit 560. The NVM command processing unit 560 issues NVM commands to the NVM chip based on the received commands and obtains the processing results of the NVM commands provided by the NVM chip.

[0106] Optionally, for a revocation command, the revocation processing unit 540 also records the command identifier of the command that was successfully revoked in the processing result of the revocation command. Thus, the UFS command processing unit 500 knows which commands it wished to revoke were successfully revoked, and also knows which commands it wished to revoke were not revoked, based on the processing result of the revocation commands obtained from the command completion queue 520.

[0107] Figure 6 A block diagram of a UFS storage device according to yet another embodiment of this application is shown.

[0108] A UFS storage device includes a control unit and one or more NVM chips. The control unit includes a host interface, a UFS command processing unit 600, a media interface controller, and optional memory. The media interface controller is coupled to one or more NVM chips.

[0109] The media interface controller includes a command submission queue 610, a command completion queue 620, a cancellation processing unit 640, a cancellation enable port 645, multiple NVM command processing units, a state storage unit, and a scheduling unit. Each NVM command processing unit is coupled to an NVM chip. The scheduling unit sends the received command to the corresponding NVM command processing unit for processing based on the NVM chip that the command needs to access.

[0110] The host interface provides UFS commands to the UFS command processing unit 600. In response to processing the UFS commands, the UFS command processing unit 600 generates commands and provides them to the media interface controller through the command submission queue 610, and obtains the processing results of the commands from the command completion queue 620.

[0111] In response to receiving a task management command indicating the revocation function of the UFS protocol, the USF command processing unit 600 generates a revocation command and adds it to the command submission queue 610. The USF command processing unit 600 also sets the revocation enable port 645.

[0112] In response to the revocation enable port 645 being set, the revocation processing unit 640 traverses the command submission queue 610 to check whether a command obtained from the command submission queue 610 should be revoked.

[0113] For commands that have not been revoked and are retrieved from the command submission queue 610, the revocation processing unit 640 forwards them to the scheduling unit.

[0114] Optionally, in response to retrieving a revocation command from the command submission queue 610, the revocation processing unit 640, in addition to adding the processing result of the revocation command to the command completion queue 620, also accesses the state storage unit. Based on the command identifier of the command to be revoked indicated by the command body of the revocation command, the revocation processing unit 640 also sets a revocation flag in the context of a command with the same command identifier recorded in the state storage unit. In response to the revocation flag being set in the context of the command it processes, the NVM command processing unit decides whether to continue processing the command. The command processing result added to the command completion queue 620 by the NVM command processing unit also indicates whether the corresponding command was successfully revoked.

[0115] Optionally, for a revocation command, the revocation processing unit 640 also records the command identifier of the command that was successfully revoked in the processing result of the revocation command. Thus, the UFS command processing unit 600 knows which commands it wished to revoke were successfully revoked, and also knows which commands it wished to revoke were not revoked, based on the processing results of the revocation commands obtained from the command completion queue 620 and the processing results of other commands.

[0116] According to an embodiment of this application, a storage device is also provided, including a controller and a non-volatile memory chip, wherein the controller executes any of the processing methods provided in the embodiments of this application.

[0117] According to embodiments of this application, a program stored on a readable medium is also provided, which, when the controller of the stored device is run, causes the storage device to execute any of the processing methods provided according to embodiments of this application.

[0118] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application. Clearly, those skilled in the art can make various alterations and variations to this application without departing from its spirit and scope. Thus, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A UFS storage device, comprising: Control components and NVM chip; The control components include a host interface, a UFS command processing unit, and a media interface controller. The media interface controller couples to the NVM chip, sends NVM commands to the NVM chip, and receives the processing results of the NVM chip on the NVM commands. The media interface controller includes a command submission queue, a command completion queue, a cancellation processing unit, and a command processing device. The host interface receives data packets of the UFS protocol, extracts UFS commands, and provides them to the UFS command processing unit; The UFS command processing unit responds to processing UFS commands by generating commands and providing them to the media interface controller through the command submission queue, and obtaining the processing results of the commands from the command completion queue; In response to receiving a task management command indicating the revocation function of the UFS protocol, the UFS command processing unit generates a revocation command and adds it to the command submission queue. The command body of the generated revocation command indicates the command identifier of one or more commands that have been provided to the media interface controller. The UFS command processing unit also sets a revocation enable port to instruct the revocation processing unit of the media interface controller to check whether the retrieved command should be revoked when it retrieves a command from the command submission queue. The cancellation processing unit couples the command submission queue with the command processing device; The cancellation processing unit responds to the cancellation enable port being set and to the first command being retrieved from the command submission queue, and traverses the command submission queue to identify whether the first command should be cancelled; wherein, in order to identify whether the first command should be cancelled, the cancellation processing unit traverses the command submission queue from the head to the tail to access the cancellation commands in the command submission queue, and identifies whether the first command should be cancelled based on whether one or more command identifiers indicated by one or more cancellation commands in the command submission queue are the same as the command identifier of the first command; If the first command is to be revoked, the revocation processing unit will instruct the processing result of the revocation of the first command to be added to the command completion queue in order to complete the processing of the first command, without transferring the first command to the command processing device. If the first command must be revoked, the revocation processing unit will hand the first command over to the command processing device.

2. The UFS storage device of claim 1, wherein in response to obtaining a revocation command from the command submission queue, the revocation processing unit adds the processing result of the revocation command to the command completion queue, without transferring the revocation command to the command processing device.

3. The UFS storage device according to claim 2, wherein If the first command is to be revoked, the revocation processing unit also records the command identifier of the first command and the command identifier of the first revocation command that indicates the revocation of the first command. In response to obtaining the first undo command from the command submission queue, the undo processing unit records the command identifier of one or more commands that were successfully undoed in the processing result of the first undo command.

4. The UFS storage device according to claim 3, wherein The command processing device includes a scheduling unit, a state storage unit, and one or more command processing units. The state storage unit stores the context of each command that the command processing device is currently processing; The scheduling unit is one of the command processing units that processes commands. The command processing unit processes commands in response to being scheduled.

5. The UFS storage device according to claim 4, wherein In response to obtaining a first revocation command from the command submission queue, the revocation processing unit accesses the state storage unit according to the command identifier of the command to be revoked indicated by the first revocation command, and sets a revocation flag in the context of the command with the same command identifier stored in the state storage unit.

6. The UFS storage device according to claim 5, wherein In response to the undo flag being set in the context of one or more second commands being processed, the command processing unit decides whether to continue processing the second command.

7. An information processing method for a UFS storage device, wherein the UFS storage device comprises: Control components and NVM chip; The control components include a host interface, a UFS command processing unit, and a media interface controller. The media interface controller couples to the NVM chip, sends NVM commands to the NVM chip, and receives the processing results of the NVM chip on the NVM commands. The media interface controller includes a command submission queue, a command completion queue, a cancellation processing unit, and a command processing device. The method includes: The host interface receives data packets of the UFS protocol, extracts UFS commands, and provides them to the UFS command processing unit; The UFS command processing unit responds to processing UFS commands by generating commands and providing them to the media interface controller through the command submission queue, and obtaining the processing results of the commands from the command completion queue; In response to receiving a task management command indicating the revocation function of the UFS protocol, the UFS command processing unit generates a revocation command and adds it to the command submission queue. The command body of the generated revocation command indicates the command identifier of one or more commands that have been provided to the media interface controller. The UFS command processing unit also sets a revocation enable port to instruct the revocation processing unit of the media interface controller to check whether the retrieved command should be revoked when it retrieves a command from the command submission queue. The cancellation processing unit responds to the cancellation enable port being set and to the first command being retrieved from the command submission queue, and traverses the command submission queue to identify whether the first command should be cancelled; wherein, in order to identify whether the first command should be cancelled, the cancellation processing unit traverses the command submission queue from the head to the tail to access the cancellation commands in the command submission queue, and identifies whether the first command should be cancelled based on whether one or more command identifiers indicated by one or more cancellation commands in the command submission queue are the same as the command identifier of the first command; If the first command is to be revoked, the revocation processing unit will instruct the processing result of the revocation of the first command to be added to the command completion queue in order to complete the processing of the first command, without transferring the first command to the command processing device. If the first command must be revoked, the revocation processing unit will hand over the first command to the command processing device for processing.

Citation Information

Patent Citations

  • Dynamic issue masks for processor hang prevention

    US20160092233A1