@@ -4176,14 +4176,12 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
4176
4176
int i , intr_process , rc , tmo_count ;
4177
4177
struct input * req = msg ;
4178
4178
u32 * data = msg ;
4179
- __le32 * resp_len ;
4180
4179
u8 * valid ;
4181
4180
u16 cp_ring_id , len = 0 ;
4182
4181
struct hwrm_err_output * resp = bp -> hwrm_cmd_resp_addr ;
4183
4182
u16 max_req_len = BNXT_HWRM_MAX_REQ_LEN ;
4184
4183
struct hwrm_short_input short_input = {0 };
4185
4184
u32 doorbell_offset = BNXT_GRCPF_REG_CHIMP_COMM_TRIGGER ;
4186
- u8 * resp_addr = (u8 * )bp -> hwrm_cmd_resp_addr ;
4187
4185
u32 bar_offset = BNXT_GRCPF_REG_CHIMP_COMM ;
4188
4186
u16 dst = BNXT_HWRM_CHNL_CHIMP ;
4189
4187
@@ -4201,7 +4199,6 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
4201
4199
bar_offset = BNXT_GRCPF_REG_KONG_COMM ;
4202
4200
doorbell_offset = BNXT_GRCPF_REG_KONG_COMM_TRIGGER ;
4203
4201
resp = bp -> hwrm_cmd_kong_resp_addr ;
4204
- resp_addr = (u8 * )bp -> hwrm_cmd_kong_resp_addr ;
4205
4202
}
4206
4203
4207
4204
memset (resp , 0 , PAGE_SIZE );
@@ -4270,7 +4267,6 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
4270
4267
tmo_count = HWRM_SHORT_TIMEOUT_COUNTER ;
4271
4268
timeout = timeout - HWRM_SHORT_MIN_TIMEOUT * HWRM_SHORT_TIMEOUT_COUNTER ;
4272
4269
tmo_count += DIV_ROUND_UP (timeout , HWRM_MIN_TIMEOUT );
4273
- resp_len = (__le32 * )(resp_addr + HWRM_RESP_LEN_OFFSET );
4274
4270
4275
4271
if (intr_process ) {
4276
4272
u16 seq_id = bp -> hwrm_intr_seq_id ;
@@ -4298,9 +4294,8 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
4298
4294
le16_to_cpu (req -> req_type ));
4299
4295
return - EBUSY ;
4300
4296
}
4301
- len = (le32_to_cpu (* resp_len ) & HWRM_RESP_LEN_MASK ) >>
4302
- HWRM_RESP_LEN_SFT ;
4303
- valid = resp_addr + len - 1 ;
4297
+ len = le16_to_cpu (resp -> resp_len );
4298
+ valid = ((u8 * )resp ) + len - 1 ;
4304
4299
} else {
4305
4300
int j ;
4306
4301
@@ -4311,8 +4306,7 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
4311
4306
*/
4312
4307
if (test_bit (BNXT_STATE_FW_FATAL_COND , & bp -> state ))
4313
4308
return - EBUSY ;
4314
- len = (le32_to_cpu (* resp_len ) & HWRM_RESP_LEN_MASK ) >>
4315
- HWRM_RESP_LEN_SFT ;
4309
+ len = le16_to_cpu (resp -> resp_len );
4316
4310
if (len )
4317
4311
break ;
4318
4312
/* on first few passes, just barely sleep */
@@ -4334,7 +4328,7 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
4334
4328
}
4335
4329
4336
4330
/* Last byte of resp contains valid bit */
4337
- valid = resp_addr + len - 1 ;
4331
+ valid = (( u8 * ) resp ) + len - 1 ;
4338
4332
for (j = 0 ; j < HWRM_VALID_BIT_DELAY_USEC ; j ++ ) {
4339
4333
/* make sure we read from updated DMA memory */
4340
4334
dma_rmb ();
@@ -9310,7 +9304,7 @@ static void __bnxt_close_nic(struct bnxt *bp, bool irq_re_init,
9310
9304
bnxt_free_skbs (bp );
9311
9305
9312
9306
/* Save ring stats before shutdown */
9313
- if (bp -> bnapi )
9307
+ if (bp -> bnapi && irq_re_init )
9314
9308
bnxt_get_ring_stats (bp , & bp -> net_stats_prev );
9315
9309
if (irq_re_init ) {
9316
9310
bnxt_free_irq (bp );
0 commit comments