Commit 4bebb56a authored by Somnath Kotur's avatar Somnath Kotur Committed by David S. Miller

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: default avatarKalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: default avatarSomnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d0b7da8a
...@@ -64,6 +64,9 @@ ...@@ -64,6 +64,9 @@
#define SLIPORT_ERROR_NO_RESOURCE1 0x2 #define SLIPORT_ERROR_NO_RESOURCE1 0x2
#define SLIPORT_ERROR_NO_RESOURCE2 0x9 #define SLIPORT_ERROR_NO_RESOURCE2 0x9
#define SLIPORT_ERROR_FW_RESET1 0x2
#define SLIPORT_ERROR_FW_RESET2 0x0
/********* Memory BAR register ************/ /********* Memory BAR register ************/
#define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 0xfc #define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 0xfc
/* Host Interrupt Enable, if set interrupts are enabled although "PCI Interrupt /* Host Interrupt Enable, if set interrupts are enabled although "PCI Interrupt
......
...@@ -2464,8 +2464,16 @@ void be_detect_error(struct be_adapter *adapter) ...@@ -2464,8 +2464,16 @@ void be_detect_error(struct be_adapter *adapter)
*/ */
if (sliport_status & SLIPORT_STATUS_ERR_MASK) { if (sliport_status & SLIPORT_STATUS_ERR_MASK) {
adapter->hw_error = true; adapter->hw_error = true;
dev_err(&adapter->pdev->dev, /* Do not log error messages if its a FW reset */
"Error detected in the card\n"); 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) { if (sliport_status & SLIPORT_STATUS_ERR_MASK) {
...@@ -3812,6 +3820,8 @@ static int lancer_fw_download(struct be_adapter *adapter, ...@@ -3812,6 +3820,8 @@ static int lancer_fw_download(struct be_adapter *adapter,
} }
if (change_status == LANCER_FW_RESET_NEEDED) { if (change_status == LANCER_FW_RESET_NEEDED) {
dev_info(&adapter->pdev->dev,
"Resetting adapter to activate new FW\n");
status = lancer_physdev_ctrl(adapter, status = lancer_physdev_ctrl(adapter,
PHYSDEV_CONTROL_FW_RESET_MASK); PHYSDEV_CONTROL_FW_RESET_MASK);
if (status) { if (status) {
...@@ -4363,13 +4373,13 @@ static int lancer_recover_func(struct be_adapter *adapter) ...@@ -4363,13 +4373,13 @@ static int lancer_recover_func(struct be_adapter *adapter)
goto err; goto err;
} }
dev_err(dev, "Error recovery successful\n"); dev_err(dev, "Adapter recovery successful\n");
return 0; return 0;
err: err:
if (status == -EAGAIN) if (status == -EAGAIN)
dev_err(dev, "Waiting for resource provisioning\n"); dev_err(dev, "Waiting for resource provisioning\n");
else else
dev_err(dev, "Error recovery failed\n"); dev_err(dev, "Adapter recovery failed\n");
return status; return status;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment