From: Adam Manzanares <a.manzanares@samsung.com>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: "linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
"ben.widawsky@intel.com" <ben.widawsky@intel.com>,
"ira.weiny@intel.com" <ira.weiny@intel.com>,
"vishal.l.verma@intel.com" <vishal.l.verma@intel.com>,
"alison.schofield@intel.com" <alison.schofield@intel.com>
Subject: Re: [PATCH 5/5] cxl/mbox: Retry sending mbox command upon RETRY return_code
Date: Tue, 22 Mar 2022 21:10:12 +0000 [thread overview]
Message-ID: <20220322211012.GD198593@bgt-140510-bm01> (raw)
In-Reply-To: <20220317234049.69323-6-dave@stgolabs.net>
On Thu, Mar 17, 2022 at 04:40:49PM -0700, Davidlohr Bueso wrote:
> As mentioned in CXL 2.0 specs: the hardware can set a Retry
> Required if the the command was not completed due to a
> temporary error. An optional single retry may resolve the
> issue. This is the only retry case as in general they are
> not recommended for commands that return an error.
>
> Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
> ---
> drivers/cxl/core/mbox.c | 23 ++++++++++++++---------
> 1 file changed, 14 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
> index fa9e7043f158..567987052b68 100644
> --- a/drivers/cxl/core/mbox.c
> +++ b/drivers/cxl/core/mbox.c
> @@ -160,20 +160,25 @@ int cxl_mbox_send_cmd(struct cxl_dev_state *cxlds, u16 opcode, void *in,
Can you update the documentation cxl_mbox_send_cmd that the function now
retries commands if the RC indicates it should be done?
> .size_out = out_size,
> .payload_out = out,
> };
> - int rc;
> + int rc, retry = 1;
>
> if (out_size > cxlds->payload_size)
> return -E2BIG;
>
> - /* acquire and releases the mbox_mutex */
> - rc = cxlds->mbox_send(cxlds, &mbox_cmd);
> - if (rc)
> - return rc;
> + do {
> + /* acquire and releases the mbox_mutex */
> + rc = cxlds->mbox_send(cxlds, &mbox_cmd);
> + if (rc)
> + return rc;
>
> - if (mbox_cmd.return_code != CXL_MBOX_CMD_RC_SUCCESS) {
> - int err = cxl_mbox_cmd_rc2errno(&mbox_cmd);
> - return -err;
> - }
> + if (mbox_cmd.return_code == CXL_MBOX_CMD_RC_SUCCESS)
> + break;
> +
> + if (mbox_cmd.return_code != CXL_MBOX_CMD_RC_RETRY || !retry) {
> + int err = cxl_mbox_cmd_rc2errno(&mbox_cmd);
> + return -err;
> + }
> + } while (retry--);
>
> /*
> * Variable sized commands can't be validated and so it's up to the
>
> --
> 2.26.2
>
Other than the doc change for the cxl_mbox_send_cmd function.
LGTM
Reviewed by: Adam Manzanares <a.manzanares@samsung.com>
next prev parent reply other threads:[~2022-03-22 21:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-17 23:40 [PATCH 0/5] cxl/mbox: Robustify handling of mbox_cmd.return_code Davidlohr Bueso
2022-03-17 23:40 ` [PATCH 1/5] cxl/mbox: Move mbox_mutex usage comment Davidlohr Bueso
2022-03-22 19:28 ` Adam Manzanares
2022-03-29 22:40 ` Dan Williams
2022-03-17 23:40 ` [PATCH 2/5] cxl/pci: Use CXL_MBOX_SUCCESS to check against mbox_cmd return code Davidlohr Bueso
2022-03-22 20:30 ` Adam Manzanares
2022-03-29 23:42 ` Dan Williams
2022-03-30 0:21 ` Dan Williams
2022-03-17 23:40 ` [PATCH 3/5] cxl/mbox: Improve handling of mbox_cmd return codes Davidlohr Bueso
2022-03-22 20:56 ` Adam Manzanares
2022-03-22 21:50 ` Davidlohr Bueso
2022-03-30 0:18 ` Dan Williams
2022-03-17 23:40 ` [PATCH 4/5] cxl/mbox: Use new return_code handling Davidlohr Bueso
2022-03-22 21:01 ` Adam Manzanares
2022-03-30 0:24 ` Dan Williams
2022-03-17 23:40 ` [PATCH 5/5] cxl/mbox: Retry sending mbox command upon RETRY return_code Davidlohr Bueso
2022-03-22 21:10 ` Adam Manzanares [this message]
2022-03-30 0:42 ` Dan Williams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220322211012.GD198593@bgt-140510-bm01 \
--to=a.manzanares@samsung.com \
--cc=alison.schofield@intel.com \
--cc=ben.widawsky@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox