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 2/4] cxl: Add default timeout for bg mailbox commands
Date: Thu, 17 Oct 2024 16:32:15 +0100 [thread overview]
Message-ID: <20241017163215.00000547@Huawei.com> (raw)
In-Reply-To: <913b851a25344bb1832ddc902eb0aa5f@micron.com>
On Wed, 16 Oct 2024 04:59:58 +0000
Ravis OpenSrc <Ravis.OpenSrc@micron.com> wrote:
> Allows 5s wait when no timeout parameter is explicitly mentioned.
>
> It is useful for mailbox commands to be executed in background
> when initiated from userspace.
>
> Link:
> https://lore.kernel.org/linux-mm/20240215123410.00003b8c@Huawei.com/T/
>
> Signed-off-by: Ajay Joshi <ajay.opensrc@micron.com>
> Signed-off-by: Ravi Shankar <ravis.opensrc@micron.com>
Other than patch formatting, this seems reasonable to me.
Jonathan
> ---
> drivers/cxl/pci.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
> index 188412d45e0d..d5d6142f6aa3 100644
> --- a/drivers/cxl/pci.c
> +++ b/drivers/cxl/pci.c
> @@ -41,6 +41,10 @@
> /* CXL 2.0 - 8.2.8.4 */
> #define CXL_MAILBOX_TIMEOUT_MS (2 * HZ)
>
> +/* Default timeout for background operations */
> +#define CXL_BG_POLL_CNT 5
> +#define CXL_BG_POLL_INTERVAL_MS 1000
> +
> /*
> * CXL 2.0 ECN "Add Mailbox Ready Time" defines a capability field to
> * dictate how long to wait for the mailbox to become ready. The new
> @@ -317,6 +321,15 @@ static int __cxl_pci_mbox_send_cmd(struct cxl_mailbox *cxl_mbox,
> dev_dbg(dev, "Mailbox background operation (0x%04x) started\n",
> mbox_cmd->opcode);
>
> + /*
> + * Add a default timeout of 5 seconds when background operation
> + * starts but no timeout is specified.
> + */
> + if (!mbox_cmd->poll_interval_ms) {
> + mbox_cmd->poll_interval_ms = CXL_BG_POLL_INTERVAL_MS;
> + mbox_cmd->poll_count = CXL_BG_POLL_CNT;
> + }
> +
> timeout = mbox_cmd->poll_interval_ms;
> for (i = 0; i < mbox_cmd->poll_count; i++) {
> if (rcuwait_wait_event_timeout(&cxl_mbox->mbox_wait,
next prev parent reply other threads:[~2024-10-17 15:32 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-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 [this message]
2024-10-17 17:25 ` [EXT] " Srinivasulu 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
[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=20241017163215.00000547@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.