|
@@ -88,19 +88,21 @@ static inline void *embedded_payload(struct be_mcc_wrb *wrb)
|
|
return wrb->payload.embedded_payload;
|
|
return wrb->payload.embedded_payload;
|
|
}
|
|
}
|
|
|
|
|
|
-static void be_mcc_notify(struct be_adapter *adapter)
|
|
|
|
|
|
+static int be_mcc_notify(struct be_adapter *adapter)
|
|
{
|
|
{
|
|
struct be_queue_info *mccq = &adapter->mcc_obj.q;
|
|
struct be_queue_info *mccq = &adapter->mcc_obj.q;
|
|
u32 val = 0;
|
|
u32 val = 0;
|
|
|
|
|
|
if (be_check_error(adapter, BE_ERROR_ANY))
|
|
if (be_check_error(adapter, BE_ERROR_ANY))
|
|
- return;
|
|
|
|
|
|
+ return -EIO;
|
|
|
|
|
|
val |= mccq->id & DB_MCCQ_RING_ID_MASK;
|
|
val |= mccq->id & DB_MCCQ_RING_ID_MASK;
|
|
val |= 1 << DB_MCCQ_NUM_POSTED_SHIFT;
|
|
val |= 1 << DB_MCCQ_NUM_POSTED_SHIFT;
|
|
|
|
|
|
wmb();
|
|
wmb();
|
|
iowrite32(val, adapter->db + DB_MCCQ_OFFSET);
|
|
iowrite32(val, adapter->db + DB_MCCQ_OFFSET);
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
/* To check if valid bit is set, check the entire word as we don't know
|
|
/* To check if valid bit is set, check the entire word as we don't know
|
|
@@ -541,7 +543,9 @@ static int be_mcc_notify_wait(struct be_adapter *adapter)
|
|
|
|
|
|
resp = be_decode_resp_hdr(wrb->tag0, wrb->tag1);
|
|
resp = be_decode_resp_hdr(wrb->tag0, wrb->tag1);
|
|
|
|
|
|
- be_mcc_notify(adapter);
|
|
|
|
|
|
+ status = be_mcc_notify(adapter);
|
|
|
|
+ if (status)
|
|
|
|
+ goto out;
|
|
|
|
|
|
status = be_mcc_wait_compl(adapter);
|
|
status = be_mcc_wait_compl(adapter);
|
|
if (status == -EIO)
|
|
if (status == -EIO)
|
|
@@ -1547,7 +1551,10 @@ int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd)
|
|
else
|
|
else
|
|
hdr->version = 2;
|
|
hdr->version = 2;
|
|
|
|
|
|
- be_mcc_notify(adapter);
|
|
|
|
|
|
+ status = be_mcc_notify(adapter);
|
|
|
|
+ if (status)
|
|
|
|
+ goto err;
|
|
|
|
+
|
|
adapter->stats_cmd_sent = true;
|
|
adapter->stats_cmd_sent = true;
|
|
|
|
|
|
err:
|
|
err:
|
|
@@ -1583,7 +1590,10 @@ int lancer_cmd_get_pport_stats(struct be_adapter *adapter,
|
|
req->cmd_params.params.pport_num = cpu_to_le16(adapter->hba_port_num);
|
|
req->cmd_params.params.pport_num = cpu_to_le16(adapter->hba_port_num);
|
|
req->cmd_params.params.reset_stats = 0;
|
|
req->cmd_params.params.reset_stats = 0;
|
|
|
|
|
|
- be_mcc_notify(adapter);
|
|
|
|
|
|
+ status = be_mcc_notify(adapter);
|
|
|
|
+ if (status)
|
|
|
|
+ goto err;
|
|
|
|
+
|
|
adapter->stats_cmd_sent = true;
|
|
adapter->stats_cmd_sent = true;
|
|
|
|
|
|
err:
|
|
err:
|
|
@@ -1687,8 +1697,7 @@ int be_cmd_get_die_temperature(struct be_adapter *adapter)
|
|
OPCODE_COMMON_GET_CNTL_ADDITIONAL_ATTRIBUTES,
|
|
OPCODE_COMMON_GET_CNTL_ADDITIONAL_ATTRIBUTES,
|
|
sizeof(*req), wrb, NULL);
|
|
sizeof(*req), wrb, NULL);
|
|
|
|
|
|
- be_mcc_notify(adapter);
|
|
|
|
-
|
|
|
|
|
|
+ status = be_mcc_notify(adapter);
|
|
err:
|
|
err:
|
|
spin_unlock_bh(&adapter->mcc_lock);
|
|
spin_unlock_bh(&adapter->mcc_lock);
|
|
return status;
|
|
return status;
|
|
@@ -1860,7 +1869,7 @@ static int __be_cmd_modify_eqd(struct be_adapter *adapter,
|
|
cpu_to_le32(set_eqd[i].delay_multiplier);
|
|
cpu_to_le32(set_eqd[i].delay_multiplier);
|
|
}
|
|
}
|
|
|
|
|
|
- be_mcc_notify(adapter);
|
|
|
|
|
|
+ status = be_mcc_notify(adapter);
|
|
err:
|
|
err:
|
|
spin_unlock_bh(&adapter->mcc_lock);
|
|
spin_unlock_bh(&adapter->mcc_lock);
|
|
return status;
|
|
return status;
|
|
@@ -2320,7 +2329,10 @@ int lancer_cmd_write_object(struct be_adapter *adapter, struct be_dma_mem *cmd,
|
|
req->addr_high = cpu_to_le32(upper_32_bits(cmd->dma +
|
|
req->addr_high = cpu_to_le32(upper_32_bits(cmd->dma +
|
|
sizeof(struct lancer_cmd_req_write_object)));
|
|
sizeof(struct lancer_cmd_req_write_object)));
|
|
|
|
|
|
- be_mcc_notify(adapter);
|
|
|
|
|
|
+ status = be_mcc_notify(adapter);
|
|
|
|
+ if (status)
|
|
|
|
+ goto err_unlock;
|
|
|
|
+
|
|
spin_unlock_bh(&adapter->mcc_lock);
|
|
spin_unlock_bh(&adapter->mcc_lock);
|
|
|
|
|
|
if (!wait_for_completion_timeout(&adapter->et_cmd_compl,
|
|
if (!wait_for_completion_timeout(&adapter->et_cmd_compl,
|
|
@@ -2491,7 +2503,10 @@ int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd,
|
|
req->params.op_code = cpu_to_le32(flash_opcode);
|
|
req->params.op_code = cpu_to_le32(flash_opcode);
|
|
req->params.data_buf_size = cpu_to_le32(buf_size);
|
|
req->params.data_buf_size = cpu_to_le32(buf_size);
|
|
|
|
|
|
- be_mcc_notify(adapter);
|
|
|
|
|
|
+ status = be_mcc_notify(adapter);
|
|
|
|
+ if (status)
|
|
|
|
+ goto err_unlock;
|
|
|
|
+
|
|
spin_unlock_bh(&adapter->mcc_lock);
|
|
spin_unlock_bh(&adapter->mcc_lock);
|
|
|
|
|
|
if (!wait_for_completion_timeout(&adapter->et_cmd_compl,
|
|
if (!wait_for_completion_timeout(&adapter->et_cmd_compl,
|
|
@@ -2636,7 +2651,9 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num,
|
|
req->num_pkts = cpu_to_le32(num_pkts);
|
|
req->num_pkts = cpu_to_le32(num_pkts);
|
|
req->loopback_type = cpu_to_le32(loopback_type);
|
|
req->loopback_type = cpu_to_le32(loopback_type);
|
|
|
|
|
|
- be_mcc_notify(adapter);
|
|
|
|
|
|
+ status = be_mcc_notify(adapter);
|
|
|
|
+ if (status)
|
|
|
|
+ goto err;
|
|
|
|
|
|
spin_unlock_bh(&adapter->mcc_lock);
|
|
spin_unlock_bh(&adapter->mcc_lock);
|
|
|
|
|