Commit e673244a authored by Kalesh AP's avatar Kalesh AP Committed by David S. Miller

be2net: add a log message for POST timeout in Lancer

This patch adds a log message in case of POST timeout in Lancer to
help debugging failure cases. It also logs sliport_status register value in
case of POST timeout.
Signed-off-by: default avatarKalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 18fd6025
...@@ -573,7 +573,7 @@ static int lancer_wait_ready(struct be_adapter *adapter) ...@@ -573,7 +573,7 @@ static int lancer_wait_ready(struct be_adapter *adapter)
{ {
#define SLIPORT_READY_TIMEOUT 30 #define SLIPORT_READY_TIMEOUT 30
u32 sliport_status; u32 sliport_status;
int status = 0, i; int i;
for (i = 0; i < SLIPORT_READY_TIMEOUT; i++) { for (i = 0; i < SLIPORT_READY_TIMEOUT; i++) {
sliport_status = ioread32(adapter->db + SLIPORT_STATUS_OFFSET); sliport_status = ioread32(adapter->db + SLIPORT_STATUS_OFFSET);
...@@ -584,9 +584,9 @@ static int lancer_wait_ready(struct be_adapter *adapter) ...@@ -584,9 +584,9 @@ static int lancer_wait_ready(struct be_adapter *adapter)
} }
if (i == SLIPORT_READY_TIMEOUT) if (i == SLIPORT_READY_TIMEOUT)
status = -1; return sliport_status ? : -1;
return status; return 0;
} }
static bool lancer_provisioning_error(struct be_adapter *adapter) static bool lancer_provisioning_error(struct be_adapter *adapter)
...@@ -624,7 +624,7 @@ int lancer_test_and_set_rdy_state(struct be_adapter *adapter) ...@@ -624,7 +624,7 @@ int lancer_test_and_set_rdy_state(struct be_adapter *adapter)
iowrite32(SLI_PORT_CONTROL_IP_MASK, iowrite32(SLI_PORT_CONTROL_IP_MASK,
adapter->db + SLIPORT_CONTROL_OFFSET); adapter->db + SLIPORT_CONTROL_OFFSET);
/* check adapter has corrected the error */ /* check if adapter has corrected the error */
status = lancer_wait_ready(adapter); status = lancer_wait_ready(adapter);
sliport_status = ioread32(adapter->db + sliport_status = ioread32(adapter->db +
SLIPORT_STATUS_OFFSET); SLIPORT_STATUS_OFFSET);
...@@ -655,7 +655,11 @@ int be_fw_wait_ready(struct be_adapter *adapter) ...@@ -655,7 +655,11 @@ int be_fw_wait_ready(struct be_adapter *adapter)
if (lancer_chip(adapter)) { if (lancer_chip(adapter)) {
status = lancer_wait_ready(adapter); status = lancer_wait_ready(adapter);
return status; if (status) {
stage = status;
goto err;
}
return 0;
} }
do { do {
...@@ -671,7 +675,8 @@ int be_fw_wait_ready(struct be_adapter *adapter) ...@@ -671,7 +675,8 @@ int be_fw_wait_ready(struct be_adapter *adapter)
timeout += 2; timeout += 2;
} while (timeout < 60); } while (timeout < 60);
dev_err(dev, "POST timeout; stage=0x%x\n", stage); err:
dev_err(dev, "POST timeout; stage=%#x\n", stage);
return -1; return -1;
} }
......
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