Commit fc718bb2 authored by Venkat Duvvuru's avatar Venkat Duvvuru Committed by David S. Miller

bnxt_en: Set hwrm_intr_seq_id value to its inverted value.

Set hwrm_intr_seq_id value to its inverted value instead of
HWRM_SEQ_INVALID, when an hwrm completion of type
CMPL_BASE_TYPE_HWRM_DONE is received. This will enable us to use
the complete 16-bit sequence ID space.
Signed-off-by: default avatarVenkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3322479e
...@@ -1812,7 +1812,7 @@ static int bnxt_hwrm_handler(struct bnxt *bp, struct tx_cmp *txcmp) ...@@ -1812,7 +1812,7 @@ static int bnxt_hwrm_handler(struct bnxt *bp, struct tx_cmp *txcmp)
case CMPL_BASE_TYPE_HWRM_DONE: case CMPL_BASE_TYPE_HWRM_DONE:
seq_id = le16_to_cpu(h_cmpl->sequence_id); seq_id = le16_to_cpu(h_cmpl->sequence_id);
if (seq_id == bp->hwrm_intr_seq_id) if (seq_id == bp->hwrm_intr_seq_id)
bp->hwrm_intr_seq_id = HWRM_SEQ_ID_INVALID; bp->hwrm_intr_seq_id = (u16)~bp->hwrm_intr_seq_id;
else else
netdev_err(bp->dev, "Invalid hwrm seq id %d\n", seq_id); netdev_err(bp->dev, "Invalid hwrm seq id %d\n", seq_id);
break; break;
...@@ -3827,8 +3827,10 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len, ...@@ -3827,8 +3827,10 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
tmo_count += DIV_ROUND_UP(timeout, HWRM_MIN_TIMEOUT); tmo_count += DIV_ROUND_UP(timeout, HWRM_MIN_TIMEOUT);
resp_len = bp->hwrm_cmd_resp_addr + HWRM_RESP_LEN_OFFSET; resp_len = bp->hwrm_cmd_resp_addr + HWRM_RESP_LEN_OFFSET;
if (intr_process) { if (intr_process) {
u16 seq_id = bp->hwrm_intr_seq_id;
/* Wait until hwrm response cmpl interrupt is processed */ /* Wait until hwrm response cmpl interrupt is processed */
while (bp->hwrm_intr_seq_id != HWRM_SEQ_ID_INVALID && while (bp->hwrm_intr_seq_id != (u16)~seq_id &&
i++ < tmo_count) { i++ < tmo_count) {
/* on first few passes, just barely sleep */ /* on first few passes, just barely sleep */
if (i < HWRM_SHORT_TIMEOUT_COUNTER) if (i < HWRM_SHORT_TIMEOUT_COUNTER)
...@@ -3839,7 +3841,7 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len, ...@@ -3839,7 +3841,7 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
HWRM_MAX_TIMEOUT); HWRM_MAX_TIMEOUT);
} }
if (bp->hwrm_intr_seq_id != HWRM_SEQ_ID_INVALID) { if (bp->hwrm_intr_seq_id != (u16)~seq_id) {
netdev_err(bp->dev, "Resp cmpl intr err msg: 0x%x\n", netdev_err(bp->dev, "Resp cmpl intr err msg: 0x%x\n",
le16_to_cpu(req->req_type)); le16_to_cpu(req->req_type));
return -1; return -1;
......
...@@ -567,7 +567,6 @@ struct nqe_cn { ...@@ -567,7 +567,6 @@ struct nqe_cn {
#define HWRM_RESP_LEN_MASK 0xffff0000 #define HWRM_RESP_LEN_MASK 0xffff0000
#define HWRM_RESP_LEN_SFT 16 #define HWRM_RESP_LEN_SFT 16
#define HWRM_RESP_VALID_MASK 0xff000000 #define HWRM_RESP_VALID_MASK 0xff000000
#define HWRM_SEQ_ID_INVALID -1
#define BNXT_HWRM_REQ_MAX_SIZE 128 #define BNXT_HWRM_REQ_MAX_SIZE 128
#define BNXT_HWRM_REQS_PER_PAGE (BNXT_PAGE_SIZE / \ #define BNXT_HWRM_REQS_PER_PAGE (BNXT_PAGE_SIZE / \
BNXT_HWRM_REQ_MAX_SIZE) BNXT_HWRM_REQ_MAX_SIZE)
...@@ -1466,7 +1465,7 @@ struct bnxt { ...@@ -1466,7 +1465,7 @@ struct bnxt {
#define BNXT_NEW_RM(bp) ((bp)->fw_cap & BNXT_FW_CAP_NEW_RM) #define BNXT_NEW_RM(bp) ((bp)->fw_cap & BNXT_FW_CAP_NEW_RM)
u32 hwrm_spec_code; u32 hwrm_spec_code;
u16 hwrm_cmd_seq; u16 hwrm_cmd_seq;
u32 hwrm_intr_seq_id; u16 hwrm_intr_seq_id;
void *hwrm_short_cmd_req_addr; void *hwrm_short_cmd_req_addr;
dma_addr_t hwrm_short_cmd_req_dma_addr; dma_addr_t hwrm_short_cmd_req_dma_addr;
void *hwrm_cmd_resp_addr; void *hwrm_cmd_resp_addr;
......
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