EP-4352616-B1 - ABORT HANDLING BY HOST CONTROLLER FOR STORAGE DEVICE
Inventors
- CHOU, CHIH-CHIEH
- WANG, CHIA-CHUN
- WANG, LIANG-YEN
- CHENG, CHIN-CHIN
- LIU, SZU-CHI
Dates
- Publication Date
- 20260506
- Application Date
- 20220429
Claims (15)
- A method (500) performed by a host system (100) coupled to a storage device (150), comprising: initiating (510) an abort of a command that has been placed into a submission queue, SQ, of the host system (100); identifying (520) at least one of a first outcome and a second outcome, wherein, when the first outcome indicates that the command is not completed and the second outcome indicates that a SQ entry has been fetched from the SQ, the method (500) further comprises: sending (531) an abort request from the host system (100) to the storage device (150); and issuing (532) a cleanup request to direct a host controller (120) to reclaim host hardware resources allocated to the command; and adding (540) a completion queue, CQ, entry to a CQ and setting an overall command status, OCS, value of the CQ entry based on at least one of the first outcome and the second outcome.
- The method (500) of claim 1, wherein the second outcome indicates that the SQ entry has been fetched from the SQ when the SQ entry is before and including an entry pointed to by a head pointer of the SQ.
- The method (500) of claim 1, wherein the OCS value is set to indicate command abort under a scenario in which the first outcome indicates that the execution of the command is not completed and the second outcome indicates that the SQ entry has been fetched from the SQ; or wherein the OCS value is set to indicate command nullification under a scenario in which the first outcome indicates that the execution of the command is not completed and the second outcome indicates that the SQ entry for the command has not been fetched from the SQ.
- The method (500) of claim 1, further comprising: setting the OCS value to indicate command abort after the host controller (120) receives the cleanup request; or wherein the method (500) further comprises: setting the OCS value to indicate command nullification after the host controller (120) detects that the SQ entry for the command has been marked by a host driver (130) as nullified.
- The method (500) of claim 1, wherein the OCS value is set to indicate command completion after the host system (100) receives the command completion response from the storage device (150).
- The method (500) of claim 1, further comprising: resetting, by a host driver (130), a 1-bit value in an abort interface (175) between the host driver (130) and the host controller (120) to stop the host controller (120) from further fetching entries from the SQ; and setting the 1-bit value in the abort interface (175) to direct the host controller (120) to resume fetching from the SQ.
- The method (500) of claim 1, wherein issuing the cleanup request further comprises: setting, by a host driver (130), a 1-bit value in a cleanup interface (185) between the host driver (130) and the host controller (120) to direct the host controller (120) to clean up the host hardware resources allocated to the command; and after cleaning up the host hardware resources, the host controller (120) resetting the 1-bit value in the cleanup interface (185).
- The method (500) of claim 1, wherein the host system (100) communicates with the storage device (150) according to a Universal Flash Storage, UFS, standard.
- A host system (100) that is coupled to a storage device (150), comprising: a host controller (120); memory (110) to store a plurality of submission queues (125), SQs, and a plurality of completion queues (126), CQs; and one or more processors (190), wherein the host system (100) is operative to: initiate (510) an abort of a command that has been placed into an SQ; identify (520) at least one of a first outcome and a second outcome, wherein, when the first outcome indicates that the command is not completed and the second outcome indicates that a SQ entry has been fetched from the SQ, the host system (100) is further operative to: send (531) an abort request to the storage device (150); and issue (532) a cleanup request to direct the host controller (120) to reclaim host hardware resources allocated to the command; and add (540) a CQ entry to a CQ and set an overall command status, OCS, of the CQ entry based on at least one of the first outcome and the second outcome.
- The host system (100) of claim 9, wherein the second outcome indicates that the SQ entry has been fetched from the SQ when the SQ entry is before and including an entry pointed to by a head pointer of the SQ.
- The host system (100) of claim 9, wherein the OCS value is set to indicate command abort under a scenario in which the first outcome indicates that the execution of the command is not completed and the second outcome indicates that the SQ entry has been fetched from the SQ; or wherein the OCS value is set to indicate command nullification under a scenario in which the first outcome indicates that the execution of the command is not completed and the second outcome indicates that the SQ entry for the command has not been fetched from the SQ.
- The host system (100) of claim 9, wherein the OCS value is set to indicate command abort after the host controller (120) receives the cleanup request; or wherein the OCS value is set to indicate command nullification after the host controller (120) detects that the SQ entry for the command has been marked by a host driver (130) as nullified.
- The host system (100) of claim 9, wherein the OCS value is set to indicate command completion after the host system (100) receives the command completion response from the storage device (150).
- The host system (100) of claim 9, further comprising an abort interface (175) between a host driver (130) and the host controller (120), wherein the host driver (130) operative to reset a 1-bit value in the abort interface (175) to stop the host controller (120) from further fetching entries from the SQ, and to set the 1-bit value in the abort interface (175) to direct the host controller (120) to resume fetching from the SQ; or wherein the host system (100) further comprises an abort interface between a host driver (130) and the host controller (120), wherein the host driver (130) operative to set a 1-bit value in the cleanup interface (185) to direct the host controller (120) to clean up the host hardware resources allocated to the command, and the host controller (120) operative to reset the 1-bit value in the cleanup interface (185) after cleaning up the host hardware resources.
- The host system (100) of claim 9, wherein the host system (100) communicates with the storage device (150) according to a Universal Flash Storage, UFS, standard.
Description
TECHNICAL FIELD Embodiments of the invention relate to a storage device; more specifically, to the management of data transfer between a host and a storage device. BACKGROUND An electronic system typically includes a host coupled to a storage device. The host and the storage device is interconnected through an interface such as a Universal Flash Storage (UFS) interface, a Serial Advanced Technology Attachment (SATA) interface, a Small Computer Small Interface (SCSI), a Serial Attached SCSI (SAS), an embedded Multi-Media Card (eMMC) interface, etc. The UFS interface is primarily for use in mobile systems between a host and a non-volatile memory (NVM) storage device. The host includes a host controller, which is responsible for managing data transfer between host software and a UFS storage device. When an error condition occurs in the electronic system, host software may abort a data transfer command. For example, an error condition may be caused by a software crash, electrical or network problems, or other abnormalities during runtime. However, a race condition may arise between a) the host controller sending a command to be aborted to the storage device, and b) the storage device responding to the host software's query on whether the command has been received by the device. There is no certainty regarding whether or not the storage device has received the command to be aborted. This situation may occur when the host controller has fetched the command but is too busy to send it to the storage device. Without this certainty, the host software may repeatedly query the storage device to check whether the storage device has received the command. The repeated queries can result in an increase in latency and data transmissions between the host and the storage device. Thus, there is a need for improving the management of data transfers between a host and a storage device. US 2015/178017 A1 and US 10 572 180 B1 disclose an abort command issued by the host system to a storage device and receiving information on the completion of the abort command from the storage device. SUMMARY In a first aspect, a method is performed by a host system coupled to a storage device. The method comprises: initiating an abort of a command that has been placed into a submission queue (SQ) of the host system, and identifying at least one of a first outcome and a second outcome. When the first outcome indicates that the command is not completed and the second outcome indicates that the SQ entry has been fetched from the SQ, the method further comprises: sending an abort request from the host system to the storage device, and issuing a cleanup request to direct a host controller to reclaim host hardware resources allocated to the command. A completion queue (CQ) entry is added to a CQ and an overall command status (OCS) value of the CQ entry is set based on at least one of the first outcome and the second outcome. In an embodiment of the first aspect, the second outcome indicates that the SQ entry has been fetched from the SQ when the SQ entry is before and including an entry pointed to by a head pointer of the SQ. In an embodiment of the first aspect, the OCS value is set to indicate command abort under a scenario in which the first outcome indicates that the execution of the command is not completed and the second outcome indicates that the SQ entry the SQ entry has been fetched from the SQ. In an embodiment of the first aspect, the method further comprises: setting the OCS value to indicate command abort after the host controller receives the cleanup request. In an embodiment of the first aspect, the OCS value is set to indicate command nullification under a scenario in which the first outcome indicates that the execution of the command is not completed and the second outcome indicates that the SQ entry for the command has not been fetched from the SQ. In an embodiment of the first aspect, the method further comprises: setting the OCS value to indicate command nullification after the host controller detects that the SQ entry for the command has been marked by a host driver as nullified. In an embodiment of the first aspect, the OCS value is set to indicate command completion after the host system receives the command completion response from the storage device. In an embodiment of the first aspect, the method further comprises: resetting, by a host driver, a 1-bit value in an abort interface between the host driver and the host controller to stop the host controller from further fetching entries from the SQ; and setting the 1-bit value in the abort interface to direct the host controller to resume fetching from the SQ. In an embodiment of the first aspect, issuing the cleanup request further comprises: setting, by a host driver, a 1-bit value in a cleanup interface between the host driver and the host controller to direct the host controller to clean up the host hardware resources allocated to the command; and after cleaning up the host h