Fault processing method and device of expansion bus equipment and electronic equipment
By detecting and repairing PCI Express expansion bus device faults during the initialization phase of the basic input and output system, the problem of high fault handling costs in the existing technology is solved, efficient fault identification and repair are achieved, and processing complexity and cost are reduced.
Patent Information
- Application Number
- CN202410494256.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2024-08-23
AI Technical Summary
When the existing technology solves PCI Express expansion bus device faults, the cost is high and there is a lack of efficient fault handling methods.
When the basic input and output system is initialized and started, pre-written instructions are used to detect whether the expansion bus device has a card loss failure or operation failure, and corresponding repair processing is performed based on the detection results, including reading the manufacturer number register, prohibiting operation processing, Start running processing, read maximum bandwidth and rate, negotiate status registers, etc.
It effectively reduces the cost of troubleshooting expansion bus equipment, improves processing efficiency, promptly identifies and repairs card loss, bandwidth reduction and operation slowdown faults, and reduces the complexity of subsequent processing.
Smart Images

Figure CN118535360A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for handling failures of an expansion bus device, and electronic equipment. Background Art
[0002] Expansion bus devices (PCI Express, also known as PCIE) will have various problems during the Basic Input Output System (Basic Input Output System, also known as Bios) startup phase.
[0003] It is known from the related art that the solution to the failure of the PCIe device is often achieved by replacing the firmware and driver of the core chip of the PCIe network card, which will increase the cost.
[0004] Therefore, currently, finding a fault handling method for expansion bus devices that can reduce the cost of troubleshooting has become a research hotspot. Summary of the invention
[0005] The present invention provides a method and device for handling failures of an expansion bus device, and electronic equipment, which can reduce the handling cost of handling failures of the expansion bus device and improve the handling efficiency while effectively handling the failures of the expansion bus device.
[0006] The present invention provides a method for handling a fault of an expansion bus device, the method comprising: when a basic input / output system is initialized and started, calling a first instruction pre-written into the basic input / output system, wherein the first instruction carries instruction information for detecting whether a card loss fault occurs in the expansion bus device; when it is determined based on the running result of the first instruction that the card loss fault occurs in the expansion bus device, repairing the card loss fault for the expansion bus device; when it is determined based on the running result of the first instruction that the card loss fault does not occur in the expansion bus device, calling a second instruction pre-written into the basic input / output system, and processing the expansion bus device according to the running result of the second instruction, wherein the second instruction carries instruction information for detecting whether a running fault occurs in the expansion bus device.
[0007] According to a fault handling method for an expansion bus device provided by the present invention, it is determined that the expansion bus device has a card loss fault based on the running result of the first instruction, and the method is implemented in the following manner: based on the first instruction, the manufacturer number register of the expansion bus device is read; when the manufacturer number value stored in the manufacturer number register is read as a preset manufacturer number value, it is determined that the expansion bus device has a card loss fault.
[0008] According to a fault handling method for an expansion bus device provided by the present invention, a card loss fault repair is performed on the expansion bus device in the following manner: a processing instruction is written into a register corresponding to the expansion bus device, wherein the processing instruction is used to first prohibit the operation of the root port of the register and then start the operation; the register calls the processing instruction so that the expansion bus device executes the processing instruction, thereby realizing card loss fault repair for the expansion bus device.
[0009] According to a fault handling method for an extended bus device provided by the present invention, the operation fault includes a bandwidth reduction fault and / or an operation speed reduction fault; the processing of the extended bus device according to the operation result of the second instruction specifically includes: based on the second instruction, reading the maximum bandwidth supported by the extended bus device and / or the maximum operation rate supported by the extended bus device stored in the offset register, and based on the second instruction, reading the actual negotiation success bandwidth of the extended bus device and / or the actual negotiation success operation rate of the extended bus device stored in the status register of the actual link negotiation; when the actual negotiation success bandwidth is less than the maximum bandwidth supported by the extended bus device, and / or the actual negotiation success operation rate is less than the maximum operation rate supported by the extended bus device, determining that the extended bus device has a bandwidth reduction and / or operation speed reduction fault; when the extended bus device has a bandwidth reduction and / or operation speed reduction fault, repairing the bandwidth reduction and / or operation speed reduction fault for the extended bus device.
[0010] According to a fault handling method for an expansion bus device provided by the present invention, bandwidth reduction and / or operation speed reduction fault repair of the expansion bus device is performed in the following manner: a processing instruction is written into a register corresponding to the expansion bus device, wherein the processing instruction is used to first prohibit operation processing of the root port of the register, and then start operation processing; the register calls the processing instruction so that the expansion bus device executes the processing instruction, thereby achieving bandwidth reduction and / or operation speed reduction fault repair of the expansion bus device.
[0011] According to a method for handling a fault of an expansion bus device provided by the present invention, after repairing the fault of reducing bandwidth and / or reducing operation speed of the expansion bus device, the method further comprises: re-detecting the fault repair result of the repair of the fault of reducing bandwidth and / or reducing operation speed of the expansion bus device; in the case where it is detected that the repair of the fault of reducing bandwidth and / or reducing operation speed of the expansion bus device is unsuccessful, first prohibiting the operation of the root port of the register for a preset number of consecutive times, and then starting the operation; re-detecting the fault repair result of the repair of the fault of reducing bandwidth and / or reducing operation speed of the expansion bus device again; in the case where it is detected that the repair of the fault of reducing bandwidth and / or reducing operation speed of the expansion bus device is unsuccessful, retraining the port of the expansion bus device; re-detecting the fault repair result of the repair of the fault of reducing bandwidth and / or reducing operation speed of the expansion bus device; in the case where it is detected that the repair of the fault of reducing bandwidth and / or reducing operation speed of the expansion bus device is unsuccessful, controlling the central processing unit of the basic input and output system to perform power-off and power-on processing.
[0012] The present invention also provides a fault processing device for an expansion bus device, the device comprising: a calling module, used to call a first instruction pre-written into the basic input and output system when the basic input and output system is initialized and started, wherein the first instruction carries instruction information for detecting whether a card loss fault occurs in the expansion bus device; a first repair processing module, used to repair the card loss fault of the expansion bus device when it is determined based on the running result of the first instruction that the card loss fault occurs in the expansion bus device; a second repair processing module, used to call a second instruction pre-written into the basic input and output system when it is determined based on the running result of the first instruction that the card loss fault does not occur in the expansion bus device, and process the expansion bus device according to the running result of the second instruction, wherein the second instruction carries instruction information for detecting whether an operation fault occurs in the expansion bus device.
[0013] According to a fault handling device for an expansion bus device provided by the present invention, the first repair processing module is implemented in the following manner to determine that a card loss fault occurs in the expansion bus device based on the running result of the first instruction: based on the first instruction, the manufacturer number register of the expansion bus device is read; when the manufacturer number value stored in the manufacturer number register is read as a preset manufacturer number value, it is determined that a card loss fault occurs in the expansion bus device.
[0014] The present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a fault handling method for an expansion bus device as described above is implemented.
[0015] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for handling a fault of an expansion bus device as described in any one of the above is implemented.
[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for handling a fault of an expansion bus device as described in any one of the above is implemented.
[0017] The method, device and electronic device for handling the fault of an expansion bus device provided by the present invention call a first instruction pre-written into the basic input / output system when the basic input / output system is initialized and started; when it is determined based on the running result of the first instruction that the expansion bus device has a card loss fault, the expansion bus device is repaired for the card loss fault; when it is determined based on the running result of the first instruction that the expansion bus device has not a card loss fault, the second instruction pre-written into the basic input / output system is called, and the expansion bus device is processed according to the running result of the second instruction, wherein the second instruction carries instruction information for detecting whether the expansion bus device has an operating fault. The method realizes that the processing cost of solving the expansion bus device fault can be reduced and the processing efficiency can be improved under the premise of effectively solving the expansion bus device fault. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 It is one of the flow charts of the method for handling a fault of an expansion bus device provided by the present invention;
[0020] Figure 2 It is a flow chart of processing an expansion bus device according to the running result of a second instruction provided by the present invention;
[0021] Figure 3 is a schematic diagram of the structure of the offset register provided by the present invention;
[0022] Figure 4 It is a schematic diagram of the structure of the status register of the actual link negotiation provided by the present invention;
[0023] Figure 5 This is a second flow chart of the method for handling a fault of an expansion bus device provided by the present invention;
[0024] Figure 6 It is a structural schematic diagram of a fault handling device for an expansion bus device provided by the present invention;
[0025] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings 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.
[0027] Figure 1 This is one of the flow charts of the method for handling a fault of an expansion bus device provided by the present invention.
[0028] The following will be combined Figure 1 The process of the fault handling method of the expansion bus device provided by the present invention is described.
[0029] In an exemplary embodiment of the present invention, Figure 1 It can be seen that the method for handling the failure of the expansion bus device may include steps 110 to 130, and each step will be introduced below.
[0030] In step 110, when the basic input and output system is initialized and started, a first instruction pre-written into the basic input and output system is called, wherein the first instruction carries instruction information for detecting whether a card loss fault occurs in an expansion bus device.
[0031] In one embodiment, when a Basic Input Output System (also called Bios) is initialized and started, a first instruction pre-written into the Basic Input Output System may be used, wherein the first instruction may be used to detect whether a card loss failure occurs in an expansion bus device.
[0032] In yet another embodiment, the first instruction pre-written into the basic input / output system may be implemented by adding a code related to the first instruction into the BIOS code.
[0033] In step 120, when it is determined based on the running result of the first instruction that a card loss fault occurs in the expansion bus device, the expansion bus device (PCI Express, also known as PCIE) is repaired for the card loss fault.
[0034] In another embodiment, when it is determined based on the running result of the first instruction that the expansion bus device has a card loss fault, the expansion bus device can be repaired for the card loss fault. It should be noted that if the expansion bus device has a card loss fault, then the expansion bus device will not have a bandwidth reduction and / or operation speed reduction fault. Before determining whether the expansion bus device has a bandwidth reduction and / or operation speed reduction fault, first determining whether the expansion bus device has a card loss fault can improve the efficiency of fault determination.
[0035] In addition, by timely locking the card loss failure of the expansion bus device during the initialization and startup of the basic input and output system, it is possible to determine whether there is a problem with the PCIE device at the earliest stage of server startup, avoiding the use of other measures to solve it in the system stage later. In this way, the problem of the PCIE device can be determined at the earliest time.
[0036] In step 130, when it is determined based on the running result of the first instruction that the expansion bus device has not had a card loss failure, a second instruction pre-written into the basic input and output system is called, and the expansion bus device is processed according to the running result of the second instruction, wherein the second instruction carries instruction information for detecting whether the expansion bus device has an operating failure.
[0037] The operation failure may include a bandwidth reduction failure and / or an operation speed reduction failure.
[0038] In another embodiment, when it is determined based on the running result of the first instruction that the expansion bus device does not have a card loss fault, a second instruction pre-written into the basic input and output system can be called, and the expansion bus device can be processed according to the running result of the second instruction. The second instruction can be used to detect whether the expansion bus device has a bandwidth reduction and / or a speed reduction fault.
[0039] In yet another embodiment, the second instruction pre-written into the basic input and output system may be implemented by adding codes related to the second instruction into the BIOS code.
[0040] During the application process, if it is determined that the expansion bus device does not have a card loss fault, it can be further determined whether the expansion bus device has a bandwidth reduction and / or a running speed reduction fault. If a related fault occurs, the fault can be handled in a timely manner.
[0041] In the above-mentioned embodiment, by timely and hierarchical determination of whether the expansion bus device is faulty during the initialization and startup of the basic input and output system, for example, first determining whether a card loss fault occurs, and then determining whether a bandwidth reduction and / or operation speed reduction fault occurs when no card loss fault occurs, the corresponding fault of the expansion bus device can be determined in a timely and efficient manner, and a foundation can be laid for timely solving the corresponding fault. This achieves that, on the premise of effectively solving the expansion bus device fault, the processing cost of solving the expansion bus device fault can be reduced and the processing efficiency can be improved.
[0042] The method for handling the failure of an expansion bus device provided by the present invention, when the basic input and output system is initialized and started, calls a first instruction pre-written into the basic input and output system; when it is determined based on the running result of the first instruction that the expansion bus device has a card loss failure, the expansion bus device is repaired for the card loss failure; when it is determined based on the running result of the first instruction that the expansion bus device has not a card loss failure, calls a second instruction pre-written into the basic input and output system, and handles the expansion bus device according to the running result of the second instruction, wherein the second instruction is used to detect whether the expansion bus device has a bandwidth reduction and / or a running speed reduction failure. The method realizes that the processing cost of solving the expansion bus device failure can be reduced and the processing efficiency can be improved under the premise of effectively solving the expansion bus device failure.
[0043] In another exemplary embodiment of the present invention, the above-mentioned embodiment is continued to be used as an example to illustrate that the card loss failure of the expansion bus device occurs based on the running result of the first instruction, which can be implemented in the following manner:
[0044] Based on the first instruction, reading the manufacturer number register of the expansion bus device;
[0045] When the manufacturer number value stored in the manufacturer number register is read as the preset manufacturer number value, it is determined that a card loss fault occurs in the expansion bus device.
[0046] In one embodiment, based on the first instruction, the manufacturer number register of the expansion bus device can be read to obtain the manufacturer number value (VID value) stored in the manufacturer number register, wherein the VID value of the card is unique to the card manufacturer and is an important indicator of whether the card is detected normally.
[0047] In another embodiment, when the manufacturer number value stored in the manufacturer number register is read as the preset manufacturer number value, for example, the VID values of the card are all F, it is considered that the card is not in place, that is, a card loss failure has occurred, and it can be determined that the expansion bus device has a card loss failure. It should be noted that the preset manufacturer number value can be adjusted according to actual conditions and is not specifically limited in this embodiment.
[0048] In another exemplary embodiment of the present invention, the above-mentioned embodiment is continued as an example to illustrate that the card loss fault repair of the expansion bus device can be implemented in the following manner:
[0049] Writing a processing instruction to a register corresponding to the expansion bus device, wherein the processing instruction is used to first prohibit the operation of the root port of the register and then start the operation;
[0050] The register calls the processing instruction so that the expansion bus device executes the processing instruction, thereby realizing card loss fault repair for the expansion bus device.
[0051] In one embodiment, a processing instruction can be written into a register corresponding to an expansion bus device, wherein the processing instruction can be used to first prohibit the operation of the root port of the register, and then start the operation. Further, the register calls the processing instruction so that the expansion bus device executes the processing instruction to achieve card loss fault repair for the expansion bus device.
[0052] In other words, a method of writing PCIE offset registers can be added to the BIOS code to operate and repair the PCIE device port. This will repair the previously problematic Pcie device. After the repair, the PCIE device will be normal. In this way, the problematic Pcie device can be successfully repaired at the earliest stage of the server product startup, without affecting the customer's subsequent use.
[0053] Figure 2 It is a flow chart of processing an expansion bus device according to the running result of a second instruction provided by the present invention.
[0054] The following will be combined Figure 2 The process of processing the expansion bus device according to the execution result of the second instruction is described.
[0055] In an exemplary embodiment of the present invention, Figure 2 It can be known that processing the expansion bus device according to the running result of the second instruction may include step 210 to step 240, and each step will be introduced below.
[0056] In step 210, based on the second instruction, the maximum bandwidth supported by the expansion bus device and / or the maximum operating rate supported by the expansion bus device stored in the offset register are read.
[0057] In one embodiment, based on the second instruction for detecting whether the expansion bus device has bandwidth reduction and / or speed reduction failure, the maximum bandwidth supported by the expansion bus device and / or the maximum operating rate supported by the expansion bus device stored in the offset register can be read.
[0058] Figure 3 It is a schematic diagram of the structure of the offset register provided by the present invention.
[0059] In one embodiment, a code for reading the offset register of the PCIe device can be added to the BIOS code. In the BIOS initialization stage, the offset register for reading the bandwidth and rate capability supported by the card is added to the BIOS code. Figure 3 By reading this register, you can get the maximum bandwidth and rate that the card can support. This will lock the bandwidth and rate of the card in the BIOS stage, providing a better reference timing benchmark.
[0060] In step 220, based on the second instruction, the actual negotiation success bandwidth of the expansion bus device and / or the actual negotiation success operation rate of the expansion bus device stored in the status register of the actual link negotiation are read.
[0061] In another embodiment, based on the second instruction for detecting whether the expansion bus device has a bandwidth reduction and / or an operation speed reduction failure, the actual negotiation success bandwidth of the expansion bus device and / or the actual negotiation success operation rate of the expansion bus device stored in the status register of the actual link negotiation can be read.
[0062] Figure 4 It is a schematic diagram of the structure of the status register of the actual link negotiation provided by the present invention.
[0063] In one embodiment, the part of the offset status register of the PCIe device that is actually negotiated by the Bios is added to the Bios code during the initialization phase, so that the bandwidth and rate actually achieved by the PCIe device at the earliest stage can be captured during the BIOS phase, which is also the earliest startup phase of the server product. See the offset register for details. Figure 4 shown.
[0064] In this embodiment, the code for comparing the bandwidth and the rate is added to the Bios code, so that it is possible to determine whether there is a problem with the PCIe device at the earliest stage of server startup, thereby avoiding the need to use other measures to solve the problem in the system stage. In this way, the problem of the PCIe device can be determined as early as possible.
[0065] In step 230, when the actual negotiated successful bandwidth is less than the maximum bandwidth supported by the expansion bus device, and / or the actual negotiated successful operating rate is less than the maximum operating rate supported by the expansion bus device, it is determined that the expansion bus device has a bandwidth reduction and / or operating speed reduction failure.
[0066] In step 240, when a bandwidth reduction and / or operation speed reduction fault occurs in an expansion bus device, the bandwidth reduction and / or operation speed reduction fault is repaired for the expansion bus device.
[0067] In another embodiment, when it is determined that the actual negotiated successful bandwidth is less than the maximum bandwidth that the extended bus device can support, and / or the actual negotiated successful operating rate is less than the maximum operating rate that the extended bus device can support, it can be determined that the extended bus device has a bandwidth reduction and / or operating speed reduction fault. Further, when the extended bus device has a bandwidth reduction and / or operating speed reduction fault, the extended bus device can be repaired for the bandwidth reduction and / or operating speed reduction fault.
[0068] In another exemplary embodiment of the present invention, the above-mentioned embodiment is continued as an example to illustrate that bandwidth reduction and / or speed reduction fault repair of the expansion bus device can be implemented in the following manner:
[0069] Writing a processing instruction to a register corresponding to the expansion bus device, wherein the processing instruction is used to first prohibit the operation of the root port of the register and then start the operation;
[0070] The processing instruction is called by the register so that the extended bus device executes the processing instruction, thereby reducing the bandwidth of the extended bus device and\or repairing the speed reduction fault.
[0071] In one embodiment, a processing instruction may be written into a register corresponding to an expansion bus device, wherein the processing instruction may be used to first prohibit the operation of the root port of the register, and then enable the operation. Further, the register calls the processing instruction so that the expansion bus device executes the processing instruction, thereby reducing the bandwidth of the expansion bus device and\or repairing the speed reduction fault.
[0072] In other words, a method of writing PCIE offset registers can be added to the BIOS code to operate and repair the PCIE device port. This will repair the previously problematic Pcie device. After the repair, the PCIE device will be normal. In this way, the problematic Pcie device can be successfully repaired at the earliest stage of the server product startup, without affecting the customer's subsequent use.
[0073] Figure 5 This is the second flow chart of the method for handling failures of the expansion bus device provided by the present invention.
[0074] The following will be combined Figure 5 The process of another method for handling a fault of an extension bus device provided by the present invention is described.
[0075] In another exemplary embodiment of the present invention, Figure 5 It can be seen that after the bandwidth of the expansion bus device is reduced and / or the speed reduction fault is repaired, the fault handling method of the expansion bus device may further include the following steps 510 to 560:
[0076] In step 510, the fault repair result of bandwidth reduction and / or operation speed reduction fault repair of the expansion bus device is re-detected.
[0077] In step 520, when it is detected that the bandwidth reduction and / or speed reduction fault repair of the expansion bus device is unsuccessful, the root port of the register is first prohibited from running for a preset number of times and then started to run.
[0078] In one embodiment, the fault repair result of bandwidth reduction and / or speed reduction fault repair of the expansion bus device can also be re-detected. The fault detection method can be consistent with the method described above and will not be described in detail in this embodiment.
[0079] Further, if it is detected that the bandwidth reduction and / or speed reduction fault repair of the expansion bus device is not successfully performed, the root port of the register can be prohibited from running for a preset number of times, and then the running process can be started to achieve bandwidth reduction and / or speed reduction fault repair of the expansion bus device. The preset number of times can be adjusted according to actual conditions and is not specifically limited in this embodiment.
[0080] In step 530, the fault repair result of bandwidth reduction and / or speed reduction fault repair of the expansion bus device is re-detected.
[0081] In step 540, when it is detected that the bandwidth reduction and / or speed reduction fault repair of the expansion bus device is unsuccessful, a retraining process is performed on the port of the expansion bus device.
[0082] In another embodiment, after the fault repair of the expansion bus device is completed, the fault repair result of bandwidth reduction and / or operation speed reduction of the expansion bus device can be re-tested to ensure the effectiveness of the repair.
[0083] If it is detected that the bandwidth reduction and / or speed reduction fault of the expansion bus device is not successfully repaired, it means that the above-mentioned repair method has disadvantages, and other methods can be used for repair. For example, the port of the expansion bus device can be retrained to effectively repair the bandwidth reduction and / or speed reduction fault of the expansion bus device.
[0084] In step 550, the fault repair result of bandwidth reduction and / or operation speed reduction fault repair of the expansion bus device is re-detected;
[0085] In step 560, when it is detected that the bandwidth reduction and / or speed reduction fault repair of the expansion bus device is unsuccessful, the central processing unit of the basic input and output system is controlled to power off and then power on.
[0086] In one embodiment, a signal path can also be established between the basic input and output system Bios and the field programmable gate array FPGA. For example, the channel of the I2C bus can be used, the FPGA chip is used as the slave of the BIOS, and the FPGA end opens up read and write registers accessible to the BIOS. When the BIOS end cannot solve the PCIE problem, the BIOS end can pass this information to the FPGA end through the I2C channel. When the FPGA end learns that the BIOS cannot repair the information, it will trigger the policy of the FPGA end to control the central processing unit of the basic input and output system to power off and then power on, thereby forcing the CPU to re-run, the BIOS end code to re-run, and re-initialize the training mechanism. Through this communication mechanism between the BIOS and the FPGA, the PCIE problem in the BIOS stage can be further effectively solved.
[0087] According to the above description, the method for handling the fault of the expansion bus device provided by the present invention, when the basic input and output system is initialized and started, calls the first instruction pre-written into the basic input and output system; when it is determined based on the running result of the first instruction that the expansion bus device has a card loss fault, the card loss fault is repaired for the expansion bus device; when it is determined based on the running result of the first instruction that the expansion bus device has not a card loss fault, calls the second instruction pre-written into the basic input and output system, and processes the expansion bus device according to the running result of the second instruction, wherein the second instruction is used to detect whether the expansion bus device has a bandwidth reduction and / or a speed reduction fault. It is achieved that on the premise of effectively solving the expansion bus device fault, the processing cost of solving the expansion bus device fault can be reduced and the processing efficiency can be improved.
[0088] Based on the same concept, the present invention also provides a fault handling device for an expansion bus device.
[0089] The following is a description of a fault handling device for an expansion bus device provided by the present invention. The fault handling device for an expansion bus device described below and the fault handling method for an expansion bus device described above can be referred to each other.
[0090] Figure 6 It is a structural schematic diagram of a fault handling device for an expansion bus device provided by the present invention.
[0091] In an exemplary embodiment of the present invention, Figure 6 It can be known that the fault processing device of the expansion bus device may include a calling module 610, a first repair processing module 620, and a second repair processing module 630, and each module will be introduced below.
[0092] The calling module 610 may be configured to call a first instruction pre-written into the basic input / output system when the basic input / output system is initialized and started, wherein the first instruction carries instruction information for detecting whether a card loss fault occurs in an expansion bus device;
[0093] The first repair processing module 620 may be configured to repair the card loss fault of the expansion bus device when it is determined based on the running result of the first instruction that the expansion bus device has a card loss fault;
[0094] The second repair processing module 630 can be configured to call a second instruction pre-written into the basic input and output system when it is determined based on the running result of the first instruction that the expansion bus device has not had a card loss failure, and process the expansion bus device according to the running result of the second instruction, wherein the second instruction carries instruction information for detecting whether the expansion bus device has an operating failure.
[0095] In an exemplary embodiment of the present invention, the first repair processing module 620 may determine that the expansion bus device has a card loss fault based on the running result of the first instruction in the following manner:
[0096] Based on the first instruction, reading the manufacturer number register of the expansion bus device;
[0097] When it is read that the manufacturer number value stored in the manufacturer number register is a preset manufacturer number value, it is determined that a card loss fault occurs in the expansion bus device.
[0098] In an exemplary embodiment of the present invention, the first repair processing module 620 can implement the card loss fault repair of the expansion bus device in the following manner:
[0099] Writing a processing instruction into a register corresponding to the expansion bus device, wherein the processing instruction is used to first prohibit the root port of the register from running, and then to start running;
[0100] The register calls the processing instruction so that the expansion bus device executes the processing instruction, thereby realizing card loss fault repair for the expansion bus device.
[0101] In an exemplary embodiment of the present invention, the operation fault includes a bandwidth reduction fault and / or an operation speed reduction fault; the second repair processing module 630 can process the expansion bus device according to the operation result of the second instruction in the following manner:
[0102] Based on the second instruction, read the maximum bandwidth supported by the expansion bus device and / or the maximum operating rate supported by the expansion bus device stored in the offset register, and
[0103] Based on the second instruction, reading the actual negotiation success bandwidth of the expansion bus device and / or the actual negotiation success running rate of the expansion bus device stored in the status register of the actual link negotiation;
[0104] When the actual negotiated successful bandwidth is less than the maximum bandwidth that the extended bus device can support, and / or the actual negotiated successful operation rate is less than the maximum operation rate that the extended bus device can support, it is determined that the extended bus device has a bandwidth reduction and / or operation speed reduction fault;
[0105] In the case where the expansion bus device has a bandwidth reduction and / or an operation speed reduction fault, the expansion bus device is repaired for the bandwidth reduction and / or operation speed reduction fault.
[0106] In an exemplary embodiment of the present invention, the second repair processing module 630 can implement bandwidth reduction and / or operation speed reduction fault repair of the expansion bus device in the following manner:
[0107] Writing a processing instruction into a register corresponding to the expansion bus device, wherein the processing instruction is used to first prohibit the root port of the register from running, and then to start running;
[0108] The register calls the processing instruction so that the extended bus device executes the processing instruction, thereby reducing the bandwidth of the extended bus device and\or repairing the speed reduction fault.
[0109] In an exemplary embodiment of the present invention, the second repair processing module 630 may also be configured to:
[0110] Re-testing the fault repair results of bandwidth reduction and / or operation speed reduction fault repair of the expansion bus device;
[0111] In case that it is detected that the bandwidth reduction and / or speed reduction fault repair of the expansion bus device is unsuccessful, the root port of the register is first prohibited from running for a preset number of times, and then started to run;
[0112] Re-testing the fault repair result of bandwidth reduction and / or speed reduction fault repair of the expansion bus device;
[0113] In the case where it is detected that the bandwidth reduction and / or speed reduction fault repair of the expansion bus device is unsuccessful, retraining the port of the expansion bus device; re-detecting the fault repair result of the bandwidth reduction and / or speed reduction fault repair of the expansion bus device;
[0114] In the case where it is detected that the bandwidth reduction and / or speed reduction fault repair of the expansion bus device is unsuccessful, the central processing unit controlling the basic input and output system is powered off and then powered on.
[0115] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the fault handling method of the expansion bus device, the method comprising: when the basic input and output system is initialized and started, calling the first instruction pre-written in the basic input and output system, wherein the first instruction carries the instruction information for detecting whether the expansion bus device has a card loss fault; when it is determined based on the running result of the first instruction that the expansion bus device has a card loss fault, repairing the card loss fault of the expansion bus device; when it is determined based on the running result of the first instruction that the expansion bus device has not a card loss fault, calling the second instruction pre-written in the basic input and output system, and processing the expansion bus device according to the running result of the second instruction, wherein the second instruction carries the instruction information for detecting whether the expansion bus device has an operation fault.
[0116] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0117] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the fault handling method of the expansion bus device provided by the above-mentioned methods, the method including: when a basic input and output system is initialized and started, calling a first instruction pre-written into the basic input and output system, wherein the first instruction carries instruction information for detecting whether a card loss fault occurs in the expansion bus device; when it is determined based on the running result of the first instruction that the expansion bus device has a card loss fault, repairing the card loss fault of the expansion bus device; when it is determined based on the running result of the first instruction that the expansion bus device does not have a card loss fault, calling a second instruction pre-written into the basic input and output system, and processing the expansion bus device according to the running result of the second instruction, wherein the second instruction carries instruction information for detecting whether an operation fault occurs in the expansion bus device.
[0118] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the fault handling method for the expansion bus device provided by the above-mentioned methods, the method comprising: when a basic input / output system is initialized and started, calling a first instruction pre-written into the basic input / output system, wherein the first instruction carries instruction information for detecting whether a card loss fault occurs in the expansion bus device; when it is determined based on the running result of the first instruction that the expansion bus device has a card loss fault, repairing the card loss fault of the expansion bus device; when it is determined based on the running result of the first instruction that the expansion bus device has not had a card loss fault, calling a second instruction pre-written into the basic input / output system, and processing the expansion bus device according to the running result of the second instruction, wherein the second instruction carries instruction information for detecting whether an operation fault occurs in the expansion bus device.
[0119] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0120] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0121] It is further understood that, although the operations are described in a specific order in the accompanying drawings in the embodiments of the present invention, it should not be understood as requiring the operations to be performed in the specific order or serial order shown, or requiring the execution of all the operations shown to obtain the desired results. In certain environments, multitasking and parallel processing may be advantageous.
[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for handling a fault of an expansion bus device, characterized in that: The method comprises: When the basic input and output system is initialized and started, calling a first instruction pre-written into the basic input and output system, wherein the first instruction carries instruction information for detecting whether a card loss fault occurs in an expansion bus device; In the case where it is determined based on the running result of the first instruction that the expansion bus device has a card loss fault, repairing the card loss fault of the expansion bus device; When it is determined based on the running result of the first instruction that the expansion bus device has not had a card loss failure, a second instruction pre-written into the basic input and output system is called, and the expansion bus device is processed according to the running result of the second instruction, wherein the second instruction carries instruction information for detecting whether the expansion bus device has an operating failure.
2. The method for handling a fault of an expansion bus device according to claim 1, characterized in that: Determining that a card loss failure occurs in the expansion bus device based on the running result of the first instruction is implemented in the following manner: Based on the first instruction, reading the manufacturer number register of the expansion bus device; When it is read that the manufacturer number value stored in the manufacturer number register is a preset manufacturer number value, it is determined that a card loss fault occurs in the expansion bus device.
3. The method for handling a fault of an expansion bus device according to claim 1 or 2, characterized in that: The card loss fault repair of the expansion bus device is implemented in the following way: Writing a processing instruction into a register corresponding to the expansion bus device, wherein the processing instruction is used to first prohibit the root port of the register from running, and then to start running; The register calls the processing instruction so that the expansion bus device executes the processing instruction, thereby realizing card loss fault repair for the expansion bus device.
4. The method for handling a fault of an expansion bus device according to claim 1, characterized in that: The operation fault includes a bandwidth reduction fault and / or an operation speed reduction fault; the processing of the expansion bus device according to the operation result of the second instruction specifically includes: Based on the second instruction, read the maximum bandwidth supported by the expansion bus device and / or the maximum operating rate supported by the expansion bus device stored in the offset register, and Based on the second instruction, reading the actual negotiation success bandwidth of the expansion bus device and / or the actual negotiation success running rate of the expansion bus device stored in the status register of the actual link negotiation; When the actual negotiated successful bandwidth is less than the maximum bandwidth that the extended bus device can support, and / or the actual negotiated successful operation rate is less than the maximum operation rate that the extended bus device can support, it is determined that the extended bus device has a bandwidth reduction and / or operation speed reduction fault; In the case where the expansion bus device has a bandwidth reduction and / or an operation speed reduction fault, the expansion bus device is repaired for the bandwidth reduction and / or operation speed reduction fault.
5. The method for handling a fault of an expansion bus device according to claim 4, characterized in that: The bandwidth reduction and / or speed reduction fault repair of the expansion bus device is implemented in the following manner: Writing a processing instruction into a register corresponding to the expansion bus device, wherein the processing instruction is used to first prohibit the root port of the register from running, and then to start running; The register calls the processing instruction so that the extended bus device executes the processing instruction, thereby reducing the bandwidth of the extended bus device and\or repairing the speed reduction fault.
6. The method for handling a fault of an expansion bus device according to claim 4 or 5, characterized in that: After reducing the bandwidth of the expansion bus device and\or repairing the speed reduction fault, the method further includes: Re-testing the fault repair results of bandwidth reduction and / or operation speed reduction fault repair of the expansion bus device; In case that it is detected that the bandwidth reduction and / or speed reduction fault repair of the expansion bus device is unsuccessful, the root port of the register is first prohibited from running for a preset number of times, and then started to run; Re-testing the fault repair result of bandwidth reduction and / or speed reduction fault repair of the expansion bus device; In case it is detected that the bandwidth reduction and / or speed reduction fault repair of the expansion bus device is unsuccessful, retraining the port of the expansion bus device; Re-testing the fault repair results of bandwidth reduction and / or operation speed reduction fault repair of the expansion bus device; In the case where it is detected that the bandwidth reduction and / or speed reduction fault repair of the expansion bus device is unsuccessful, the central processing unit controlling the basic input and output system is powered off and then powered on.
7. A fault handling device for an expansion bus device, characterized in that: The device comprises: A calling module, used for calling a first instruction pre-written into the basic input and output system when the basic input and output system is initialized and started, wherein the first instruction carries instruction information for detecting whether a card loss fault occurs in an expansion bus device; A first repair processing module, configured to repair the card loss fault of the expansion bus device when it is determined based on the running result of the first instruction that the expansion bus device has a card loss fault; The second repair processing module is used to call a second instruction pre-written into the basic input and output system when it is determined based on the running result of the first instruction that the expansion bus device has not had a card loss failure, and process the expansion bus device according to the running result of the second instruction, wherein the second instruction carries instruction information for detecting whether the expansion bus device has an operating failure.
8. The fault handling device for expansion bus equipment according to claim 7, characterized in that: The first repair processing module is implemented in the following manner to determine that the expansion bus device has a card loss fault based on the running result of the first instruction: Based on the first instruction, reading the manufacturer number register of the expansion bus device; When it is read that the manufacturer number value stored in the manufacturer number register is a preset manufacturer number value, it is determined that a card loss fault occurs in the expansion bus device.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the fault handling method for the expansion bus device according to any one of claims 1 to 6 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the fault handling method of the expansion bus device according to any one of claims 1 to 6 is implemented.
