Commit 67297ad8 authored by Padmanabh Ratnakar's avatar Padmanabh Ratnakar Committed by David S. Miller

be2net: Wait till resources are available for VF in error recovery

After FW error, driver should wait for NO_RESOURCE error to disappear before
proceeding with recovery.
Signed-off-by: default avatarPadmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 704e4c88
...@@ -452,10 +452,33 @@ int lancer_wait_ready(struct be_adapter *adapter) ...@@ -452,10 +452,33 @@ int lancer_wait_ready(struct be_adapter *adapter)
return status; return status;
} }
static bool lancer_provisioning_error(struct be_adapter *adapter)
{
u32 sliport_status = 0, sliport_err1 = 0, sliport_err2 = 0;
sliport_status = ioread32(adapter->db + SLIPORT_STATUS_OFFSET);
if (sliport_status & SLIPORT_STATUS_ERR_MASK) {
sliport_err1 = ioread32(adapter->db +
SLIPORT_ERROR1_OFFSET);
sliport_err2 = ioread32(adapter->db +
SLIPORT_ERROR2_OFFSET);
if (sliport_err1 == SLIPORT_ERROR_NO_RESOURCE1 &&
sliport_err2 == SLIPORT_ERROR_NO_RESOURCE2)
return true;
}
return false;
}
int lancer_test_and_set_rdy_state(struct be_adapter *adapter) int lancer_test_and_set_rdy_state(struct be_adapter *adapter)
{ {
int status; int status;
u32 sliport_status, err, reset_needed; u32 sliport_status, err, reset_needed;
bool resource_error;
resource_error = lancer_provisioning_error(adapter);
if (resource_error)
return -1;
status = lancer_wait_ready(adapter); status = lancer_wait_ready(adapter);
if (!status) { if (!status) {
sliport_status = ioread32(adapter->db + SLIPORT_STATUS_OFFSET); sliport_status = ioread32(adapter->db + SLIPORT_STATUS_OFFSET);
...@@ -477,6 +500,14 @@ int lancer_test_and_set_rdy_state(struct be_adapter *adapter) ...@@ -477,6 +500,14 @@ int lancer_test_and_set_rdy_state(struct be_adapter *adapter)
status = -1; status = -1;
} }
} }
/* Stop error recovery if error is not recoverable.
* No resource error is temporary errors and will go away
* when PF provisions resources.
*/
resource_error = lancer_provisioning_error(adapter);
if (status == -1 && !resource_error)
adapter->eeh_error = true;
return status; return status;
} }
......
...@@ -59,6 +59,9 @@ ...@@ -59,6 +59,9 @@
#define PHYSDEV_CONTROL_FW_RESET_MASK 0x00000002 #define PHYSDEV_CONTROL_FW_RESET_MASK 0x00000002
#define PHYSDEV_CONTROL_INP_MASK 0x40000000 #define PHYSDEV_CONTROL_INP_MASK 0x40000000
#define SLIPORT_ERROR_NO_RESOURCE1 0x2
#define SLIPORT_ERROR_NO_RESOURCE2 0x9
/********* 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
......
...@@ -3837,8 +3837,9 @@ static int lancer_recover_func(struct be_adapter *adapter) ...@@ -3837,8 +3837,9 @@ static int lancer_recover_func(struct be_adapter *adapter)
"Adapter SLIPORT recovery succeeded\n"); "Adapter SLIPORT recovery succeeded\n");
return 0; return 0;
err: err:
dev_err(&adapter->pdev->dev, if (adapter->eeh_error)
"Adapter SLIPORT recovery failed\n"); dev_err(&adapter->pdev->dev,
"Adapter SLIPORT 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