Equipment state detection system, link overtime fault repair method, equipment and medium
By adopting a device status detection system in the server and using the central processor, basic input and output system and hardware detection unit to detect PCIe device status from multiple angles, the problem of incorrect identification of link timeout flags is solved and the operational stability of the server and equipment are improved. Accuracy of state detection.
Patent Information
- Application Number
- CN202410977078.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-10-11
AI Technical Summary
In the server, the communication distance between the central processor and the PCIe device is long, which leads to incorrect recognition of the link timeout flag and affects the normal operation of the server. It is difficult to effectively avoid such failures with existing technology.
Use a device status detection system, including a central processor, a basic input and output system and a hardware detection unit, to detect the working status of PCIe devices from multiple angles to avoid determining device faults based only on the link timeout flag, and adjust the link timeout flag to ensure that the device is normal run.
It improves the operational stability of the server, avoids equipment failure due to misjudgment of link timeout, and ensures normal status detection of PCIe devices and normal operation of the server.
Smart Images

Figure CN118760558A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of PCIe (Peripheral Component Interconnect express, a high-speed serial computer expansion bus standard) equipment, and in particular to an equipment status detection system, a link timeout fault repair method, equipment and a medium. Background Art
[0002] PCIe (Peripheral Component Interconnect express, a high-speed serial computer expansion bus standard) is a common bus in server devices. The bus has the characteristics of high transmission speed and low latency. Common PCIe devices include graphics processing units (GPUs) and baseboard management controllers (BMCs). However, in order to meet expansion requirements, cross-board transmission based on the PCIe interface often occurs in server devices. For example, the baseboard management controller is set in a separate small board and is not on the same mainboard as the server's central processor. At this time, the communication distance between the central processor and the PCIe device is long. If the central processor cannot obtain the device information of the PCIe device in a short period of time, it will determine that the link with the PCIe device has timed out and the PCIe device has failed, which will affect the normal operation of the server. Summary of the invention
[0003] The purpose of the present invention is to provide a device status detection system, a link timeout fault repair method, a device and a medium, which can use a basic input and output system and a hardware detection unit to detect the working status of a PCIe device from multiple angles, thereby avoiding the central processor from determining whether the device to be tested is faulty only based on a link timeout flag, thereby improving the operating stability of the server.
[0004] In order to solve the above technical problems, the present invention provides a device status detection system, comprising: a central processing unit, a basic input-output system, a device to be tested and a hardware detection unit, wherein the central processing unit is connected to the device to be tested via a high-speed serial computer expansion bus, the central processing unit is connected to the basic input-output system, the basic input-output system is connected to the device to be tested and the hardware detection unit, and the hardware detection unit is connected to the device to be tested;
[0005] The central processor is used to obtain the working state of the device under test from the basic input and output system when it is determined that the link timeout flag between the device under test and the central processor is adjusted to the timeout state, and when it is determined that the device under test is working normally according to the working state, adjust the link timeout flag to the non-timeout state;
[0006] The basic input and output system is used to obtain a device state from the device under test, and to obtain a hardware state of the device under test from the hardware detection unit, and to set the working state to normal working when it is determined that both the device state and the hardware state are normal, or to set the working state to abnormal working when it is determined that either the device state or the hardware state is abnormal;
[0007] The hardware detection unit is used to obtain the device status from the device under test, and receive a heartbeat signal sent by the device under test, and set the hardware status to normal hardware when it is determined that both the device status and the heartbeat signal are normal, and set the hardware status to abnormal hardware when it is determined that either the device status or the heartbeat signal is abnormal.
[0008] Optionally, the central processor is further used for:
[0009] When it is determined that the working state is abnormal working, the link timeout flag is not adjusted, and alarm information indicating that a hardware failure occurs in the device under test is output.
[0010] Optionally, the hardware detection unit is further used to:
[0011] When it is determined that both the device status and the heartbeat signal are normal, a hardware status signal indicating that the hardware is normal is continuously sent to the basic input / output system; when it is determined that either the device status or the heartbeat signal is abnormal, a hardware status signal indicating that the hardware is abnormal is continuously sent to the basic input / output system.
[0012] Optionally, the basic input and output system is further used to obtain the device status from the status register of the device under test;
[0013] The hardware detection unit is further used to obtain the device status from the status register of the device to be tested.
[0014] Optionally, the device under test is used to obtain its own kernel initialization state when powered on and write the kernel initialization state into the status register;
[0015] The hardware detection unit is further configured to obtain the kernel initialization state from the device under test, receive a heartbeat signal sent by the device under test, and set the hardware state to normal hardware when it is determined that both the kernel initialization state and the heartbeat signal are normal, and set the hardware state to abnormal hardware when it is determined that either the kernel initialization state or the heartbeat signal is abnormal;
[0016] The basic input and output system is used to obtain the kernel initialization state from the device under test, and obtain the hardware state of the device under test from the hardware detection unit, and determine that the device under test is started normally when it is determined that the kernel initialization state and the hardware state are both normal, and guide the device under test to restart when it is determined that either the kernel initialization state or the hardware state is in an abnormal state.
[0017] Optionally, the basic input and output system is further used for:
[0018] Record the number of restarts of the device under test, and determine whether the number of restarts reaches a preset value;
[0019] If it is determined that the number of restarts reaches a preset value, an alarm message indicating that a hardware failure occurs in the device under test is output.
[0020] Optionally, the hardware detection unit is further used to:
[0021] Determining whether the frequency of the heartbeat signal is a preset frequency;
[0022] If it is determined that the frequency of the heartbeat signal is not the preset frequency, it is determined that the heartbeat signal is in an abnormal state.
[0023] Optionally, the device under test is a baseboard management controller, and the hardware detection unit is a complex programmable logic device or a field programmable gate array.
[0024] The present invention also provides a link timeout fault repair method, which is applied to the device status detection system as described above, and the method comprises:
[0025] When the central processing unit determines that the link timeout flag between the central processing unit and the device under test is adjusted to the timeout state, the central processing unit obtains the working state of the device under test from the basic input and output system;
[0026] The basic input and output system obtains the device status from the device under test;
[0027] The hardware detection unit acquires the device state from the device under test, and receives a heartbeat signal sent by the device under test; sets the hardware state to normal hardware when it is determined that both the device state and the heartbeat signal are normal, or sets the hardware state to abnormal hardware when it is determined that either the device state or the heartbeat signal is abnormal; and returns the hardware state to the basic input and output system;
[0028] The basic input and output system obtains the hardware status of the device under test from the hardware detection unit; sets the working status to normal working when it is determined that both the device status and the hardware status are normal, or sets the working status to abnormal working when it is determined that either the device status or the hardware status is abnormal; and returns the working status to the central processing unit;
[0029] When the central processor determines that the device under test is working normally according to the working status, the link timeout flag is adjusted to a non-timeout state.
[0030] The present invention also provides an electronic device, comprising the device state detection system as described above.
[0031] The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the link timeout fault repair method as described above is implemented.
[0032] The present invention provides a device status detection system, comprising: a central processing unit, a basic input-output system, a device to be tested and a hardware detection unit, wherein the central processing unit is connected to the device to be tested via a high-speed serial computer expansion bus, the central processing unit is connected to the basic input-output system, the basic input-output system is connected to the device to be tested and the hardware detection unit, and the hardware detection unit is connected to the device to be tested; the central processing unit is used to obtain the working state of the device to be tested from the basic input-output system when it is determined that the link timeout mark between the central processing unit and the device to be tested is adjusted to a timeout state, and when it is determined that the device to be tested is working normally according to the working state, the link timeout mark is adjusted to a non-timeout state. ; The basic input and output system is used to obtain the device status from the device under test, and to obtain the hardware status of the device under test from the hardware detection unit, and to set the working status to normal working when it is determined that the device status and the hardware status are both normal, or to set the working status to abnormal working when it is determined that either the device status or the hardware status is abnormal; the hardware detection unit is used to obtain the device status from the device under test, and to receive a heartbeat signal sent by the device under test, and to set the hardware status to normal hardware when it is determined that the device status and the heartbeat signal are both normal, or to set the hardware status to abnormal hardware when it is determined that either the device status or the heartbeat signal is abnormal.
[0033] It can be seen that the present invention can use the basic input and output system and the hardware detection unit to detect the working state of the device under test from multiple angles. Among them, the hardware detection unit can obtain the device state from the device under test, and can also receive the heartbeat signal sent by the device under test, and can determine that the hardware state of the device under test is normal hardware when it is determined that the device state and the heartbeat signal are normal, and determine that the hardware state of the device under test is abnormal hardware when it is determined that either the device state or the heartbeat signal is abnormal. The basic input and output system can determine the working state of the device under test by combining the device state fed back by the device under test itself and the hardware state determined by the hardware detection unit, and can determine that the working state of the device under test is normal operation when it is determined that the device state and the hardware state are normal, and determine that the working state of the device under test is abnormal operation when it is determined that either the device state or the hardware state is abnormal. Furthermore, when the central processor determines that the link timeout flag between the central processor and the device under test is adjusted to a timeout state, the central processor can obtain the working state of the device under test from the basic input and output system, and when the device under test is determined to be working normally according to the working state, the link timeout flag is adjusted to a non-timeout state, thereby avoiding the central processor from determining whether the device under test is faulty only according to the link timeout flag, thereby improving the operation stability of the server. The present invention also provides a link timeout fault repair method, device and medium, which have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0035] Figure 1 A structural block diagram of a device status detection system provided by an embodiment of the present invention;
[0036] Figure 2 A flowchart of a link timeout fault repair method provided by an embodiment of the present invention;
[0037] Figure 3 The present invention provides a flowchart of another link timeout fault repair method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] PCIe (Peripheral Component Interconnect express, a high-speed serial computer expansion bus standard) is a common bus in server devices. The bus has the characteristics of high transmission speed and low latency. Common PCIe devices include graphics processing units (GPUs) and baseboard management controllers (BMCs). However, in order to meet expansion requirements, cross-board transmission based on the PCIe interface often occurs in server devices. For example, the baseboard management controller is set in a separate small board and is not on the same mainboard as the server central processor. At this time, the communication distance between the central processor and the PCIe device is long. If the central processor cannot obtain the device information of the PCIe device in a short period of time, it will determine that the link with the PCIe device has timed out and the PCIe device has failed, thereby affecting the normal operation of the server. For example, after determining that the link with the PCIe device has timed out, the central controller can set the link timeout flag (CmpltTO, completion timeout) to the timeout state. At this time, the user can see from the server operating system that the PCIe corresponding to the PCIe device generates a CmpltTO+ error, thereby affecting the normal operation of the server. In the related art, the CPU can usually only be down-clocked to reduce the probability of link timeouts, but this will obviously reduce the working performance of the server. In view of this, the present invention can provide a device status detection system that can use a basic input and output system and a hardware detection unit to detect the working status of a PCIe device from multiple angles, thereby avoiding the CPU determining whether the device under test is faulty only based on a link timeout flag, thereby improving the operating stability of the server.
[0040] For easier understanding, please refer to Figure 1 , Figure 1This is a structural block diagram of a device status detection system provided by an embodiment of the present invention, and the system may include: a central processing unit (CPU), a basic input and output system (BIOS), a device to be tested, and a hardware detection unit. The device to be tested is a high-speed serial computer expansion bus device (i.e., a PCIe device), for example, a baseboard management controller; the central processing unit is connected to the device to be tested via a high-speed serial computer expansion bus, the central processing unit is connected to the basic input and output system, the basic input and output system is connected to the device to be tested and the hardware detection unit, and the hardware detection unit is connected to the device to be tested.
[0041] In the actual working process, the central processor is used to obtain the working state of the device under test from the basic input and output system when it is determined that the link timeout flag between the central processor and the device under test is adjusted to the timeout state, and adjust the link timeout flag to the non-timeout state when it is determined that the device under test is working normally according to the working state;
[0042] The basic input and output system is used to obtain a device state from the device under test, and to obtain a hardware state of the device under test from the hardware detection unit, and to set the working state to normal working when it is determined that both the device state and the hardware state are normal, or to set the working state to abnormal working when it is determined that either the device state or the hardware state is abnormal;
[0043] The hardware detection unit is used to obtain the device status from the device under test, and receive a heartbeat signal sent by the device under test, and set the hardware status to normal hardware when it is determined that both the device status and the heartbeat signal are normal, and set the hardware status to abnormal hardware when it is determined that either the device status or the heartbeat signal is abnormal.
[0044] It is worth pointing out that the embodiment of the present invention can particularly use the basic input and output system and the hardware detection unit to detect the working state of the device under test from multiple angles, so as to avoid the central processor determining the fault condition of the device under test only based on the link timeout flag. The working condition of the hardware detection unit and the basic input and output system is introduced below.
[0045] First, for the hardware detection unit, it can obtain the device status from the device under test, and can also receive the heartbeat signal (such as the heartbeat light signal) sent by the device under test, and then determine the hardware status of the device under test based on the device status and the heartbeat signal. If either the device status or the heartbeat signal is abnormal, such as the device status feedback from the device under test itself is abnormal, or the device under test does not feedback an abnormality, but the heartbeat signal it sends is abnormal, then the hardware detection unit can determine that the hardware status of the device under test is a hardware abnormality. The hardware detection unit can only determine that the hardware status of the device under test is normal when it determines that the above-mentioned device status and heartbeat signal are normal. Since heartbeat signals such as heartbeat light signals can only be obtained from the underlying hardware, and the heartbeat signal reflects the actual hardware working status of the device under test, the hardware detection unit can use the heartbeat signal to verify the device status feedback from the device under test itself, and can detect the hardware status of the device under test from a more basic perspective to ensure the reliability of the detection.
[0046] It should be noted that the above device status can be obtained by the hardware detection unit from the status register of the device under test. That is, the hardware detection unit is also used to obtain the device status from the status register of the device under test.
[0047] It should also be pointed out that the embodiment of the present invention does not limit the detection method of the heartbeat signal by the hardware detection unit. For example, it can determine whether the device under test sends a heartbeat signal within a preset time. If it does, the heartbeat signal is determined to be normal, otherwise it is abnormal. For another example, it can also determine whether the frequency of the heartbeat signal sent by the device under test is a preset frequency. If it is the preset frequency, the heartbeat signal can be determined to be normal, otherwise it is abnormal. In the embodiment of the present invention, since the frequency of the heartbeat signal sent by the PCIe device is relatively high, the frequency of sending the heartbeat signal may decrease when it encounters a fault. Therefore, for the convenience of detection, the hardware detection unit can determine whether the heartbeat signal is abnormal based on the frequency of the heartbeat signal.
[0048] Based on this, the hardware detection unit can also be used for:
[0049] Determining whether the frequency of the heartbeat signal is a preset frequency;
[0050] If it is determined that the frequency of the heartbeat signal is not the preset frequency, it is determined that the heartbeat signal is in an abnormal state.
[0051] It should be noted that the embodiment of the present invention does not limit the specific value of the preset frequency, which can be set according to actual application requirements, for example, it can be 1 Hz.
[0052] It should also be noted that the embodiment of the present invention does not limit the hardware type of the hardware detection unit. For example, the hardware detection unit is a complex programmable logic device (CPLD) or a field programmable gate array (FPGA). In addition, the above hardware status can be saved by a register in the hardware detection unit, or it can be actively sent to the basic input and output system by the hardware detection unit in the form of a signal. Considering that the signal transmission method is more convenient for the basic input and output system to understand the working status of the device under test, a hardware status signal can also be set between the hardware detection unit and the basic input and output system. The hardware detection unit can also be used to:
[0053] When it is determined that both the device status and the heartbeat signal are normal, a hardware status signal indicating that the hardware is normal is continuously sent to the basic input / output system; when it is determined that either the device status or the heartbeat signal is abnormal, a hardware status signal indicating that the hardware is abnormal is continuously sent to the basic input / output system.
[0054] Furthermore, for the basic input-output system, it can obtain the device status from the device under test, and can also obtain the hardware status fed back by the hardware detection unit, and then determine the working status of the device under test based on the device status and the hardware status. If there is an abnormality in either the device status or the hardware status, such as the device status fed back by the device under test itself is abnormal, or the device under test does not feed back an abnormality, but the hardware status detected by the hardware detection unit is a hardware abnormality, then the basic input-output system can determine that the device under test is not working properly. The basic input-output system can only determine that the device under test can work properly when it determines that the above-mentioned device status and hardware status are normal. Furthermore, the basic input-output system can comprehensively determine the actual working status of the device under test in combination with the feedback of the device under test itself and the actual detection results of the hardware detection unit to ensure the reliability of the detection.
[0055] It should be noted that the above device status can be obtained by the basic input and output system from the status register of the device under test. That is, the basic input and output system can also be used to obtain the device status from the status register of the device under test.
[0056] Furthermore, since the embodiment of the present invention can detect the working status of the device under test through the basic input and output system and the hardware detection unit, when the central processing unit determines that the link timeout flag between the central processing unit and the device under test is adjusted to the timeout state (CmpltTO+), the central processing unit obtains the working status of the device under test from the basic input and output system, and when it is determined that the device under test is working normally according to the working status, the link timeout flag is adjusted to a non-timeout state (CmpltTO-). This not only avoids the central processing unit from determining the state of the device under test only based on the link timeout flag, but also avoids the link timeout flag from being tampered with, thereby effectively ensuring the normal operation of the server.
[0057] Furthermore, if the central processor determines that the device under test is not working properly according to the working status, it can be determined that the device under test is indeed faulty. At this time, it may not adjust the link timeout flag and output an alarm message indicating that the device under test has a hardware fault.
[0058] Based on this, the central processor can also be used for:
[0059] When it is determined that the working state is abnormal working, the link timeout flag is not adjusted, and alarm information indicating that a hardware failure occurs in the device under test is output.
[0060] Based on the above embodiments, the present invention can use a basic input-output system and a hardware detection unit to detect the working state of the device under test from multiple angles. Among them, the hardware detection unit can obtain the device state from the device under test, and can also receive the heartbeat signal sent by the device under test, and can determine that the hardware state of the device under test is normal hardware when it is determined that the device state and the heartbeat signal are normal, and determine that the hardware state of the device under test is abnormal hardware when it is determined that either the device state or the heartbeat signal is abnormal. The basic input-output system can determine the working state of the device under test by combining the device state fed back by the device under test itself and the hardware state determined by the hardware detection unit, and can determine that the working state of the device under test is normal operation when it is determined that the device state and the hardware state are normal, and determine that the working state of the device under test is abnormal operation when it is determined that either the device state or the hardware state is abnormal. Furthermore, when the central processor determines that the link timeout flag between the central processor and the device under test is adjusted to a timeout state, the central processor can obtain the working state of the device under test from the basic input and output system, and when it is determined that the device under test is working normally according to the working state, the link timeout flag is adjusted to a non-timeout state, thereby avoiding the central processor from determining whether the device under test is faulty only based on the link timeout flag, thereby improving the operating stability of the server.
[0061] Based on the above embodiment, the following describes a method for detecting the startup status of the device under test using the basic input and output system and the hardware detection unit during the server startup phase. In one possible scenario, the device under test is used to obtain its own kernel initialization status when powered on, and write the kernel initialization status into the status register;
[0062] The hardware detection unit is further configured to obtain the kernel initialization state from the device under test, receive a heartbeat signal sent by the device under test, and set the hardware state to normal hardware when it is determined that both the kernel initialization state and the heartbeat signal are normal, and set the hardware state to abnormal hardware when it is determined that either the kernel initialization state or the heartbeat signal is abnormal;
[0063] The basic input and output system is used to obtain the kernel initialization state from the device under test, and obtain the hardware state of the device under test from the hardware detection unit, and determine that the device under test is started normally when it is determined that the kernel initialization state and the hardware state are both normal, and guide the device under test to restart when it is determined that either the kernel initialization state or the hardware state is in an abnormal state.
[0064] In an embodiment of the present invention, during the power-on startup process, the device under test can write the kernel initialization state representing the kernel initialization of itself into the status register. The kernel initialization state can correspond to each stage of the kernel initialization of the device under test, and is used to indicate whether each initialization stage is successfully executed. The kernel initialization state will be used as the device state of the device under test after the device under test is normally started. In addition, the device under test can normally send a heartbeat signal during the startup process. On this basis, the hardware detection unit can obtain the kernel initialization state from the device under test, and can also receive the heartbeat signal sent by the device under test, and can determine that the hardware state of the device under test is normal hardware when it is determined that the kernel initialization state and the heartbeat signal are both normal; when it is determined that either the kernel initialization state or the heartbeat signal is abnormal, it is determined that the hardware state of the device under test is abnormal hardware. Further, the basic input and output system can comprehensively determine whether the device under test is normally initialized by combining the kernel initialization state fed back by the device under test itself and the hardware state determined by the hardware detection unit, and can determine that the device under test can be normally initialized when it is determined that the kernel initialization state and the hardware state are both normal; when it is determined that either the kernel initialization state or the hardware state is abnormal, it is determined that the device under test cannot be normally initialized. Furthermore, when the basic input and output system determines that the device under test cannot be initialized normally, it can guide the device under test to restart to ensure normal startup of the device under test.
[0065] Furthermore, if the device under test encounters an irreparable fault, it will not be able to start normally, and the basic input and output system may continuously guide the device under test to restart, thereby affecting the overall startup process of the server. To avoid such interference, the basic input and output system can also record the number of restarts of the device under test, and when it is determined that the number of restarts reaches a preset value, it outputs an alarm message indicating that the device under test has a hardware fault, so that relevant personnel can promptly maintain and replace the device under test.
[0066] Based on this, the basic input and output system can also be used for:
[0067] Record the number of restarts of the device under test, and determine whether the number of restarts reaches a preset value;
[0068] If it is determined that the number of restarts reaches a preset value, an alarm message indicating that a hardware failure occurs in the device under test is output.
[0069] It should be noted that the embodiment of the present invention does not limit the specific numerical value of the preset value, which can be set according to actual application requirements, for example, 5 times.
[0070] The link timeout fault repair method, electronic device and computer-readable storage medium provided in an embodiment of the present invention are introduced below. The link timeout fault repair method, electronic device and computer-readable storage medium described below can be referenced to each other with the device status detection system described above.
[0071] Please refer to Figure 2 , Figure 2 A flowchart of a link timeout fault repair method provided by an embodiment of the present invention is applied to the device status detection system as described above, and the method includes:
[0072] S201, when the central processing unit determines that the link timeout flag between the central processing unit and the device under test is adjusted to a timeout state, the central processing unit obtains the working state of the device under test from the basic input and output system;
[0073] S202, the basic input and output system obtains the device status from the device under test;
[0074] S203, the hardware detection unit obtains the device status from the device under test, and receives a heartbeat signal sent by the device under test; when it is determined that both the device status and the heartbeat signal are normal, the hardware status is set to normal hardware, or when it is determined that either the device status or the heartbeat signal is abnormal, the hardware status is set to abnormal hardware; and the hardware status is returned to the basic input and output system;
[0075] S204, the basic input and output system obtains the hardware status of the device under test from the hardware detection unit; when it is determined that both the device status and the hardware status are normal, sets the working status to normal working, or when it is determined that either the device status or the hardware status is abnormal, sets the working status to abnormal working; and returns the working status to the central processing unit;
[0076] S205. When the central processor determines that the device under test is working normally according to the working status, the central processor adjusts the link timeout flag to a non-timeout state.
[0077] Optionally, the method further comprises:
[0078] When the central processor determines that the working state is abnormal working, the link timeout flag is not adjusted, and an alarm message indicating that a hardware failure occurs in the device under test is output.
[0079] Optionally, the method further comprises:
[0080] The hardware detection unit continuously sends a hardware status signal indicating that the hardware is normal to the basic input / output system when it is determined that both the device status and the heartbeat signal are normal, and continuously sends a hardware status signal indicating that the hardware is abnormal to the basic input / output system when it is determined that either the device status or the heartbeat signal is abnormal.
[0081] Optionally, the method further comprises:
[0082] The basic input and output system obtains the device status from the status register of the device under test;
[0083] The hardware detection unit obtains the device status from the status register of the device under test.
[0084] Optionally, the method further comprises:
[0085] When the device under test is powered on and started, it obtains its own kernel initialization state and writes the kernel initialization state into the status register;
[0086] The hardware detection unit obtains the kernel initialization state from the device under test, receives a heartbeat signal sent by the device under test, and sets the hardware state to normal hardware when it is determined that both the kernel initialization state and the heartbeat signal are normal, and sets the hardware state to abnormal hardware when it is determined that either the kernel initialization state or the heartbeat signal is abnormal;
[0087] The basic input / output system obtains the kernel initialization state from the device under test, and obtains the hardware state of the device under test from the hardware detection unit, and determines that the device under test starts normally when it is determined that the kernel initialization state and the hardware state are both normal, and guides the device under test to restart when it is determined that either the kernel initialization state or the hardware state is in an abnormal state.
[0088] Optionally, the method further comprises:
[0089] The basic input-output system records the restart times of the device under test, and determines whether the restart times reaches a preset value; if it is determined that the restart times reaches the preset value, an alarm message indicating that a hardware failure occurs in the device under test is output.
[0090] Optionally, the method further comprises:
[0091] The hardware detection unit determines whether the frequency of the heartbeat signal is a preset frequency; if it is determined that the frequency of the heartbeat signal is not the preset frequency, it is determined that the heartbeat signal is in an abnormal state.
[0092] Based on the above embodiments, the following is a complete introduction to the link timeout fault repair method based on specific examples. Figure 3 , Figure 3 A flowchart of another link timeout fault repair method provided by an embodiment of the present invention. The PCIe device to be tested in the embodiment of the present invention is a BMC chip. The recovery strategy for the BMC chip may include the following process:
[0093] 1. The ARM server starts to power on and the BMC firmware starts to initialize and start.
[0094] 2. During the BMC startup process, the BMC chip obtains the kernel startup status of the BMC SDK in the BMC flash rom and writes the kernel startup status into the status register so that the second-level CPLD / FPGA can obtain it and the third-level BIOS can obtain it.
[0095] 3. CPLD / FPGA determines whether the device is normal by obtaining the feedback frequency of the heartbeat light of the BMC. If the frequency of the heartbeat light is 1Hz, it is normal. Other abnormal frequencies are monitored. By obtaining the status of the normal heartbeat light of the BMC and the kernel startup status returned by the BMC, a comparison is made. If they are consistent, a normal status signal will also be sent to the BIOS. If the two are inconsistent, an abnormal status signal will be sent to the BIOS.
[0096] 4. The third-level BIOS obtains the kernel startup status of the PCI device to determine whether the BMC can be initialized normally. This initialization process is based on the initialization status of the hardware device to determine whether there is an abnormality in the initialization status of part of the BMC main control chip, and at the same time verify whether the second-level abnormal judgment is an abnormal behavior.
[0097] 5. If the verification is abnormal and the initialization status is abnormal, it means that the BMC initialization is abnormal. You can pull the BMC control chip status flag and try to repair the BMC control chip status (i.e. reset). Limit the pull status to 5 times and try to repair. If the abnormality still exists, release the abnormal reporting mechanism; if the BMC initialization is normal, subsequent polling monitoring can confirm this status.
[0098] An embodiment of the present invention further provides an electronic device, including the electronic device including the device status detection system as described above, that is, the electronic device includes a central processing unit, a basic input-output system, a device to be tested and a hardware detection unit, the central processing unit is connected to the device to be tested via a high-speed serial computer expansion bus, the central processing unit is connected to the basic input-output system, the basic input-output system is connected to the device to be tested and the hardware detection unit, and the hardware detection unit is connected to the device to be tested; the central processing unit, the basic input-output system, the device to be tested and the hardware detection unit work together to implement the link timeout fault repair method as described above.
[0099] It should be noted that the embodiments of the present invention do not limit other hardware components that the electronic device may include. For example, it may also include a memory, a power supply, a communication interface, an input and output interface, etc., which can be set according to actual application requirements.
[0100] Since the embodiments of the electronic device part correspond to the embodiments of the link timeout fault repair method part, please refer to the description of the embodiments of the link timeout fault repair method part for the embodiments of the electronic device part, which will not be repeated here.
[0101] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the link timeout fault repair method described in the above embodiment is implemented.
[0102] Since the embodiments of the computer program product part correspond to the embodiments of the link timeout fault repair method part, please refer to the description of the embodiments of the link timeout fault repair method part for the embodiments of the computer program product part, and will not be repeated here.
[0103] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the link timeout fault repair method described in the above embodiment is implemented.
[0104] Since the embodiments of the computer-readable storage medium part correspond to the embodiments of the link timeout fault repair method part, please refer to the description of the embodiments of the link timeout fault repair method part for the embodiments of the storage medium part, which will not be repeated here.
[0105] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0106] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0107] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0108] The above is a detailed introduction to the device status detection system, link timeout fault repair method, device and medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. A device status detection system, It is characterized in that include: A central processing unit, a basic input-output system, a device under test and a hardware detection unit, wherein the central processing unit is connected to the device under test via a high-speed serial computer expansion bus, the central processing unit is connected to the basic input-output system, the basic input-output system is connected to the device under test and the hardware detection unit, and the hardware detection unit is connected to the device under test; The central processor is used to obtain the working state of the device under test from the basic input and output system when it is determined that the link timeout flag between the device under test and the central processor is adjusted to the timeout state, and when it is determined that the device under test is working normally according to the working state, adjust the link timeout flag to the non-timeout state; The basic input and output system is used to obtain a device state from the device under test, and to obtain a hardware state of the device under test from the hardware detection unit, and to set the working state to normal working when it is determined that both the device state and the hardware state are normal, or to set the working state to abnormal working when it is determined that either the device state or the hardware state is abnormal; The hardware detection unit is used to obtain the device status from the device under test, and receive a heartbeat signal sent by the device under test, and set the hardware status to normal hardware when it is determined that both the device status and the heartbeat signal are normal, and set the hardware status to abnormal hardware when it is determined that either the device status or the heartbeat signal is abnormal.
2. The device status detection system according to claim 1, It is characterized in that The central processing unit is also used for: When it is determined that the working state is abnormal working, the link timeout flag is not adjusted, and alarm information indicating that a hardware failure occurs in the device under test is output.
3. The device status detection system according to claim 1, It is characterized in that The basic input and output system is further used to obtain the device status from the status register of the device under test; The hardware detection unit is further used to obtain the device status from the status register of the device to be tested.
4. The device status detection system according to claim 2, It is characterized in that The device under test is used to obtain its own kernel initialization state when powered on and write the kernel initialization state into the state register; The hardware detection unit is further used to obtain the kernel initialization state from the device under test, and receive a heartbeat signal sent by the device under test, and set the hardware state to normal hardware when it is determined that both the kernel initialization state and the heartbeat signal are normal, and set the hardware state to abnormal hardware when it is determined that either the kernel initialization state or the heartbeat signal is abnormal; The basic input and output system is used to obtain the kernel initialization state from the device under test, and obtain the hardware state of the device under test from the hardware detection unit, and determine that the device under test is started normally when it is determined that the kernel initialization state and the hardware state are both normal, and guide the device under test to restart when it is determined that either the kernel initialization state or the hardware state is in an abnormal state.
5. The device status detection system according to claim 3, It is characterized in that The basic input and output system is also used for: Record the number of restarts of the device under test, and determine whether the number of restarts reaches a preset value; If it is determined that the number of restarts reaches a preset value, an alarm message indicating that a hardware failure occurs in the device under test is output.
6. The device status detection system according to claim 1, It is characterized in that The hardware detection unit is further used for: Determining whether the frequency of the heartbeat signal is a preset frequency; If it is determined that the frequency of the heartbeat signal is not the preset frequency, it is determined that the heartbeat signal is in an abnormal state.
7. The device status detection system according to claim 1, It is characterized in that The device to be tested is a baseboard management controller, and the hardware detection unit is a complex programmable logic device or a field programmable logic gate array.
8. A link timeout fault repair method, It is characterized in that Applied to the device status detection system according to any one of claims 1 to 7, the method comprises: When the central processing unit determines that the link timeout flag between the central processing unit and the device under test is adjusted to the timeout state, the central processing unit obtains the working state of the device under test from the basic input and output system; The basic input and output system obtains the device status from the device under test; The hardware detection unit acquires the device state from the device under test, and receives a heartbeat signal sent by the device under test; sets the hardware state to normal hardware when it is determined that both the device state and the heartbeat signal are normal, or sets the hardware state to abnormal hardware when it is determined that either the device state or the heartbeat signal is abnormal; and returns the hardware state to the basic input and output system; The basic input and output system obtains the hardware status of the device under test from the hardware detection unit; sets the working status to normal working when it is determined that both the device status and the hardware status are normal, or sets the working status to abnormal working when it is determined that either the device status or the hardware status is abnormal; and returns the working status to the central processing unit; When the central processor determines that the device under test is operating normally according to the operating status, the central processor adjusts the link timeout flag to a non-timeout state.
9. An electronic device, It is characterized in that It comprises the device status detection system as described in any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by the processor, the link timeout fault repair method according to claim 8 is implemented.
