Electronic device for detecting error in field of protocol information unit and operating method thereof

By detecting the length of the extra header segment of the protocol information unit in the controller of the electronic device, the problem of difficulty in processing protocol information units that do not meet the predefined standards is solved, the effective discarding of erroneous protocol information units is realized, and the accuracy of data transmission is improved. sex and efficiency.

CN118740701APending Publication Date: 2024-10-01SK HYNIX INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311531831.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-03-28
Filing Date
2023-11-16
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

When existing storage devices process protocol information units that do not meet predefined standards, it is difficult to effectively detect and discard erroneous protocol information units, resulting in an increase in system burden.

Method used

An electronic device is designed whose controller is capable of receiving a protocol information unit sent by an external device and detecting errors by checking the length of the extra header segment. If the length is equal to or greater than a threshold, an error message is generated and the protocol information unit is discarded.

Benefits of technology

Effectively detects and discards erroneous protocol information units, reducing the processing burden on the storage system and improving the accuracy and efficiency of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740701A_ABST
    Figure CN118740701A_ABST
Patent Text Reader

Abstract

The disclosure relates to an electronic device detecting an error in a field of a protocol information unit and a method of operating the same. Provided herein may be an electronic device and a method of operating the same. An electronic device may include: a memory device; and a controller configured to receive an inbound protocol information unit (PIU) from an external device and control the memory device based on the inbound PIU, in which the inbound PIU includes a base header segment containing information on an extra header segment (EHS) length and an extra header segment defined by the EHS length, and wherein the controller is configured to generate an error message depending on whether the PIU includes an error associated with an additional header segment.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Korean Patent Application No. 10-2023-0040502, filed on March 28, 2023, the disclosure of which is incorporated herein by reference in its entirety. Technical Field

[0003] Various embodiments of the present disclosure relate generally to electronic devices, and more particularly, to electronic devices for detecting errors in fields of protocol information units and methods of operating the electronic devices. Background Art

[0004] A storage device is a device that stores data under the control of a host device such as a computer or a smartphone. A storage device may include a memory device that stores data and a memory controller that controls the memory device. A memory device may be classified into a volatile memory device and a nonvolatile memory device.

[0005] The storage device may communicate with the host device using a data packet called a protocol information unit. When a protocol information unit is generated using a method that does not conform to a predefined standard, the protocol information unit needs to be discarded without being sent. Summary of the invention

[0006] Various embodiments of the present disclosure relate to an electronic device capable of detecting an error in a field of a protocol information unit.

[0007] An embodiment of the present disclosure may provide an electronic device. The electronic device may include a memory device and a controller, the controller being configured to receive an inbound protocol information unit (PIU) from an external device and control the memory device based on the inbound PIU, wherein the inbound PIU includes: a basic header segment including information about an extra header segment (EHS) length; and an extra header segment defined by the EHS length, and wherein the controller is further configured to generate an error message according to whether the inbound PIU includes an error related to the extra header segment.

[0008] Embodiments of the present disclosure may provide a method for operating an electronic device that communicates with an external device through a protocol information unit (PIU). The method for operating an electronic device may include: receiving the PIU from the external device; obtaining an extra header segment (EHS) length from the PIU; and generating an error message when the EHS length is equal to or greater than a first value.

[0009] An embodiment of the present disclosure may provide a storage device. The storage device includes: a memory device; and a controller configured to control the memory device to operate based on a protocol information unit (PIU), and when the PIU includes a value of an extra header segment (EHS) length and the value is greater than a threshold, the PIU is discarded without controlling the memory device. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 is a block diagram of a storage system according to an embodiment of the present disclosure.

[0011] Figure 2 It is shown Figure 1 A block diagram of an embodiment of a host is shown in FIG.

[0012] Figure 3 is a diagram for describing a data communication unit between a host controller and a memory controller.

[0013] Figure 4 is a diagram for describing the structure of a basic header segment of a protocol information unit (PIU) included in a command.

[0014] Figure 5 is a diagram describing the structure of a command descriptor block.

[0015] Figure 6 is a block diagram illustrating an extra header segment (EHS) error handler according to an embodiment of the present disclosure.

[0016] Figure 7 is a flow chart illustrating the operation of an EHS error handler according to an embodiment of the present disclosure.

[0017] Figure 8 is a sequence diagram illustrating an error detection operation according to an embodiment of the present disclosure.

[0018] Fig. 9 is a sequence diagram illustrating an error detection operation according to an embodiment of the present disclosure.

[0019] Fig.10 is a block diagram illustrating an EHS error handler according to an embodiment of the present disclosure.

[0020] Fig.11 is a flow chart illustrating the operation of an EHS error handler according to an embodiment of the present disclosure.

[0021] Fig.12 is a flow chart illustrating the operation of an EHS error handler according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0022] The specific structural or functional descriptions in the embodiments of the present disclosure introduced in this specification are provided as examples to describe the embodiments according to the concept of the present disclosure. The embodiments according to the concept of the present disclosure can be practiced in various forms and should not be interpreted as being limited to the embodiments described in this specification.

[0023] Figure 1 is a block diagram of a storage system according to an embodiment of the present disclosure.

[0024] Reference Figure 1 , the storage system may include a host 50 and a storage device 300. The host 50 may include a host memory 100 and a host controller 200.

[0025] The host controller 200 may manage an operation of storing data stored in the host memory 100 in the memory device 320 of the storage device 300 or storing data stored in the memory device 320 of the storage device 300 in the host memory 100 .

[0026] In some embodiments, the host controller 200 and the host memory 100 may be implemented as separate semiconductor chips. Alternatively, in some embodiments, the host controller 200 and the host memory 100 may be integrated into the same semiconductor chip. Figure 2 The details of the host computer 50 are described.

[0027] The storage device 300 may include a memory device 320 and a memory controller 310. The storage device 300 may be a device that stores data under the control of the host 50, such as a mobile phone, a smart phone, an MP3 player, a laptop computer, a desktop computer, a game console, a television, a tablet computer, or an in-vehicle infotainment system. Alternatively, the storage device 300 may be a device that stores large-capacity data in one place (such as a server or a data center) under the control of the host 50.

[0028] The storage device 300 may be manufactured as any of a variety of types of storage devices depending on a host interface as a scheme for communicating with the host 50. For example, the storage device 300 may be implemented as any of a variety of types of storage devices, such as a solid state disk (SSD), a multimedia card (e.g., MMC, embedded MMC (eMMC), reduced size MMC (RS-MMC), or micro MMC), a secure digital card (e.g., SD, mini SD, or micro SD), a universal serial bus (USB) storage device, a universal flash memory (UFS) device, a personal computer memory card international association (PCMCIA) card type storage device, a peripheral component interconnect (PCI) card type storage device, a PCI Express (PCI-e or PCIe) card type storage device, a compact flash (CF) card, a smart media card, and a memory stick.

[0029] The memory device 300 may be manufactured in any of a variety of packaging formats. For example, the memory device 300 may be manufactured in any of a variety of packaging formats, such as package on package (POP), system-in-package (SIP), system on chip (SOC), multi-chip package (MCP), chip on board (COB), wafer-level manufacturing package (WFP), and wafer-level stacked package (WSP).

[0030] The memory device 320 may store data. The memory device 320 may operate under the control of the memory controller 310. The memory device 320 may include a memory cell array (not shown) including a plurality of memory cells storing data.

[0031] Each memory cell may be implemented as a single-level cell (SLC) capable of storing one data bit, a multi-level cell (MLC) capable of storing two data bits, a triple-level cell (TLC) capable of storing three data bits, or a quad-level cell (QLC) capable of storing four data bits.

[0032] The memory cell array (not shown) may include a plurality of memory blocks. Each memory block may include a plurality of memory cells. Each memory block may include a plurality of pages. In some embodiments, a page may be a unit for storing data in the memory device 320 or a unit for reading data stored in the memory device 320. A memory block may be a unit for erasing data.

[0033] In some embodiments, the memory device 320 may take many alternative forms, such as double data rate synchronous dynamic random access memory (DDR SDRAM), low power double data rate fourth generation (LPDDR4) SDRAM, graphic double data rate (GDDR) SDRAM, low power DDR (LPDDR) SDRAM, Rambus dynamic random access memory (RDRAM), NAND flash memory, vertical NAND flash memory, NOR flash memory, resistive RAM (RRAM), phase change RAM (PRAM), magnetoresistive RAM (MRAM), ferroelectric RAM (FRAM) or spin transfer torque RAM (STT-RAM). In this specification, for the convenience of description, the memory device 320 is described as a NAND flash memory.

[0034] The memory device 320 may receive a command and an address from the memory controller 310, and may access an area of ​​the memory cell array selected by the address. The memory device 320 may perform an operation indicated by the command on the area selected by the address. For example, the memory device 320 may perform a write operation (i.e., a programming operation), a read operation, and an erase operation. During a programming operation, the memory device 320 may program data to an area selected by the address. During a read operation, the memory device 320 may read data from an area selected by the address. During an erase operation, the memory device 320 may erase data stored in an area selected by the address.

[0035] The memory controller 310 may control overall operations of the memory device 300 .

[0036] When power is applied to the memory device 300 , the memory controller 310 may run firmware (FW). When the memory device 320 is a flash memory device, the memory controller 310 may run firmware such as a flash translation layer (FTL) to control communication between the host 50 and the memory device 320 .

[0037] In some embodiments, the memory controller 310 may receive data and a logical block address (LBA) from the host 50, and may convert the logical block address (LBA) into a physical block address (PBA) indicating an address of a storage unit included in the memory device 320 and where the data is to be stored.

[0038] The memory controller 310 may control the memory device 320 so that a program operation, a read operation, or an erase operation is performed in response to a request received from the host 50. During a program operation, the memory controller 310 may provide a program command, a physical block address, and data to the memory device 320. During a read operation, the memory controller 310 may provide a read command and a physical block address to the memory device 320. During an erase operation, the memory controller 310 may provide an erase command and a physical block address to the memory device 320.

[0039] Here, in this specification, information sent / received between the host 50 and the memory controller 310 may be referred to as a request or command. In some embodiments, the host 50 and the memory controller 310 may communicate with each other using a data packet called a "protocol information unit (PIU)". The PIU may be a type of data packet generated based on a predefined standard. In some embodiments, the PIU may include a basic header segment, a transaction specific field, an additional header segment, and a data segment. This will be referred to later. Figure 3 Describe it in detail.

[0040] In some embodiments, the host controller 200 may include an extra header segment (EHS) error handler 210. In some embodiments, the EHS error handler 210 may perform an EHS error handling operation on a PIU generated by the host 50 or a PIU received from the storage device 300. The EHS error handling operation may be an operation of discarding a PIU containing an EHS error according to whether the PIU contains an EHS error.

[0041] An EHS error may indicate a case where the EHS included in the PIU does not conform to a predefined standard. For example, an EHS error may be a case where a PIU type that does not support EHS in the standard includes EHS, or a case where a PIU includes an EHS whose length is equal to or greater than the length supported in the standard. That is, an EHS error may refer to an incorrect use of EHS.

[0042] In addition, in this specification, information provided by the memory controller 310 to the memory device 320 may be referred to as a command. In some embodiments, the memory controller 310 may generate commands, addresses, and data internally, regardless of whether a request from the host 50 is received, and may send them to the memory device 320. For example, the memory controller 310 may provide the memory device 320 with the required commands, addresses, and data in order to perform programming operations, read operations, and erase operations involved in performing wear leveling, read reclamation, garbage collection, and the like.

[0043] In some embodiments, the memory controller 310 may control two or more memory devices 320. In this case, the memory controller 310 may control the memory devices 320 according to an interleaving scheme to improve operation performance. The interleaving scheme may be a scheme for controlling the memory devices 320 so as to cause the operations of at least two memory devices 320 to overlap with each other.

[0044] The host 50 may communicate with the storage device 300 using at least one of a variety of communication standards or interfaces, such as universal serial bus (USB), serial AT attachment (SATA), serial attached SCSI (SAS), high-speed inter-chip (HSIC), small computer system interface (SCSI), peripheral component interconnect (PCI), PCI Express (PCIe), non-volatile memory express (NVMe), universal flash memory (UFS), secure digital (SD), multimedia card (MMC), embedded MMC (eMMC), dual in-line memory module (DIMM), registered DIMM (RDIMM), and load reduced DIMM (LRDIMM) communication methods.

[0045] Figure 2 It is shown Figure 1A block diagram of an embodiment of a host is shown.

[0046] Reference Figure 1 and Figure 2 , the host 50 can communicate with the storage device 300 based on the UFS interface.

[0047] The host 50 may include a host memory 100, a software module SW, and a host controller 200 corresponding to a hardware module. The software module SW may include application software and a UFS host controller driver. The application software may be a variety of application programs running on the host 50, and the UFS host controller driver may manage the driving of peripheral devices connected to and used by the host 50. The application software and the UFS host controller driver may be loaded into the host memory 100 or may be loaded into an additional memory in the host 50 and executed by a processor.

[0048] The host controller 200 may include a UFS transfer protocol layer (UTP), a host controller interface (HCI), and a UFS interconnect layer (UIC).

[0049] UTP can provide services for the upper layer (or application layer). For example, UTP can generate a PIU for sending / receiving data or requests, or depacketize or analyze received data packets.

[0050] The HCI may receive the generated request through the UFS host controller driver and transfer the request to the UTP, and may transfer a result of the data access received from the UTP to the UFS host controller driver.

[0051] In some embodiments, the HCI may include an EHS error handler 210. When a PIU generated by the UTP contains an EHS error, the EHS error handler 210 may discard the PIU without transmitting the PIU to the storage device 300.

[0052] In addition, the UIC can communicate with the storage device 300 and can provide information received from the storage device 300 to the upper layer (i.e., UTP). In some embodiments, the UIC may include a link layer and a physical (PHY) layer. The link layer may be a mobile industry processor interface unified protocol (MIPI UniPro), and the physical (PHY) layer may be MIPI M-PHY.

[0053] Figure 3 is a diagram for describing a data communication unit between a host controller and a memory controller.

[0054] Reference Figure 1 and Figure 3, the host controller 200 and the memory controller 310 may communicate with each other using a data packet called a PIU.

[0055] From the perspective of physical devices, the host controller 200 may be included in the host 50, and the memory controller 310 may be included in the storage device 300. From the perspective of the interface between the two devices, one device may send a PIU to another device. In this case, the device that generates the PIU may be referred to as an "initiator device", and the device that receives the generated PIU may be referred to as a "target device". That is, the PIU may be a data packet sent between the host 50 and the storage device 300, rather than a data packet sent unidirectionally from one of the host 50 and the storage device 300 to the other device.

[0056] According to the operation desired to be performed by the host 50 or the memory controller 310, the PIU may include a command PIU, a response PIU, a data output PIU, a data input PIU, and a prepare transfer PIU.

[0057] The command PIU may be a PIU sent when the host 50 transmits a command to the storage device 300 .

[0058] The response PIU may be a PIU transmitted when the storage device 300 provides a response to a command provided from the host 50 .

[0059] The data-out PIU may be a PIU transmitted when the host 50 provides data to the storage device 300 .

[0060] The data input PIU may be a PIU transmitted when the storage device 300 provides data to the host 50 .

[0061] The ready to transfer PIU may be a PIU sent when the storage device 300 notifies the host 50 that the storage device 300 is ready to receive a data output PIU from the host 50. When the storage device 300 has enough buffer space to store data provided from the host 50, the ready to transfer PIU may be sent.

[0062] The minimum size of the PIU may be 32 bytes, and the maximum size of the PIU may be 65600 bytes. The format of the PIU may have different sizes according to the type of the PIU.

[0063] The PIU may include a basic header segment 61, a transaction specific field (or fields) 62, an EHS 63, and a data segment 64. The basic header segment 61 may have a size of 12 bytes. The basic header segment 61 may be commonly included in all PIUs.

[0064] The transaction specific field 62 may be included in an area ranging from byte addresses 12 to 30 of the PIU. Depending on the type of PIU, the transaction specific field 62 may include a dedicated transaction code.

[0065] When the total EHS length field of the basic header segment 61 has a non-zero value, the EHS 63 may be defined. The EHS 63 may start from the byte address 32 of the PIU. The EHS 63 may be an area where data may be additionally stored when sufficient information is not included in the basic header segment 61.

[0066] The data segment 64 may be included in the data-out PIU or the data-in PIU, and may not be included in the remaining PIUs.

[0067] In some embodiments, the EHS 63 and the data segment 64 may be included only in a specific PIU instead of being included in all PIUs. For example, the command PIU may include the EHS 63, and the data output PIU may not include the EHS 63. When the data output PIU includes the EHS 63, the PIU may be a PIU with an EHS error.

[0068] Figure 4 is a diagram for describing the structure of a basic header segment of a protocol information unit (PIU) included in a command.

[0069] Reference Figure 4 The basic header segment 61 may include transaction type, flag, logical unit number (LUN), task tag, initiator ID, command set type, query function / task management function (Query Function / Task Manag.Function), response, status, total EHS length, device information and data segment length.

[0070] The transaction type may have a unique value according to the type of PIU. As shown in Table 1 below, examples of transaction types according to the type of PIU are shown.

[0071] Table 1

[0072]

[0073] The flag may indicate a field having different values ​​according to a transaction type. The logical unit number (LUN) may be a field indicating the number of a logical unit on which a corresponding operation is to be performed among a plurality of logical units included in a target on which an operation is performed.

[0074] A task tag can be a field that has different values ​​depending on the issue type.

[0075] The initiator ID may be a field for identifying who is the initiator who requests the corresponding operation. Therefore, in the case where the host generates the PIU and in the case where the storage device generates the PIU, the initiator ID may have different values.

[0076] The command set type may be a field included in the command PIU and the response PIU. The command set type may be a field indicating an interface supporting each command as to whether the corresponding command is a SCSI command, a UFS command, or a command defined by a manufacturer.

[0077] The query function / task management function may be a field input to the PIU, such as a query request, a query response, or a task management request.

[0078] The response field may be a field indicating whether the execution of the requested operation is successful or failed. The status field may be a field indicating the SCSI status.

[0079] The total EHS length may be a field indicating the size of the EHS in units of 32 bits. The total EHS length may be used when the PIU includes the EHS. The EHS length may be in units of 4 bytes. The value of the total EHS length may be obtained by dividing the total number of bytes of the EHS by 4. The maximum length of the EHS may be 1024 bytes. When the EHS is not used, the total EHS length may be 0.

[0080] The device information may include information that is used only when performing a specific function.

[0081] The data segment length may be a field indicating the length of the data segment of the PIU. When the PIU does not include the data segment, the data segment length may be 0.

[0082] Figure 5 is a diagram describing the structure of a command descriptor block.

[0083] Figure 5 The security protocol in a command descriptor block (CDB) or the security protocol outside the CDB may be shown.

[0084] Reference Figure 5 , the CDB may be included in the transaction specific field of the command PIU. In an example, the CDB may include bytes zero to eleven (0 to 11). The columns of the CDB may indicate the corresponding bits of each byte in the CDB. For example, each byte may include bits zero to seven (0 to 7). The bits zero to seven (0 to 7) of the zeroth byte (0) in the CDB may indicate an operation code (OP code). For example, the operation code of the command may be A2h (security protocol input command) or B5h (security protocol output command).

[0085] In the following, in the case of a security protocol input / output command, the first byte (1) of the CDB may indicate the security protocol. For example, the security protocol may be set to 'ECH'. The second and third bytes (2 and 3) of the security protocol input / output command CDB may indicate security protocol specific fields. For example, when the security protocol is set to 'ECH', the second and third bytes (2 and 3) may specify a replay protection memory block (RPMB) protocol ID, and the seventh bit (7) of the fourth byte (4) may be set to '0' to specify an allocation length or transfer length field to indicate the number of bytes to be transferred.

[0086] The 0th to 6th bits (0 to 6) of the fourth byte (4) and the fifth byte (5) of the safety protocol input / output command CDB may be a reserved block. The sixth to ninth bytes (6 to 9) of the safety protocol input / output command CDB may be an allocation length field or a transfer length field. The tenth byte (10) of the safety protocol input / output command CDB may be a reserved block. The eleventh byte (11) of the safety protocol input / output command CDB may include a control field. For example, the control field may be '00h'.

[0087] Figure 6 is a block diagram illustrating an EHS error handler according to an embodiment of the present disclosure.

[0088] Reference Figure 1 and Figure 6 , the EHS error handler 210 may include a PIU extraction unit 211, a comparison unit 212, and a buffer 213. The EHS error handler 210 may perform an EHS error processing operation.

[0089] In some embodiments, when the initiator is the host 50 and the target is the storage device 300, the EHS error handler 210 may detect a PIU containing an EHS error and may discard the detected PIU without transmitting it to the storage device 300. In addition, when the initiator is the storage device 300 and the target is the host 50, the EHS error handler 210 may detect a PIU containing an EHS error and may discard the detected PIU without transmitting it to the UTP.

[0090] The PIU extraction unit 211 may receive a PIU provided from an initiator. The PIU extraction unit 211 may receive a PIU generated by a UTP or provided from a storage device 300. The PIU extraction unit 211 may obtain an EHS length from the received PIU. In some embodiments, the PIU extraction unit 211 may extract an EHS length from a value of a total EHS length field of the PIU. The PIU extraction unit 211 may send the EHS length obtained from the PIU to the comparison unit 212.

[0091] The received PIU may be a data-in PIU, a data-out PIU, a command PIU, or a response PIU.

[0092] In some embodiments, the EHS length may be Figure 4 For example, the PIU extraction unit 211 may extract an EHS length having a value of '0' from the Total EHS Length field of the data input PIU.

[0093] The comparison unit 212 may compare the EHS length with the first value as to whether the EHS length is equal to or greater than the first value. In some embodiments, the first value may be '4'. The first value may be included in the threshold information disclosed in the predefined standard. The threshold information may be information including a threshold required to generate a PIU without causing an EHS error. The first value may be a maximum value that the EHS length may have.

[0094] In some embodiments, when the EHS length is equal to or greater than the first value, the comparison unit 212 may generate an error message to be sent to the software module SW. The error message may indicate that there is an EHS error in the PIU. When the EHS length is less than the first value, the comparison unit 212 may generate a pass message to be sent to the buffer 213. The pass message may indicate that there is no EHS error in the PIU.

[0095] Buffer 213 may temporarily store the provided PIU. In some embodiments, buffer 213 may be included in Figure 1 The buffer 213 may transmit the PIU from the initiator device to the target device in response to the through message indicating that the EHS length is less than the first value. For example, in response to the through message, when the initiator device is the host 50, the buffer 213 may transmit the PIU from the UTP to the storage device 300, and when the initiator device is the storage device 300, the buffer 213 may transmit the PIU from the storage device 300 to the UTP.

[0096] In some embodiments, when EHS error handler 210 performs an EHS error detection operation on a PIU generated by UTP, buffer 213 may output the PIU to storage device 300. When EHS error handler 210 performs an EHS error detection operation on a PIU received from storage device 300, buffer 213 may output the PIU to UTP.

[0097] That is, when an EHS error is detected in the received PIU, the EHS error handler 210 may discard the received PIU and may send an error message to the software module SW. When no EHS error is detected in the received PIU, the EHS error handler 210 may send the PIU generated by the initiator device to the target device.

[0098] exist Figure 6 In the present invention, although the EHS error handler 210 included in the host controller 200 is described as performing an EHS error handling operation on a PIU generated by the host 50 or a PIU received from the memory device 300, the present disclosure is not limited thereto, and the memory controller 310 may include an EHS error handler (not shown).

[0099] In some embodiments, the EHS error handler included in the memory controller 310 may operate in a manner similar to the EHS error handler 210. The EHS error handler included in the memory controller 310 may perform an EHS error handling operation on a PIU received from the host 50 or a PIU generated by the memory device 300. The EHS error handler included in the memory controller 310 may discard a PIU containing an EHS error according to whether the PIU whose EHS length and the first value are compared with each other contains an EHS error.

[0100] Figure 7 is a flow chart illustrating the operation of an EHS error handler according to an embodiment of the present disclosure.

[0101] refer to Figure 2 , Figure 6 and Figure 7 , the EHS error handling operations performed by the EHS error processor 210 are described as follows.

[0102] In operation S110 , the EHS error handler 210 may obtain the EHS length from the PIU. In some embodiments, the EHS error handler 210 may receive the PIU from the UTP or the storage device 300 .

[0103] In operation S120, the EHS error handler 210 may compare the EHS length with the first value. When the EHS length is equal to or greater than the first value, the EHS error handler 210 may perform operation S130. When the EHS length is less than the first value, the EHS error handler 210 may terminate the EHS error handling operation. In some embodiments, when the EHS length is less than the first value, the EHS error handler 210 may output the PIU to the target device.

[0104] ]In operation S130, the EHS error handler 210 may send an error message to the software module SW.

[0105] Figure 8 is a sequence diagram illustrating an error detection operation according to an embodiment of the present disclosure.

[0106] refer to Figure 2 and 8 , a diagram showing a situation where the initiator device is the host 50, the target device is the storage apparatus 300, and the PIU contains an EHS error.

[0107] In operation S210 , the software module SW may transmit a command CMD to the host controller 200 .

[0108] In operation S220, the host controller 200 may generate a command PIU in response to the command CMD. In some embodiments, the UTP may generate the command PIU.

[0109] In operation S230, the host controller 200 may obtain the EHS length from the command PIU.

[0110] In operation S240, the host controller 200 may compare the EHS length with a first value.

[0111] In operation S250, when the EHS length is equal to or greater than the first value, the host controller 200 may send an error message to the software module SW.

[0112] In some embodiments, Figure 2 The HCI may perform operations S220 to S250.

[0113] refer to Figure 8 , when an EHS error is detected in the command PIU, the host controller 200 may discard the command PIU. Therefore, the host controller 200 may not send the command PIU to the storage device 300. That is, the HCI performs an EHS error processing operation on the PIU generated by the host 50, and when an EHS error is detected in the PIU, the PIU is discarded without sending the PIU to the storage device 300, thereby reducing the processing burden of the storage device 300.

[0114] Fig. 9 is a sequence diagram illustrating an error detection operation according to an embodiment of the present disclosure.

[0115] refer to Figure 2 and 9 , a diagram showing a situation where the initiator device is the storage apparatus 300, the target device is the host 50, and the PIU contains an EHS error.

[0116] In operation S310 , the memory device 300 may transmit a response PIU to the host controller 200 .

[0117] In operation S320, the host controller 200 may obtain the EHS length from the response PIU.

[0118] In operation S330, the host controller 200 may compare the EHS length with a first value.

[0119] In operation S340, when the EHS length is equal to or greater than the first value, the host controller 200 may send an error message to the software module SW.

[0120] In some embodiments, Figure 2 The HCI may perform operations S320 to S340.

[0121] refer to Figure 8 , when an EHS error is detected in the response PIU, the host controller 200 may discard the response PIU. Since the UTP discards the response PIU without unpacking or analyzing the response PIU, the software module SW may not receive data related to the response PIU. That is, the HCI performs an EHS error processing operation on the PIU generated by the storage device 300, and when an EHS error is detected in the PIU, the PIU is discarded without processing the PIU, thereby reducing the processing burden of the host.

[0122] Fig.10 is a block diagram illustrating an EHS error handler according to an embodiment of the present disclosure.

[0123] refer to Fig.10 and Figure 6 , the EHS error processor 210 may include a PIU extraction unit 211, a comparison unit 212, and a buffer 213. The EHS error processor 210 may perform an EHS error processing operation. Fig.10 The PIU extraction unit 211 and the buffer 213 are connected with Figure 6 The PIU extraction unit 211 and the buffer 213 are similar, so a detailed description thereof will be omitted.

[0124] The PIU extraction unit 211 may receive a PIU provided from an initiator. The PIU extraction unit 211 may obtain an EHS length, a PIU type, and an operation code from the received PIU. The PIU type may be a transaction type included in a transaction field of a basic header segment of the PIU. The operation code may be an operation code indicated by the 0th bit to the 7th bit (0 to 7) of the 0th byte (0) of the CDB included in the transaction specific field of the command PIU.

[0125] In some embodiments, the PIU extraction unit 211 may extract the PIU type from the transaction field of the basic header segment of the PIU. For example, the PIU extraction unit 211 may obtain the PIU type by extracting '000001b' indicating a command PIU from the transaction field of the command PIU.

[0126] In some embodiments, the PIU extraction unit 211 may extract the operation code from bit 0 to bit 7 (0 to 7) of byte 0 (0) in the CDB of the transaction specific field of the command PIU. For example, the PIU extraction unit 211 may obtain the operation code by extracting 'A2h' indicating the security protocol in the command PIU from the CDB of the security protocol in the command PIU.

[0127] The PIU extraction unit 211 may transmit the EHS length, the PIU type, and the operation code extracted from the PIU to the comparison unit 212 .

[0128] The comparison unit 212 may include a length comparison unit 212a and a type comparison unit 212b. In some embodiments, the PIU extraction unit 211 may send the EHS length to the length comparison unit 212a, and may send the PIU type and the operation code to the type comparison unit 212b.

[0129] The length comparison unit 212a may compare the EHS length with a first value. In some embodiments, the first value may be 4. When the EHS length is equal to or greater than the first value, the length comparison unit 212a may generate an error message. When the EHS length is less than the first value, the length comparison unit 212a may compare the EHS length with a second value. In some embodiments, the second value may be 0.

[0130] When the EHS length is equal to the second value, the length comparison unit 212a may output a pass message to the buffer 213. When the EHS length is not equal to the second value, the type comparison unit 212b may compare the PIU type with the first type. In some embodiments, when the EHS length is not equal to the second value, the length comparison unit 212a may output a type comparison signal to the type comparison unit 212b. The type comparison unit 212b may compare the PIU type with the first type based on the type comparison signal.

[0131] In some embodiments, the first type may be a command or a response. For example, when the initiating device is a host and the target device is a storage device, the first type may be a command. When the initiating device is a storage device and the target device is a host, the first type may be a response.

[0132] In some embodiments, when the PIU type is the same as the first type, the type comparison unit 212b may output a pass message to the buffer 213. When the PIU type is not the same as the first type, the type comparison unit 212b may output an error message.

[0133] In some embodiments, when the PIU type is a command, the type comparison unit 212b may compare the type indicated by the operation code with the second type. The second type may be a security protocol input type or a security protocol output type.

[0134] In some embodiments, when the type indicated by the operation code is the same as the second type, the type comparison unit 212b may output a pass message to the buffer 213. When the type indicated by the operation code is different from the second type, the type comparison unit 212b may output an error message.

[0135] Fig.11 is a flow chart illustrating the operation of an EHS error handler according to an embodiment of the present disclosure.

[0136] refer to Figure 2 , Fig. 9 and Fig.11 , the EHS error handling operations performed by the EHS error processor 210 are described as follows.

[0137] In operation S410, the EHS error handler 210 may obtain the EHS length and the PIU type from the PIU. In some embodiments, the PIU extraction unit 211 may receive the PIU from the UTP or the storage device 300.

[0138] In operation S420, the EHS error handler 210 may compare the EHS length with the first value. When the EHS length is less than the first value, the EHS error handler 210 may perform operation S430. When the EHS length is equal to or greater than the first value, the EHS error handler 210 may perform operation S450.

[0139] In operation S430, the EHS error handler 210 may compare the EHS length with the second value. When the EHS length is equal to the second value, the EHS error handler 210 may terminate the EHS error handling operation. In some embodiments, when the EHS length is equal to the second value, the EHS error handler 210 may output the PIU to the target device. When the EHS length is not equal to the second value, the EHS error handler 210 may perform operation S440.

[0140] In operation S440, the EHS error handler 210 may compare the PIU type with the first type. The first type may be a command or a response. When the PIU type is the same as the first type, the EHS error handler 210 may terminate the EHS error handling operation. In some embodiments, when the PIU type is the same as the first type, the EHS error handler 210 may output the PIU to the target device. When the PIU type is not the same as the first type, the EHS error handler 210 may perform operation S450.

[0141] In operation S450 , the EHS error handler 210 may send an error message to the software module SW.

[0142] Fig.12 is a flow chart illustrating the operation of an EHS error handler according to an embodiment of the present disclosure.

[0143] refer to Figure 2 , Fig. 9 and Fig.12 , the EHS error handling operations performed by the EHS error processor 210 are described as follows.

[0144] In operation S510, the EHS error handler 210 may obtain the EHS length, the PIU type, and the operation code from the PIU. In some embodiments, the PIU extraction unit 211 may receive the PIU from the UTP or the storage device 300.

[0145] In operation S520, the EHS error handler 210 may compare the EHS length with the first value. When the EHS length is equal to or greater than the first value, the EHS error handler 210 may perform operation S560. When the EHS length is less than the first value, the EHS error handler 210 may perform operation S530.

[0146] In operation S530, the EHS error handler 210 may compare the EHS length with the second value. When the EHS length is equal to the second value, the EHS error handler 210 may terminate the EHS error handling operation. In some embodiments, when the EHS length is equal to the second value, the EHS error handler 210 may output the PIU to the target device. When the EHS length is not equal to the second value, the EHS error handler 210 may perform operation S540.

[0147] In operation S540, the EHS error handler 210 may compare the PIU type with the first type. The first type may be a command. When the PIU type is the same as the first type, the EHS error handler 210 may perform operation S550. When the PIU type is not the same as the first type, the EHS error handler 210 may perform operation S560.

[0148] In operation S550, the EHS error handler 210 may compare the type indicated by the operation code with the second type. The second type may be a safety protocol input type or a safety protocol output type. When the type indicated by the operation code is the same as the second type, the EHS error handler 210 may terminate the EHS error handling operation. When the type indicated by the operation code is not the same as the second type, the EHS error handler 210 may perform operation S560.

[0149] In operation S560 , the EHS error handler 210 may send an error message to the software module SW.

[0150] Embodiments of the present disclosure include electronic devices capable of detecting errors in fields of protocol information units. Embodiments of the present disclosure can detect errors in fields of protocol information units before the protocol information units are processed, and can discard erroneous protocol information units, thereby reducing the burden on storage systems.

[0151] Although the present teaching has been illustrated and described with respect to specific embodiments, it will be apparent to those skilled in the art from this disclosure that various changes and modifications may be made without departing from the spirit and scope of the present disclosure defined in the following claims. In addition, these embodiments may be combined to form additional embodiments.

Claims

1. An electronic device, comprising: Memory device; as well as a controller that: receives an inbound PIU from an external device, and controls the memory device based on the inbound PIU, wherein the PIU stands for Protocol Information Unit; Wherein, the inbound PIU includes: a basic header segment, which includes information about the length of EHS, which stands for Extra Header Segment; and Additional header segments, which are defined by the EHS length, and The controller further generates an error message based on whether the inbound PIU includes an error related to the additional header segment.

2. The electronic device according to claim 1, wherein: The controller generates the error message when the EHS length is equal to or greater than a first value.

3. The electronic device according to claim 2, wherein: The inbound PIU further includes a transaction specific field, the transaction specific field identifying the type of the inbound PIU; and When the EHS length is less than the first value and not equal to a second value, the controller generates the error message according to whether the type of the inbound PIU is a first type.

4. The electronic device according to claim 3, wherein: The first value is 4, The second value is 0, and The first type is a command or a response.

5. The electronic device according to claim 4, wherein: The controller further: generating an outbound PIU having the same format as the inbound PIU, and When the type of the outbound PIU is the command, the outbound PIU is output to the external device.

6. The electronic device according to claim 4, wherein: When the type of the inbound PIU is the response, the controller controls the memory device according to the inbound PIU.

7. The electronic device according to claim 4, Also included is a software module that executes the instructions stored in said memory device; in, When the type of the PIU is not the first type, the controller outputs the error message to the software module.

8. The electronic device according to claim 4, wherein: The transaction specific field further identifies the opcode of the inbound PIU, and When the first type is the command, the controller generates the error message according to whether the type indicated by the operation code of the inbound PIU is a second type.

9. The electronic device according to claim 8, wherein: The controller generates the error message when the type indicated by the operation code of the inbound PIU is not the second type.

10. The electronic device according to claim 8, wherein: The controller further: generating an outbound PIU having the same format as the inbound PIU, and When the first type is the command and the type indicated by the operation code of the PIU is the second type, the outbound PIU is output to the external device.

11. The electronic device according to claim 10, wherein: The second type is a safety protocol input type or a safety protocol output type.

12. The electronic device according to claim 1, wherein: The controller includes a host controller interface, the host controller interface providing an interface between the electronic device and the external device, and The host controller interface generates the error message based on whether the PIU includes an error related to the additional header segment.

13. A method of operating an electronic device, the electronic device communicating with an external device via a PIU, where PIU stands for Protocol Information Unit, the method comprising: receiving the PIU from the external device; obtaining an EHS length from the PIU, EHS representing an Extra Header Segment; and An error message is generated when the EHS length is equal to or greater than a first value.

14. The method according to claim 13, further comprising: When the EHS length is less than the first value and not equal to the second value, the error message is generated according to whether the type of the PIU is the first type.

15. The method according to claim 14, wherein: The first value is 4, The second value is 0, and The first type is a command or a response.

16. The method according to claim 14, wherein: Generating the error message according to whether the type of the PIU is the first type when the EHS length is less than the first value and not equal to the second value includes: generating the error message when the type of the PIU is not the first type.

17. The method according to claim 14, wherein: When the EHS length is less than the first value and not equal to the second value, generating the error message according to whether the type of the PIU is the first type includes: in the case where the first type is a command, when the type of the PIU is the first type, generating the error message according to whether the type indicated by the operation code of the PIU is the second type.

18. The method according to claim 17, wherein: Generating the error message according to whether the type indicated by the operation code of the PIU is the second type when the type of the PIU is the first type includes generating the error message when the type indicated by the operation code of the PIU is not the second type.

19. The method according to claim 17, wherein: The second type is a safety protocol input type or a safety protocol output type.

20. A storage device comprising: a memory device; and A controller that: The memory device is controlled to operate based on a PIU, and when the PIU includes a value of an EHS length and the value is greater than a threshold, the PIU is discarded without controlling the memory device, the PIU representing a protocol information unit, and the EHS representing an extra header segment.