RE: [bug report] RDMA/bnxt_re: handle command completions after driver detect a timedout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> The comments in bnxt_qplib_map_rc() talk about "firmware halt is
detected"
> and "this function will be called when FW already reports a timeout.
> This would be possible only when FW crashes and resets."  The
> __send_message_basic_sanity() function returns -ENXIO in the case of
> ERR_DEVICE_DETACHED and it returns -ETIMEDOUT in the case of
> FIRMWARE_STALL_DETECTED.
>
> Based on the comments, I would have expected this test to be:
>
> 	if (rc)
> 		return rc == -ETIMEDOUT ? bnxt_qplib_map_rc(opcode) : rc;
>
> Presumably the code is correct, but the comments are confusing.

I agree. This comment is not clear. I will address the comment change of "
bnxt_qplib_map_rc"
Logic of the code is correct. Also  I will make minor cleanup so that code
is bit readable (will not do major refactor since I want to address bug
fix).

>
>     492
>     493         rc = __send_message(rcfw, msg);
>     494         if (rc)
>     495                 return rc;
>     496
>     497         cookie = le16_to_cpu(__get_cmdq_base_cookie(msg->req,
msg-
> >req_sz))
>     498                                 & RCFW_MAX_COOKIE_VALUE;
>     499
>     500         if (msg->block)
>     501                 rc = __block_for_resp(rcfw, cookie);
>     502         else if (atomic_read(&rcfw->rcfw_intr_enabled))
>     503                 rc = __wait_for_resp(rcfw, cookie);
>     504         else
>     505                 rc = __poll_for_resp(rcfw, cookie);
>     506         if (rc) {
>                 ^^^^^^^^^
> rc is checked here.

This is not required. Below check is correct. As part of rebase, by
mistake this piece of code added. I will address this.
>
>     507                 /* timed out */
>     508                 dev_err(&rcfw->pdev->dev, "cmdq[%#x]=%#x
timedout
> (%d)msec\n",
>     509                         cookie, opcode, RCFW_CMD_WAIT_TIME_MS);
>     510                 return rc;
>     511         }
>     512
> --> 513         if (rc) {
>                 ^^^^^^^^^
> The patch adds some dead code.

This is required.

Kashyap

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux