public inbox for linux-cxl@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Ravis OpenSrc <Ravis.OpenSrc@micron.com>
Cc: "linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"dave.jiang@intel.com" <dave.jiang@intel.com>,
	Srinivasulu Opensrc <sthanneeru.opensrc@micron.com>,
	"john@jagalactic.com" <john@jagalactic.com>,
	Ajay Joshi <ajayjoshi@micron.com>
Subject: Re: [RFC PATCH v2 1/4] cxl: Enable mailbox ops with background only if request abort operation is supported.
Date: Thu, 17 Oct 2024 16:27:31 +0100	[thread overview]
Message-ID: <20241017162731.000034bf@Huawei.com> (raw)
In-Reply-To: <6e6cc093f70442e792c05e779393442a@micron.com>

On Wed, 16 Oct 2024 04:59:56 +0000
Ravis OpenSrc <Ravis.OpenSrc@micron.com> wrote:
Hi Ravi,

Change the author in git with
git commit --amend --author=Ravi Shankar <ravis.opensrc@micron.com>

Then when you do git format-email or similar ti
will add an explicit
From: Ravi Shankar <ravis.opensrc@micron.com>
To the top of the patch description that git will then pick up
as the author.

> Enabling mailbox commands only if background operation and
> request abort cancellation are both supported.

Key here is the userspace access point.  We let the kernel
use these commands if it wants to as it can pick up the
pieces.

> 
> This check is to allow user space commands to initiate
> background commands responsibly while complying with any
> default background timeout implemented in kernel.
> 
> Link:
> https://lore.kernel.org/linux-cxl/66035c2e8ba17_770232948b@dwillia2-xfh.jf.intel.com.notmuch/
This is a tag just like the ones below.
So all on one line and no blank lines before the tag block.
> 
> Suggested-by: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Ajay Joshi <ajay.opensrc@micron.com>

What was Ajay's role in this?
Maybe a Co-developed tag is appropriate?

> Signed-off-by: Ravi Shankar <ravis.opensrc@micron.com>
> ---
>  drivers/cxl/core/mbox.c | 12 ++++++++++--
>  drivers/cxl/cxlmem.h    | 16 ++++++++++++++++
>  2 files changed, 26 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
> index 5175138c4fb7..8c0144913b9e 100644
> --- a/drivers/cxl/core/mbox.c
> +++ b/drivers/cxl/core/mbox.c
> @@ -733,12 +733,20 @@ static void cxl_walk_cel(struct cxl_memdev_state *mds, size_t size, u8 *cel)
>  
>          for (i = 0; i < cel_entries; i++) {
>                  u16 opcode = le16_to_cpu(cel_entry[i].opcode);
> +               u16 effect = le16_to_cpu(cel_entry[i].effect);
Your email client has I think mangled this to use spaces instead of tabs.

Given the fun that is corporate email systems, maybe take a look at
using b4 and the webproxy that allows patches to be sent to the mailing
list without involving any company email servers :)

>                  struct cxl_mem_command *cmd = cxl_mem_find_command(opcode);
>                  int enabled = 0;
>  
>                  if (cmd) {
> -                       set_bit(cmd->info.id, mds->enabled_cmds);
> -                       enabled++;
> +                       /*
> +                        * For background operation commands, enable only if
> +                        * Request abort background operation is supported.
> +                        */
> +                       if (!(effect & CXL_CEL_FLAG_BACKGROUND_OPERATION) ||
> +                          (effect & CXL_CEL_FLAG_REQ_ABORT_BACKGROUND_SUPPORTED)) {
> +                               set_bit(cmd->info.id, mds->enabled_cmds);
> +                               enabled++;
> +                       }
>                  }
>  
>                  if (cxl_is_poison_command(opcode)) {
> diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h
> index 2a25d1957ddb..d8c0894797ac 100644
> --- a/drivers/cxl/cxlmem.h
> +++ b/drivers/cxl/cxlmem.h
> @@ -579,6 +579,22 @@ struct cxl_cel_entry {
>          __le16 effect;
>  } __packed;
>  
> +/*
> + * CEL Entry Effects
> + * CXL rev 3.1 Section 8.2.9.5.2.1; Table 8-75
> + */
> +#define        CXL_CEL_FLAG_CFG_CHANGE_AFTER_RESET BIT(0)

AFTER_COLD_RESET (subtle but we should include the COLD)

> +#define        CXL_CEL_FLAG_CFG_CHANGE_IMMEDIATE BIT(1)
> +#define        CXL_CEL_FLAG_DATA_CHANGE_IMMEDIATE BIT(2)
> +#define        CXL_CEL_FLAG_POLICY_CHANGE_IMMEDIATE BIT(3)
> +#define        CXL_CEL_FLAG_LOG_CHANGE_IMMEDIATE BIT(4)
> +#define        CXL_CEL_FLAG_SECURITY_CHANGE BIT(5)
> +#define        CXL_CEL_FLAG_BACKGROUND_OPERATION BIT(6)
> +#define        CXL_CEL_FLAG_SECONDARY_MAILBOX_SUPPORTED BIT(7)
> +#define        CXL_CEL_FLAG_REQ_ABORT_BACKGROUND_SUPPORTED BIT(8)
Should define the fun of bit 9 which is kind of a cheeky version
bit hiding in here that says if we should pay attention to next tow
or have no idea.

> +#define        CXL_CEL_FLAG_CFG_CHANGE_AFTER_CONV_RESET BIT(10)
> +#define        CXL_CEL_FLAG_CFG_CHANGE_AFTER_CXL_RESET BIT(11)
> +
>  struct cxl_mbox_get_log {
>          uuid_t uuid;
>          __le32 offset;


  reply	other threads:[~2024-10-17 15:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20241015205633.127333-1-ravis.opensrc@micron.com>
2024-10-16  4:31 ` [RFC 0/4] cxl: Support for mailbox background abort operation Ravis OpenSrc
     [not found] ` <20241015205633.127333-5-ravis.opensrc@micron.com>
2024-10-16  4:32   ` [RFC PATCH 4/4] cxl/mbox: Add Populate Log support Ravis OpenSrc
2024-10-16  5:00     ` [RFC PATCH v2 " Ravis OpenSrc
2024-10-17 15:37       ` Jonathan Cameron
2024-10-16  4:59 ` [RFC v2 0/4] cxl: Support for mailbox background abort operation Ravis OpenSrc
     [not found] ` <20241015205633.127333-2-ravis.opensrc@micron.com>
2024-10-16  4:31   ` [RFC PATCH 1/4] cxl: Enable mailbox ops with background only if request abort operation is supported Ravis OpenSrc
2024-10-16  4:59   ` [RFC PATCH v2 " Ravis OpenSrc
2024-10-17 15:27     ` Jonathan Cameron [this message]
     [not found] ` <20241015205633.127333-3-ravis.opensrc@micron.com>
2024-10-16  4:32   ` [RFC PATCH 2/4] cxl: Add default timeout for bg mailbox commands Ravis OpenSrc
2024-10-16  4:59   ` [RFC PATCH v2 " Ravis OpenSrc
2024-10-17 15:32     ` Jonathan Cameron
2024-10-17 17:25       ` [EXT] " Srinivasulu Opensrc
     [not found] ` <20241015205633.127333-4-ravis.opensrc@micron.com>
2024-10-16  4:32   ` [RFC PATCH 3/4] cxl: Abort background operation in case of timeout Ravis OpenSrc
2024-10-16  5:00   ` [RFC PATCH v2 " Ravis OpenSrc
2024-10-17 15:36     ` Jonathan Cameron
2024-10-18  6:39       ` Ravis OpenSrc
2024-10-18 16:14         ` Jonathan Cameron

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=20241017162731.000034bf@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=Ravis.OpenSrc@micron.com \
    --cc=ajayjoshi@micron.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=john@jagalactic.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=sthanneeru.opensrc@micron.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