mirror of https://gitee.com/openkylin/linux.git
be2net: Fix Lancer error recovery to distinguish FW download
The Firmware update would be detected by looking at the sliport_error1/ sliport_error2 register values(0x02/0x00). If its not a FW reset the current messaging would take place. If the error is due to FW reset, log a message to user that "Firmware update in progress" and also do not log sliport_status and sliport_error register values. Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d0b7da8afa
commit
4bebb56a6d
|
@ -64,6 +64,9 @@
|
|||
#define SLIPORT_ERROR_NO_RESOURCE1 0x2
|
||||
#define SLIPORT_ERROR_NO_RESOURCE2 0x9
|
||||
|
||||
#define SLIPORT_ERROR_FW_RESET1 0x2
|
||||
#define SLIPORT_ERROR_FW_RESET2 0x0
|
||||
|
||||
/********* Memory BAR register ************/
|
||||
#define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 0xfc
|
||||
/* Host Interrupt Enable, if set interrupts are enabled although "PCI Interrupt
|
||||
|
|
|
@ -2464,8 +2464,16 @@ void be_detect_error(struct be_adapter *adapter)
|
|||
*/
|
||||
if (sliport_status & SLIPORT_STATUS_ERR_MASK) {
|
||||
adapter->hw_error = true;
|
||||
dev_err(&adapter->pdev->dev,
|
||||
"Error detected in the card\n");
|
||||
/* Do not log error messages if its a FW reset */
|
||||
if (sliport_err1 == SLIPORT_ERROR_FW_RESET1 &&
|
||||
sliport_err2 == SLIPORT_ERROR_FW_RESET2) {
|
||||
dev_info(&adapter->pdev->dev,
|
||||
"Firmware update in progress\n");
|
||||
return;
|
||||
} else {
|
||||
dev_err(&adapter->pdev->dev,
|
||||
"Error detected in the card\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (sliport_status & SLIPORT_STATUS_ERR_MASK) {
|
||||
|
@ -3812,6 +3820,8 @@ static int lancer_fw_download(struct be_adapter *adapter,
|
|||
}
|
||||
|
||||
if (change_status == LANCER_FW_RESET_NEEDED) {
|
||||
dev_info(&adapter->pdev->dev,
|
||||
"Resetting adapter to activate new FW\n");
|
||||
status = lancer_physdev_ctrl(adapter,
|
||||
PHYSDEV_CONTROL_FW_RESET_MASK);
|
||||
if (status) {
|
||||
|
@ -4363,13 +4373,13 @@ static int lancer_recover_func(struct be_adapter *adapter)
|
|||
goto err;
|
||||
}
|
||||
|
||||
dev_err(dev, "Error recovery successful\n");
|
||||
dev_err(dev, "Adapter recovery successful\n");
|
||||
return 0;
|
||||
err:
|
||||
if (status == -EAGAIN)
|
||||
dev_err(dev, "Waiting for resource provisioning\n");
|
||||
else
|
||||
dev_err(dev, "Error recovery failed\n");
|
||||
dev_err(dev, "Adapter recovery failed\n");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue