From: Li Ming <ming.li@zohomail.com>
To: Alison Schofield <alison.schofield@intel.com>, dave@stgolabs.net
Cc: jic23@kernel.org, dave.jiang@intel.com, vishal.l.verma@intel.com,
djbw@kernel.org, iweiny@kernel.org, icheng@nvidia.com,
linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] cxl/mbox: Use mapped errno to determine command status
Date: Thu, 5 Nov 2026 14:02:37 +0800 [thread overview]
Message-ID: <8a49b7c8-3be3-4c46-a5ee-6cdaefecea14@zohomail.com> (raw)
In-Reply-To: <auwI9iLC0NCRvp9R@aschofie-mobl2.lan>
在 2026/11/5 12:41, Alison Schofield 写道:
> On Tue, Nov 03, 2026 at 10:43:05AM +0800, Li Ming wrote:
>> cxl_mbox_cmd_rctable already maps all mailbox command return codes to
>> errno values. Use the returned errno directly instead of checking
>> mailbox return codes separately to determine whether a command succeeded
>> or failed.
>>
>> Signed-off-by: Li Ming <ming.li@zohomail.com>
>> ---
>> v2:
>> - New patch.
>> ---
>> drivers/cxl/core/mbox.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
>> index 55828a836c01..bd91b03c4d21 100644
>> --- a/drivers/cxl/core/mbox.c
>> +++ b/drivers/cxl/core/mbox.c
>> @@ -270,9 +270,9 @@ int cxl_internal_send_cmd(struct cxl_mailbox *cxl_mbox,
>> if (rc)
>> return rc;
>>
>> - if (mbox_cmd->return_code != CXL_MBOX_CMD_RC_SUCCESS &&
>> - mbox_cmd->return_code != CXL_MBOX_CMD_RC_BACKGROUND)
>> - return cxl_mbox_cmd_rc2errno(mbox_cmd);
>> + rc = cxl_mbox_cmd_rc2errno(mbox_cmd);
>> + if (rc)
>> + return rc;
> Hi Ming,
>
> The existing code really seemed to want BACKGROUND as a special case, so
> I searched the history on this one, Davidlohr and you discussed this in
> 2023 around sanitize[1] .
>
> I do think it is confusing and if we can just follow the table codes,
> that would be easier.
Hi Alison,
Thanks for your review.
I checked the link you shared, it is about the return code of a
BACKGROUND cmd handling inside __cxl_pci_mbox_send_cmd(), because
__cxl_pci_mbox_send_cmd() needs to handle both non-BACKGROUND and
BACKGROUND cmds and returns the result. but in cxl_internal_send_cmd(),
I think we can consider the cmd done whether it is a BACKGROUND command
or not.
>
> I'll let Davidlohr dig in on this one.
Thanks.
>
> I read both these patches as cleanups but no bug to be fixed.
Sure, will drop the fixes tag.
Ming
>
>
> [1] https://lore.kernel.org/linux-cxl/mw5bsc5u72fdrgo7qovj6u2npg2asftzp3jeprwtmnvbvg7vet@fayzcxpurjl6/
>
> -- Alison
>
>
>
>
>
>>
>> if (!out_size)
>> return 0;
>> --
>> 2.43.0
>>
prev parent reply other threads:[~2026-11-05 6:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 2:43 [PATCH v2 1/2] cxl/mbox: Return success for CXL_MBOX_CMD_RC_BACKGROUND Li Ming
2026-11-03 2:43 ` [PATCH v2 2/2] cxl/mbox: Use mapped errno to determine command status Li Ming
2026-11-05 4:41 ` Alison Schofield
2026-11-05 6:02 ` Li Ming [this message]
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=8a49b7c8-3be3-4c46-a5ee-6cdaefecea14@zohomail.com \
--to=ming.li@zohomail.com \
--cc=alison.schofield@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=djbw@kernel.org \
--cc=icheng@nvidia.com \
--cc=iweiny@kernel.org \
--cc=jic23@kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®