Patent Publication Number: US-11652583-B2

Title: Electronic communication device, magnetic disk device and serial communication method

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
     This application is based upon and claims the benefit of priority from Japanese Patent Application No. 2019-216692, filed Nov. 29, 2019, the entire contents of which are incorporated herein by reference. 
     FIELD 
     Embodiments described herein relate generally to an electronic communication device, a magnetic disk device and a serial communication method. 
     BACKGROUND 
     An electronic communication device has the function of logging, when detecting an error in data in units of packets (hereinafter referred to as packet data) in serial communication with the other electronic communication device, information about the error. When the boundary of packet data is misaligned by synchronization failure, etc., in serial communication with the other electronic communication device, since it takes time to reset the boundary of packet data, in some cases, the electronic communication device determines that an error continuously occurs in packet data transferred from the other electronic communication device, and continues logging information about the error. In such cases, the electronic communication device causes overflowing of a recording area to which the information about the error is logged. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG.  1    is a block diagram showing a configuration example of a communication system according to the first embodiment. 
         FIG.  2    is a block diagram showing the configuration of a magnetic disk device according to the first embodiment. 
         FIG.  3    is a block diagram showing a configuration example of an HDC according to the first embodiment. 
         FIG.  4    is a schematic diagram showing an example of logging processing according to the first embodiment. 
         FIG.  5    is a flowchart showing an example of a serial communication method according to the first embodiment. 
         FIG.  6    is a schematic diagram showing an example of logging processing according to a modification 1. 
         FIG.  7    is a flowchart showing an example of a serial communication method according to the modification 1. 
         FIG.  8    is a schematic diagram showing an example of logging processing according to the second embodiment. 
         FIG.  9    is a flowchart showing an example of a serial communication method according to the second embodiment. 
     
    
    
     DETAILED DESCRIPTION 
     In general, according to one embodiment, an electronic communication device comprises: a controller which controls, according to the number of bit data in which an error has occurred of packet data transferred in serial communication, whether to start logging of information about the error of the packet data or stop logging of information about the error of the packet data. 
     Embodiments will be described hereinafter with reference to the accompanying drawings. Note that the drawings are presented by way of example only and are not intended to limit the scope of the invention. 
     First Embodiment 
       FIG.  1    is a block diagram showing a configuration example of a communication system SYS according to the first embodiment. 
     The communication system SYS includes an electronic communication device (reception device)  1  and an electronic communication device (transmission device)  100 . The reception device  1  and the transmission device  100  execute serial communication with each other via a transmission channel  200 . The transmission channel  200  is a wired or wireless network. The transmission channel  200  may employ a standard such as Serial Attached SCSI (SAS) (registered trademark), Serial Advanced Technology Attachment (SATA) (registered trademark) or Universal Serial Bus (USB) (registered trademark). The transmission device  100  transmits serial data to the reception device  1  via the transmission channel  200 . The transmission device  100  is, for example, a host system  100 . The reception device  1  receives serial data transferred from the transmission device  100  via the transmission channel  200 . The reception device  1  is, for example, a recording device  1 . The recording device  1  includes a magnetic disk device (hard disk drive) (HDD)  1 , a memory device (solid state drive) (SSD)  1  and the like. The reception device  1  will be hereinafter described as a magnetic disk device  1 . 
       FIG.  2    is a block diagram showing the configuration of the magnetic disk device  1  according to the first embodiment. 
     The magnetic disk device  1  includes a head disk assembly (HDA) which will be described later, a driver IC  20 , a head amplifier integrated circuit (hereinafter referred to as a head amplifier IC or a preamplifier)  30 , a volatile memory  70 , a buffer memory (buffer)  80 , a nonvolatile memory  90 , and a system controller  130  which is a single-chip integrated circuit. In addition, the magnetic disk device  1  is connected to the host system (host)  100 . 
     The HDA includes a magnetic disk (hereinafter referred to as a disk)  10 , a spindle motor (SPM)  12 , an arm  13  on which a head  15  is mounted, and a voice coil motor (VCM)  14 . The disk  10  is rotated by the spindle motor  12 . The arm  13  and the VCM  14  constitute an actuator. The actuator controls the movement of the head  15  mounted on the arm  13  to an intended position on the disk  10  by the drive of the VCM  14 . Two or more disks  10  and heads  15  may be disposed. 
     On the disk  10 , in its recording area, a recording area  10   a  which can be used from the user, and a system area  10   b  to which information required for system management is written are allocated. 
     The head  15  includes a slider as a main body, and a write head  15 W and a read head  15 R mounted on the slider. The write head  15 W writes data on the disk  10 . The read head  15 R reads data recorded on a data track of the disk  10 . The head  15  writes data to the disk  10  in units of blocks, each of which includes at least one sector, and reads data in units of blocks. Here, the sector is the smallest unit of data written to the disk  10  or read from the disk  10 . 
     The driver IC  20  controls the drive of the SPM  12  and the VCM  14  according to the control of the system controller  130  (more specifically, an MPU  40  which will be described later). 
     The head amplifier IC  30  includes a read amplifier and a write driver. The read amplifier amplifies a read signal read from the disk  10  and outputs it to the system controller  130  (more specifically, a read/write (R/W) channel  50  which will be described later). The write driver outputs a write current corresponding to write data output from the R/W channel  50  to the head  15 . 
     The volatile memory  70  is a semiconductor memory which loses stored data when power supply is cut off. The nonvolatile memory  70  stores data, etc., required for processing in each module of the magnetic disk device  1 . The volatile memory  70  is, for example, a dynamic random access memory (DRAM) or a synchronous dynamic random access memory (SDRAM). 
     The buffer memory  80  is a semiconductor memory which temporarily records data, etc., transmitted between the magnetic disk device  1  and the host  100 . Note that the buffer memory  80  may be integrally composed with the volatile memory  70 . The buffer memory  80  is, for example, a DRAM, a static random access memory (SRAM), an SDRAM, a ferroelectric random access memory (FeRAM), a magnetoresistive random access memory (MRAM) or the like. 
     The nonvolatile memory  90  is a semiconductor memory which records stored data even when power supply is cut off. The nonvolatile memory  90  is, for example, a NOR or NAND flash read only memory (ROM) (FROM). 
     The system controller (controller)  130  is realized by using, for example, a large-scale integrated circuit (LSI) called a system-on-a-chip (SoC) in which a plurality of elements are integrated on a single chip. The system controller  130  includes a microprocessor (MPU)  40 , a read/write (R/W) channel  50  and a hard disk controller (HDC)  60 . The system controller  130  is connected to the driver IC  20 , the head amplifier IC  30 , the nonvolatile memory  70 , the buffer memory  80 , the nonvolatile memory  90  and the host system  100 . 
     The MPU  40  is a main controller which controls each module of the magnetic disk device  1 . The MPU  40  controls the VCM  14  via the driver IC  20 , and executes servo control for positioning of the head  15 . In addition, the MPU  40  controls a data write operation on the disk  10 , and selects a storage designation for write data transferred from the host  100 . The MPU  40  executes processing based on firmware. The MPU  40  is connected to each module of the magnetic disk device  1 . The MPU  40  is connected to the R/W channel  50  and the HDC  60 . 
     The R/W channel  50  executes signal processing of read data and write data according to instructions from the MPU  40 . The read data and the write data will also be referred to simply as data. The R/W channel  50  has a circuit or function for measuring the signal quality of read data. The R/W channel  50  is connected to the head amplifier IC  30 , the MPU  40  and the HDC  60 . 
     The HDC  60  controls data transfer between the host  100  and the R/W channel  50  according to instructions from the MPU  40 . For example, the HDC  60  stores user data transferred from the host  100  in the buffer memory  80  once, and outputs it to the R/W channel  50 . In addition, the HDC  60  stores read data read from the disk  10  in the buffer memory  80  once, and outputs it to the host  100 . The HDC  60  is connected to the MPU  40 , the R/W channel  50 , the volatile memory  70 , the buffer memory  80 , the nonvolatile memory  90  and the host  100 . 
       FIG.  3    is a block diagram showing a configuration example of the HDC  60  according to the present embodiment. 
     The HDC  60  includes a communication unit  601 , an error correction unit  602 , a determination unit  603  and a logging unit  604 . The HDC  60  may include the modules, for example, the communication unit  601 , the error correction unit  602 , the determination unit  603 , the logging unit  604  and the like as circuits. In addition, the HDC  60  may execute processing of the modules, for example, the communication unit  601 , the error correction unit  602 , the determination unit  603 , the logging unit  604  and the like on firmware. 
     The communication unit  601  controls data transfer by serial communication to/from the host  100 . The communication unit  601  controls transmission of data in units of packets (or frames) (hereinafter referred to also as packet data) PD to/from the host  100  via the transmission channel  200 . The packet data PD includes a given number (or volume), for example, a given number of bits of data DTG, and an error correction code EC. Note that the error correction code EC may be transferred from the host  100  to the HDC  60  each time a given number (hereinafter referred to also as a number of packets) of packet data PD are transferred, as packet data different from packet data PD corresponding to the user data, etc. The packet data PD may include data indicating the boundary of packet data (hereinafter referred to also as boundary data). The boundary data may be transferred from the host  100  to the HDC  60  each time a given number of packets of packet data are transferred, as packet data different from packet data PD corresponding to the user data, etc., and packet data corresponding to the error correction code EC. The transmission channel  200  is a wiring line which electrically connects the host  100  and the HDC  60 . The transmission channel  200  employs, for example, the SAS Protocol Layer-4 (SPL-4) standard. The error correction code EC includes, for example, a forward error correction (FEC) code. 
     The error correction unit  602  executes error correction processing. The error correction unit  602  can execute error correction of a given number (or volume), for example, two symbols of error data or less of each packet data PD based on each error correction code EC corresponding to each packet data PD. Note that the error correction unit  602  may execute error correction of three symbols of error data or more of each packet data PD based on each error correction code EC corresponding to each packet data PD. For example, when the boundary of packet data PD transferred from the host  100  is misaligned by synchronization failure, etc., in some cases, the error correction unit  602  mistakenly executes error correction of packet data PD whose boundary is misaligned. 
     The determination unit  603  determines (sets) the boundary of packet data PD transferred from the host  100  to the HDC  60 . The determination unit  602  executes synchronization of the boundary of packet data PD. Note that the determination unit  603  may determine (set) the boundary of packet data PD transferred from the host  100  based on the boundary data. 
     The determination unit  603  detects error data, for example, data in units of bits (hereinafter referred to also as bit data) in which an error has occurred for each packet data PD transferred from the host  100 , and counts error data for each packet data. 
     The determination unit  603  determines whether each packet data PD is packet data PD containing no error data or little error data (hereinafter referred to as valid packet data) or packet data PD containing error data which cannot be corrected (hereinafter referred to as invalid packet data). For example, the determination unit  603  determines whether each packet data PD is valid packet data or invalid packet data based on the number, for example, the number of bits of error data of each packet data PD. 
     For example, when the determination unit  603  detects no error data in given packet data PD or a given number (hereinafter referred to also as a validity threshold), for example, two symbols of error data or less in given packet data PD, the determination unit  603  determines that the packet data PD is valid packet data PD. 
     For example, when the determination unit  603  detects more error data than the validity threshold, for example, two symbols in given packet data PD, the determination unit  603  determines that the packet data PD is invalid packet data PD. 
     For example, the determination unit  603  sets the validity threshold. Note that the determination unit  603  may set the validity threshold for each packet data PD or arbitrarily change the validity threshold. The validity threshold corresponds to, for example, the number of error data which can be corrected based on the error correction code EC. Note that the validity threshold may correspond to the number of error data less than or equal to the number of error data which can be corrected based on the error correction code EC or may correspond to the number of error data less than the number of error data which can be corrected based on the error correction code EC. 
     For example, when the determination unit  603  determines that a plurality of consecutive packet data PD are invalid packet data, the determination unit  603  can determine that the boundary of packet data PD transferred from the host  100  is misaligned by synchronization failure, etc. When the determination unit  603  determines that the boundary of packet data PD is misaligned, the determination unit  603  transitions from a state of determining the boundary of packet data PD and executing communication (for example, an SP_PS2:SyncAcquired state) to a state of determining (or setting) the boundary of packet data PD (for example, an SP_PS0:AcquireSync state). In other words, when the determination unit  603  determines that the boundary of packet data PD is misaligned, the determination unit  603  stops communication once, and resets the boundary of packet data PD. Note that the determination unit  603  may have, for example, a phy layer SPL packet synchronization (SP_PS) state machine. The SP_PS state machine has states, for example, SP_PS0:AcquireSync, SP_PS1:Valid1, SP_PS2:SyncAcquired, SP_PS3:Lost1, SP_PS4:LostRecovered, SP_PS5:Lost2 and SP_PS6:Lost3. For example, when the SP_PS state machine is in the SP_PS2:SyncAcquired state and if a plurality of packet data are received in the order of valid packet data, invalid packet data, invalid data, valid packet data, invalid packet data, valid packet data and valid packet data, the SP_PS state machine may transition in the order of SP_PS2:SyncAcquired, SP_PS3:Lost1, SP_PS5:Lost2, SP_PS4:LostRecovered, SP_PS3:Lost1, PS4:LostRecovered and SP_PS2:SyncAcquired. 
     For example, when the determination unit  603  is in the state of setting the boundary of packet data PD (for example, the SP_PS0:AcquireSync state) and if the determination unit  603  determines that one or a plurality of consecutive packet data PD are valid packet data, the determination unit  603  transitions from the state of setting the boundary of packet data PD (for example, the SP_PS0:AcquireSync state) to a given state, for example, the SP_PS4:LostRecovered state or the state of setting the boundary of packet data PD and executing communication (for example, the SP_PS2:SyncAcquired state). 
     For example, when the determination unit  603  mistakenly executes error correction of packet data PD whose boundary is misaligned, the determination unit  603  may determine that the mistakenly corrected packet data PD is valid packet data PD, and may transition from the state of setting the boundary of packet data PD and executing communication (for example, the SP_PS2:SyncAcquired state) to a given state, for example, the SP_PS4:LostRecovered state or the state of determining the boundary of packet data PD and executing communication (for example, the SP_PS2:SyncAcquired state). 
     The determination unit  603  determines whether the communication quality is normal or not. The determination unit  603  determines whether the communication quality is normal or not based on the number of error data of each packet data. For example, when the determination unit  603  determines that the number of error data of given packet data PD is less than or equal to the validity threshold, that is, given packet data PD is valid data, the determination unit  603  determines that the communication quality of the packet data PD is normal. When the determination unit  603  determines that the number of error data of given packet data PD is greater than the validity threshold, that is, given packet data PD is invalid packet data, the determination unit  603  determines that the communication quality of the packet data PD is not normal. 
     The logging unit  604  controls whether or not to log (record) the position (or number) of error data and information such as the content of an error (hereinafter referred to also as error information) to (on) a given recording area (hereinafter referred to also as a logging area) LA. The “logging” includes “logging given data, for example, log data (also referred to simply as log)”, “recording log” and the like. Note that the “logging” may also include “counting up the number, for example, the number of bits of error data in given packet data PD” and the like. The “logging (recording) given data (log data or log) to (on) the logging area LA” will also be referred to simply as “logging” or “logging processing”. In the example shown in  FIG.  3   , the logging area LA is included in the buffer  80 . Alternatively, the logging area LA may be included in the volatile memory  70 , the nonvolatile memory  90 , the logging unit  604  or the like. 
     The logging unit  604  controls whether to execute (start or resume) logging (or logging processing) of the error information of packet data PD or stop (suspend or end) logging based on the number of error data of packet data PD. For example, when the logging unit  604  determines that the communication quality of the packet data PD is normal, the logging unit  604  executes logging (or logging processing) of the error information of packet data PD. For example, when the communication quality of given packet data PD is found normal based on the determination result of the determination unit  603 , the logging unit  604  executes logging of the error information of another packet data PD transferred after this packet data PD. For example, when the communication quality of the packet data PD is found not normal, the logging unit  604  stops logging of the error information of packet data PD. For example, when the communication quality of given packet data PD is found not normal based on the determination result of the determination unit  603 , the logging unit  604  stops logging of another packet data PD transferred after this packet data PD. 
       FIG.  4    is a schematic diagram showing an example of the logging processing according to the present embodiment. In  FIG.  4   , the packet data PD include packet data PD 1 , PD 2 , PD 3 , PD 4 , PD 5 , PD 6 , PD 7 , PD 8 , PD 9 , PD 10 , PD 11 , PD 12 , PD 13  and PD 14 . In  FIG.  4   , a direction in which the packet data PD is transferred (hereinafter referred to also as a transfer direction) TD is indicated. In  FIG.  4   , the packet data PD are transferred in the order of the packet data PD 1  to PD 14  from the host  100  to the HDC  60 . In  FIG.  4   , the packet data PD 1  to PD 4 , PD 13  and PD 14  are valid packet data (Valid PKT). In  FIG.  4   , the packet data PD 5  to PD 12  are invalid packet data (Invalid PKT). 
     The HDC  60  receives the packet data PD 1  and logs the error information of the packet data PD 1  to the logging area LA. The HDC  60  determines whether the number of error data of the packet data PD 1  is greater than the validity threshold or less than or equal to the validity threshold. When the HDC  60  determines that the number of error data of the packet data PD 1  is less than or equal to the validity threshold, the HDC  60  determines that the communication quality of the packet data PD is normal. When the HDC  60  determines that the communication quality of the packet data PD is normal, the HDC  60  executes (starts) logging of the error information of the packet data PD 2  transferred from the host  100  after the packet data PD 1  to the logging area LA. 
     Until the HDC  60  determines that the communication quality of the packet data PD is not normal, the HDC  60  logs the error information of each packet data PD transferred from the host  100  to the logging area LA. In the example shown in  FIG.  4   , the HDC  60  logs the error information of each of the packet data PD 2  to PD 5  to the logging area LA. 
     The HDC  60  receives the packet data PD 4  and logs the error information of the packet data PD 4  to the logging area LA. The HDC  60  determines whether the number of error data of the packet data PD 4  is greater than the validity threshold or less than or equal to the validity threshold. When the HDC  60  determines that the number of error data of the packet data PD 4  is less than or equal to the validity threshold, the HDC  60  determines that the communication quality of the packet data PD is normal. When the HDC  60  determines that the communication quality of the packet data PD is normal, the HDC  60  executes logging of the error information of the packet data PD 5  transferred from the host  100  after the packet data PD 4  to the logging area LA. 
     The HDC  60  receives the packet data PD 5  and logs the error information of the packet data PD 5  to the logging area LA. The HDC  60  determines whether the number of error data of the packet data PD 5  is greater than the validity threshold or less than or equal to the validity threshold. When the HDC  60  determines that the number of error data of the packet data PD 5  is greater than the validity threshold, the HDC  60  determines that the communication quality is not normal. When the HDC  60  determines that the communication quality of the packet data PD is not normal, the HDC  60  stops logging of the error information of the packet data PD 6  transferred from the host  100  to the HDC  60  after the packet data PD 5  to the logging area LA. 
     Until the HDC  60  determines that the communication quality of the packet data PD is normal, the HDC  60  stops logging of each error information of each packet data PD transferred from the host  100  to the logging area LA. In the example shown in  FIG.  4   , the HDC  60  stops logging of the error information of each of the packet data PD 6  to PD 13  to the logging area LA. 
     The HDC  60  receives the packet data PD 12  and does not log the error information of the packet data PD 12  to the logging area LA. The HDC  60  determines whether the number of error data of the packet data PD 12  is greater than the validity threshold or less than or equal to the validity threshold. When the HDC  60  determines that the number of error data of the packet data PD 12  is greater than the validity threshold, the HDC  60  determines that the communication quality of the packet data PD is not normal. When the HDC  60  determines that the communication quality of the packet data PD is not normal, the HDC  60  stops logging of the error information of the packet data PD 13  transferred from the host  100  after the packet data PD 12  to the logging area LA. 
     The HDC  60  receives the packet data PD 13  and does not log the error information of the packet data PD 13  to the logging area LA. The HDC  60  determines whether the number of error data of the packet data PD 13  is greater than the validity threshold or less than or equal to the validity threshold. When the HDC  60  determines that the number of error data of the packet data PD 13  is less than or equal to the validity threshold, the HDC  60  determines that the communication quality of the packet data PD 13  is normal. When the HDC  60  determines that the communication quality of the packet data PD 13  is normal, the HDC  60  executes logging of the error information of the packet data PD 14  transferred from the host  100  after the packet data PD 13  to the logging area LA. 
     As shown in  FIG.  4   , when the communication quality of the packet data PD is found not normal, by stopping logging of the error information of the packet data PD transferred after the packet data PD whose communication quality is found not normal, it is possible to suppress logging of the error information of a plurality of invalid packet data PD which are caused by a misalignment of the boundary of packet data PD to the logging area LA, and logging of the error information of a plurality of invalid packet data PD which are caused by a misalignment of the boundary of packet data PD which is caused by invalid packet data PD which is mistakenly subjected to error correction to the logging area LA. By suppressing logging of the error information of the plurality of invalid packet data which are caused by the misalignment of the boundary of the packet data PD to the logging area LA, it is possible to suppress overflowing of the logging area LA. In addition, by not logging the error information of the plurality of invalid packet data PD which are caused by the misalignment of the boundary of the packet data PD to the logging area LA, it is possible to calculate an error rate without using the error information of the plurality of packet data PD which are caused by the misalignment of the boundary of the packet data PD. By calculating the error rate without using the error information of the plurality of invalid packet data PD which are caused by the misalignment of the boundary of the packet data PD as described above, it is possible to improve the accuracy of the error rate. 
       FIG.  5    is a flowchart showing an example of a serial communication method according to the present embodiment. 
     The system controller  130  receives given packet data PD from the host  100  (B 501 ) and logs the error information of this packet data PD to the logging area LA (B 502 ). The system controller  130  determines whether the communication quality of the packet data PD is normal or not (B 503 ). For example, the system controller  130  determines whether the number of error data of the given packet data PD is greater than the validity threshold or less than or equal to the validity threshold. When the system controller  130  determines that the communication quality of the packet data PD is not normal (NO in B 503 ), the system controller  130  stops logging of the error information of packet data PD transferred after the given packet data PD to the logging area LA (B 504 ). For example, when the system controller  130  determines that the number of error data of the given packet data PD is greater than the validity threshold, and determines that the communication quality of the packet data PD is not normal, the system controller  130  stops logging of the error information of packet data transferred after the given packet data PD to the logging area LA. The system controller  130  determines whether there is another packet data PD transferred after the given data PD or not (B 505 ). When the system controller  130  determines that there is another packet data PD (YES in B 505 ), the system controller  130  receives the given packet data PD (B 506 ) and proceeds to the processing of B 503 . When the system controller  130  determines that there is not any other packet data PD (NO in B 505 ), the system controller  130  ends the processing. 
     When the system controller  130  determines that the communication quality of the packet data PD is normal (YES in B 503 ), the system controller  130  executes (or starts) logging of the error information of packet data PD transferred after the given packet data PD to the logging area LA (B 507 ). For example, when the system controller  130  determines that the number of error data of the given packet data PD is less than or equal to the validity threshold, and determines that the communication quality of the packet data PD is normal, the system controller  130  executes logging of the error information of packet data transferred after the given packet data PD to the logging area LA. The system controller  130  determines whether there is another packet data PD transferred after the given packet data PD or not (B 508 ). When the system controller  130  determines that there is another packet data PD (YES in B 508 ), the system controller  130  proceeds to the processing of B 501 . When the system controller  130  determines that there is not any other packet data PD (NO in B 508 ), the system controller  130  ends the processing. 
     According to the present embodiment, the electronic communication device (magnetic disk device)  1  executes serial communication with the electronic communication device (host)  100  via the transmission channel  200 . The electronic communication device  1  determines whether the communication quality of the packet data PD transferred from the electronic communication device  100  is normal or not based on the number (or volume) of error data of the packet data PD. When the electronic communication device  1  determines that the communication quality of the packet data PD is not normal, the electronic communication device  1  stops logging of the error information of the packet data PD to the logging area LA. For example, when the electronic communication device  1  determines that the number of error data of packet data PD is greater than the validity threshold, the electronic communication device  1  determines that the communication quality of the packet data PD is not normal, and stops logging of the error information of the packet data PD to the logging area LA. By stopping logging when determining that the communication quality of the packet data PD is not normal as described above, the electronic communication device  1  can suppress logging of the error information of a plurality of invalid packet data PD which are caused by a misalignment of the boundary of packet data PD, etc., to the logging area LA. In addition, by not logging the error information of a plurality of invalid packet data PD which are caused by a misalignment of the boundary of packet data PD, etc., to the logging area LA, the electronic communication device  1  can improve the accuracy of an error rate. Therefore, the electronic communication device  1  can improve communication performance. 
     Next, electronic communication devices according to other embodiments and modifications will be described. In the other embodiments and modifications, the same parts as those of the first embodiment described above are denoted by the same reference numbers, and detailed descriptions of them are omitted. 
     Modification 1 
     An electronic communication device (magnetic disk device)  1  according to a modification 1 of the first embodiment is different from the electronic communication device  1  of the first embodiment in the processing of serial communication. 
     When the HDC  60  determines that the number (or volume) of error data of the packet data PD is less than or equal to the validity threshold, the HDC  60  determines that the communication quality of the packet data PD is normal. For example, when the HDC  60  determines that the communication quality of given packet data PD is normal, the HDC  60  executes logging of error information from this packet data PD. When the HDC  60  determines that the number (or volume) of error data of the packet data PD is greater than the validity threshold, the HDC  60  determines that the communication quality of the packet data PD is not normal. For example, when the HDC  60  determines that the communication quality of given packet data PD is not normal, the HDC  60  stops logging of error information of at least one packet data transferred after this packet data PD. 
       FIG.  6    is a schematic diagram showing an example of logging processing according to the modification 1. In  FIG.  6   , the packet data PD include packet data PD 1  to PD 14 . 
     The HDC  60  receives the packet data PD 1 , and determines whether the number of error data of the packet data PD 1  is greater than the validity threshold or less than or equal to the validity threshold. When the HDC  60  determines that the number of error data of the packet data PD 1  is less than or equal to the validity threshold, the HDC  60  determines that the communication quality of the packet data PD is normal. When the HDC  60  determines that the communication quality of the packet data PD is normal, the HDC  60  logs the error information of the packet data PD 1  to the logging area LA. 
     The HDC  60  logs each error information of each packet data PD to the logging area LA until the HDC  60  determines that the communication quality of given packet data PD is not normal. In the example shown in  FIG.  6   , the HDC  60  logs the error information of each of the packet data PD 2  to PD 4  to the logging area LA until the HDC  60  determines that the communication quality of given packet data PD is not normal. 
     The HDC  60  receives the packet data PD 5 , and determines that the number (or volume) of error data of the packet data PD 5  is greater than the validity threshold or less than or equal to the validity threshold. When the HDC  60  determines that the number of error data of the packet data PD 5  is greater than the validity threshold, the HDC  60  determines that the communication quality of the packet data PD is not normal. When the HDC  60  determines that the communication quality of the packet data PD is not normal, the HDC  60  stops logging of the error information of the packet data PD 5  to the logging area LA. 
     The HDC  60  stops logging of each error information of each packet data PD until the HDC  60  determines that the communication quality of given packet data PD is normal. In the example shown in  FIG.  6   , the HDC  60  stops logging of the error information of each of the packet data PD 6  to PD 12  until the HDC  60  determines that the communication quality of given packet data PD is normal. 
     The HDC  60  receives the packet data PD 13 , and determines whether the number of error data of the packet data PD 13  is greater than the validity threshold or less than or equal to the validity threshold. When the HDC  60  determines that the number of error data of the packet data PD 13  is less than or equal to the validity threshold, the HDC  60  determines that the communication quality of the packet data PD is normal. When the HDC  60  determines that the communication quality of the packet data PD is normal, the HDC  60  logs the error information of the packet data PD 13  to the logging area LA. 
     The HDC  60  logs each error information of each packet data PD to the logging area LA until the HDC  60  determines that the communication quality of given packet data PD is not normal. In the example shown in  FIG.  6   , the HDC  60  logs the error information of at least one packet data PD from the packet data PD 14  until the HDC  60  determines that the communication quality of given packet data PD is not normal. 
       FIG.  7    is a flowchart showing an example of a serial communication method according to the modification 1. 
     The system controller  130  receives given packet data PD from the host  100  (B 501 ), and determines whether the communication quality of the packet data PD is normal or not (B 701 ). For example, the system controller  130  determines whether the number of error data of the given packet data PD is greater than the validity threshold or less than or equal to the validity threshold. When the system controller  130  determines that the communication quality of the packet data PD is not normal (NO in B 701 ), the system controller  130  stops logging of the error information of the packet data PD from the given packet data PD to the logging area LA (B 702 ). For example, when the system controller  130  determines that the number of error data of the given packet data PD is greater than the validity threshold, and determines that the communication quality of the packet data PD is not normal, the system controller  130  stops logging of the error information of this packet data PD to the logging area LA. The system controller  130  determines whether there is another packet data PD transferred after the given packet data PD or not (B 704 ). When the system controller  130  determines that there is another packet data PD (YES in B 704 ), the system controller  130  proceeds to the processing of B 501 . 
     When the system controller  130  determines that the communication quality of the packet data PD is normal (YES in B 701 ), the system controller  130  executes logging of the error information from the given packet data PD to the logging area LA (B 703 ). For example, when the system controller  130  determines that the number of error data of the given packet data PD is less than or equal to the validity threshold, and determines that the communication quality of the packet data PD is normal, the system controller  130  logs the error information of this packet data PD to the logging area LA. The system controller  130  proceeds to the processing of B 704 . 
     According to the modification 1, the electronic communication device (magnetic disk device)  1  determines whether the communication quality of the packet data PD is normal or not based on the number (or volume) of error data of the packet data PD transferred from the electronic communication device  100 . When the electronic communication device  1  determines that the communication quality of the packet data PD is not normal, the electronic communication device  1  stops logging of the error information of this packet data PD to the logging area LA. Therefore, the electronic communication device  1  can improve communication performance. 
     Second Embodiment 
     An electronic communication device (magnetic disk device)  1  according to the second embodiment is different from the electronic communication devices  1  of the first embodiment and the modification 1 in the processing of serial communication. 
     The HDC  60  counts the number of packets of invalid packet data and the number of packets of valid data transferred from the host  100 . 
     When the HDC  60  executes logging of the error information of packet data PD, the HDC  60  determines whether the number of packets of consecutive invalid packet data transferred from the host  100  (hereinafter referred to also as the number of consecutive invalid data) is greater than or equal to a given number (hereinafter referred to also as a consecutive invalid data threshold) or less than the consecutive invalid data threshold. When the HDC  60  determines that the number of consecutive invalid data is less than the consecutive invalid data threshold, the HDC  60  determines that the communication quality of the packet data PD is normal. When the HDC  60  determines that the communication quality of the packet data PD is normal, the HDC  60  executes logging of the error information of packet data PD transferred after the last invalid packet data (hereinafter referred to also as the last invalid data) PD of the plurality of consecutive invalid packet data transferred consecutively from the host  100 . Note that, when the HDC  60  determines that the communication quality of the packet data PD is normal, the HDC  60  may execute logging of the error information of packet data PD from the last invalid data. When the HDC  60  determines that the number of consecutive invalid data is greater than or equal to the consecutive invalid data threshold, the HDC  60  determines that the communication quality of the packet data PD is not normal. When the HDC  60  determines that the communication quality of the packet data PD is not normal, the HDC  60  stops logging of the error information of packet data PD transferred after the last invalid data PD. Note that, when the HDC  60  determines that the communication quality of the packet data PD is not normal, the HDC  60  may stop logging of the error information of packet data PD from the last invalid data PD. In addition, the HDC  60  may arbitrarily change the consecutive invalid data threshold. 
     When the HDC  60  stops logging of the error information of packet data PD, the HDC  60  determines whether the number of packets of consecutive valid packet data transferred from the host  100  (hereinafter referred to also as the number of consecutive valid data) is greater than or equal to a given number (hereinafter referred to also as a consecutive valid data threshold) or less than the consecutive valid data threshold. When the HDC  60  determines that the number of consecutive valid data is less than the consecutive valid data threshold, the HDC  60  determines that the communication quality of the packet data PD is not normal. When the HDC  60  determines that the communication quality of the packet data PD is not normal, the HDC  60  stops logging of the error information of packet data PD transferred after the last valid packet data (hereinafter referred to also as the last valid data) PD of the plurality of consecutive valid packet data transferred consecutively from the host  100 . Note that, when the HDC  60  determines that the communication quality of the packet data PD is not normal, the HDC  60  may stop logging of the error information of the packet data PD from the last valid data PD. When the HDC  60  determines that the number of consecutive valid data is greater than or equal to the consecutive valid data threshold, the HDC  60  determines that the communication quality of the packet data PD is normal. When the HDC  60  determines that the communication quality of the packet data PD is normal, the HDC  60  executes logging of the error information of packet data PD transferred after the last valid data PD of the plurality of consecutive valid packet data PD transferred consecutively from the host  100 . Note that, when the HDC  60  determines that the communication quality of the packet data PD is normal, the HDC  60  may execute logging of the error information of the packet data PD from the last valid data PD. In addition, the HDC  60  may arbitrarily change the consecutive valid data threshold. 
       FIG.  8    is a schematic diagram showing an example of logging processing according to the second embodiment. In  FIG.  8   , the packet data PD include packet data PD 21 , PD 22 , PD 23 , PD 24 , PD 25 , PD 26 , PD 27 , PD 28 , PD 29 , PD 30 , PD 31 , PD 32 , PD 33 , PD 34 , PD 35 , PD 36 , PD 37  and PD 38 . In  FIG.  8   , the packet data PD are transferred from the host  100  to the HDC  60  in the order of the packet data PD 21  to PD 38 . In  FIG.  8   , the packet data PD 21 , PD 22 , PD 24 , PD 25 , PD 27 , PD 30 , PD 32 , PD 34 , PD 36 , PD 37  and PD 38  are valid packet data (Valid PKT). In  FIG.  8   , the packet data PD 23 , PD 26 , PD 28 , PD 29 , PD 31 , PD 33  and PD 35  are invalid packet data (Invalid PKT). In  FIG.  8   , the consecutive invalid data threshold is, for example, two packets (or frames). Note that the consecutive invalid data threshold may be greater than or equal to three packets (or frames). In addition, in  FIG.  8   , the consecutive valid data threshold is, for example, two packets (or frames). Note that the consecutive valid data threshold may be greater than or equal to three packets (or frames). 
     The HDC  60  logs the error information of each of the packet data PD 21  to PD 29  to the logging area LA. The HDC  60  counts the invalid packet data PD 28  and the invalid packet data PD 29  transferred consecutively after the invalid packet data PD 28 , and sets the number of consecutive invalid data to two. The HDC  60  determines that the number of consecutive invalid data is greater than or equal to the consecutive invalid data threshold (=2), and determines that the communication quality of the packet data PD is not normal. The HDC  60  stops logging of the error information from the packet data PD 30  transferred after the last invalid data PD 29  of the invalid packet data PD 28  and PD 29  transferred consecutively from the host  100  to the logging area LA. Note that the HDC  60  may stop logging of the error information from the last invalid data PD 29  of the invalid packet data PD 28  and PD 29  transferred consecutively from the host  100 . 
     The HDC  60  stops logging of each of the packet data PD 30  to PD 37  to the logging area LA. The HDC  60  counts the valid packet data PD 36  and the valid packet data PD 37  transferred consecutively after the valid packet data PD 36 , and sets the number of consecutive valid data to two. The HDC  60  determines that the number of consecutive valid data is greater than or equal to the consecutive valid data threshold (=2), and determines that the communication quality of the packet data PD is normal. The HDC  60  executes logging of the error information from the packet data PD 38  transferred after the last valid data PD 37  of the valid packet data PD 36  and PD 37  transferred consecutively from the host  100  to the logging area LA. Note that the HDC  60  may stop logging of the error information from the last valid data PD 37  of the valid packet data PD 36  and PD 37  transferred consecutively from the host  100  to the logging area LA. 
       FIG.  9    is a flowchart showing an example of a serial communication method according to the second embodiment. 
     The system controller  130  receives given packet data PD from the host  100  (B 501 ) and logs the error information of this packet data PD to the logging area LA (B 502 ). The system controller  130  counts the packet data PD (B 901 ). For example, the system controller  130  counts the number of consecutive invalid data and the number of consecutive valid data. 
     The system controller  130  determines whether the communication quality of the packet data PD is normal or not (B 503 ). For example, in a case where the system controller  130  executes logging of the error information of the packet data PD to the logging area LA, the system controller  130  determines whether the number of consecutive invalid data is greater than or equal to the consecutive invalid data threshold or less than the consecutive invalid data threshold. For example, in a case where the system controller  130  stops loggings of the error information of the packet data PD to the logging area LA, the system controller  130  determines whether the number of consecutive valid data is greater than or equal to the consecutive valid data threshold or less than the consecutive valid data threshold. 
     When the system controller  130  determines that the communication quality of the packet data PD is not normal (NO in B 503 ), the system controller  130  stops logging of the error information of the packet data PD transferred after the given packet data PD to the logging area LA (B 504 ), and proceeds to the processing of B 505 . For example, when the system controller  130  executes logging of the error information of the packet data PD to the logging area LA, and if the system controller  130  determines that the number of consecutive invalid data is greater than or equal to the consecutive invalid data threshold, and determines that the communication quality is not normal, the system controller  130  stops logging of the error information of the packet data PD transferred after the last invalid data PD to the logging area LA, and proceeds to the processing of B 505 . For example, when the system controller  130  executes logging of the error information of the packet data PD to the logging area LA, and if the system controller  130  determines that the number of consecutive invalid data is greater than or equal to the consecutive invalid data threshold, and determines that the communication quality is not normal, the system controller  130  stops logging of the error information of the last invalid data PD to the logging area LA, and proceeds to the processing of B 505 . For example, when the system controller  130  stops logging of the error information of the packet data PD to the logging area LA, and if the system controller  130  determines that the number of consecutive valid data is less than the consecutive valid data threshold, and determines that the communication quality is not normal, the system controller  130  stops logging of the error information of the packet data PD transferred after the last valid data PD to the logging area LA, and proceeds to the processing of B 505 . For example, when the system controller  130  stops logging of the error information of the packet data PD to the logging area LA, and if the system controller  130  determines that the number of consecutive valid data is less than the consecutive valid data threshold, and determines that the communication quality is not normal, the system controller  130  stops logging of the error information of the last valid data PD to the logging area LA, and proceeds to the processing of B 505 . 
     When the system controller  130  determines that the communication quality of the packet data PD is normal (YES in B 503 ), the system controller  130  executes logging of the error information of the packet data PD transferred after the given packet data PD to the logging area LA (B 507 ), and proceeds to the processing of B 508 . For example, when the system controller  130  executes logging of the error information of the packet data PD to the logging area LA, and if the system controller  130  determines that the number of consecutive invalid data is less than the consecutive invalid data threshold, and determines that the communication quality of the packet data PD is normal, the system controller  130  executes logging of the error information of the packet data PD transferred after the last invalid data PD to the logging area LA, and proceeds to the processing of B 508 . For example, when the system controller  130  executes logging of the error information of the packet data PD to the logging area LA, and if the system controller  130  determines that the number of consecutive invalid data is less than the consecutive invalid data threshold, and determines that the communication quality of the packet data PD is normal, the system controller  130  executes logging of the error information of the last invalid data PD to the logging area LA, and proceeds to the processing of B 508 . For example, when the system controller  130  stops logging of the error information of the packet data PD to the logging area LA, and if the system controller  130  determines that the number of consecutive valid data is greater than or equal to the consecutive valid data threshold, and determines that the communication quality is normal, the system controller  130  executes logging of the error information of the packet data PD transferred after the last valid data PD to the logging area LA, and proceeds to the processing of B 508 . For example, when the system controller  130  stops logging of the error information of the packet data PD to the logging area LA, and if the system controller  130  determines that the number of consecutive valid data is greater than or equal to the consecutive valid data threshold, and determines that the communication quality is normal, the system controller  130  executes logging of the error information of the last valid data PD to the logging area LA, and proceeds to the processing of B 508 . 
     According to the second embodiment, the electronic communication device (for example, the magnetic disk device)  1  determines whether the communication quality of the packet data PD is normal or not based on the number of packets of consecutive packet data transferred consecutively from the electronic communication device  100 . When the electronic communication device  1  determines that the communication quality of the packet data PD is not normal based on the number of packets of consecutive packet data PD, the electronic communication device  1  stops logging of the error information of the packet data PD to the logging area LA. For example, when the electronic communication device  1  determines that the number of consecutive invalid data is greater than or equal to the consecutive invalid data threshold, the electronic communication device  1  determines that the communication quality of the packet data PD is not normal, and stops logging of the error information of the packet data PD to the logging area LA. As described above, by stopping logging to the logging area LA when determining that the communication quality of the packet data PD is not normal based on the number of packets of consecutive packet data PD, the electronic communication device  1  can suppress logging of the error information of a plurality of invalid packet data PD which are caused by a misalignment of the boundary of packet data PD, etc., to the logging area LA. Therefore, the electronic communication device  1  can improve communication performance. 
     An example of an electronic communication device, a magnetic disk device and a serial communication device obtained from the configurations disclosed in the present specification will be additionally described. 
     (Aspect 1) An electronic communication device comprising a controller which controls, according to the number of bit data in which an error has occurred of packet data transferred in serial communication, whether to start logging of information about the error of the packet data or stop logging of information about the error of the packet data. 
     (Aspect 2) The electronic communication device of (Aspect 1), wherein when the number of bit data in which an error has occurred of first packet data is greater than or equal to a threshold, the controller stops logging from first information about of an error of second packet data of the packet data transferred after the first packet data. 
     (Aspect 3) The electronic communication device of (Aspect 2), wherein when the number of bit data in which an error has occurred of third packet data transferred after the second packet data is less than the threshold, the controller starts logging of second information about an error of fourth packet transferred after the third packet data. 
     (Aspect 4) The electronic communication device of (Aspect 1), wherein when the number of bit data in which an error has occurred of first packet data is greater than or equal to a threshold, the controller stops logging of first information about the error of the first packet data. 
     (Aspect 5) The electronic communication device of (Aspect 4), wherein when the number of bit data in which an error has occurred of second packet data transferred after the first packet data is less than the threshold, the controller starts logging of second information about the error of the second packet data. 
     (Aspect 6) The electronic communication device of any one of (Aspect 1) to (Aspect 5), wherein the threshold corresponds to the number of bit data which can be corrected by an error correction code. 
     (Aspect 7) The electronic communication device of (Aspect 1), wherein when the number of times invalid packet data which cannot be corrected by error correction is transferred consecutively is greater than or equal to a first threshold, the controller stops logging from first information about an error of first packet data transferred after first invalid packet data which is last invalid packet data of the consecutive invalid packet data. 
     (Aspect 8) The electronic communication device of (Aspect 7), wherein when the number of times valid packet data which can be corrected by error correction is transmitted consecutively after the first invalid packet data is greater than or equal to a second threshold, the controller starts logging from second information of an error of second packet data transmitted after first valid packet data which is last valid packet data of the consecutive valid packet data. 
     (Aspect 9) A magnetic disk device comprising: a disk; a head which writes data to the disk and reads data from the disk; and a controller which controls, according to the number of bit data in which an error has occurred of packet data transferred in serial communication, whether to start logging of information of the error of the packet data or stop logging of information of the error of the packet data. 
     (Aspect 10) A magnetic disk device comprising: a disk; a head which writes data to the disk and reads data from the disk; a memory; and a controller which controls, according to the number of bit data in which an error has occurred of packet data transferred in serial communication, whether to execute logging of information of the error of the packet data to the memory or stop logging of information of the error of the packet data to the memory. 
     (Aspect 11) A serial communication method applied to an electronic communication device, the serial communication method comprising controlling, according to the number of bit data in which an error has occurred of packet data transferred in serial communication, whether to start logging of information of the error of the packet data or stop logging of information of the error of the packet data. 
     While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel embodiments described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the embodiments described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.