All of lore.kernel.org
 help / color / mirror / Atom feed
From: Unsung Lee <unsung0317@gmail.com>
To: linux-cxl@vger.kernel.org
Cc: Davidlohr Bueso <dave@stgolabs.net>,
	Jonathan Cameron <jic23@kernel.org>,
	Dave Jiang <dave.jiang@intel.com>,
	Alison Schofield <alison.schofield@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Ira Weiny <iweiny@kernel.org>, Dan Williams <djbw@kernel.org>,
	John Groves <jgroves@micron.com>
Subject: [RFC PATCH 1/4] cxl/memdev: Poll for completion of Activate FW
Date: Wed, 25 Nov 2026 21:43:55 +0900	[thread overview]
Message-ID: <20261125124358.3583223-2-unsung0317@gmail.com> (raw)
In-Reply-To: <20261125124358.3583223-1-unsung0317@gmail.com>

cxl_mem_activate_fw() sends Activate FW without poll_interval_ms and
poll_count. If the device answers "background command started", the
mailbox code skips its wait loop and fails at once with -ETIMEDOUT
("timeout waiting for background (0 ms)"), so the firmware upload is
reported as a hardware error while the device may still be activating.

Give the command the same 1 s x 30 budget as Transfer FW.

Signed-off-by: Unsung Lee <unsung0317@gmail.com>
---
 drivers/cxl/core/memdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/cxl/core/memdev.c b/drivers/cxl/core/memdev.c
index 787988e929..67f467c267 100644
--- a/drivers/cxl/core/memdev.c
+++ b/drivers/cxl/core/memdev.c
@@ -949,10 +949,18 @@ static int cxl_mem_activate_fw(struct cxl_memdev_state *mds, int slot)
 	if (slot == 0 || slot > mds->fw.num_slots)
 		return -EINVAL;
 
+	/*
+	 * Activate FW may complete as a background operation. Without a
+	 * poll budget the mailbox gives up at once and reports a timeout
+	 * even though the device is still activating. Use the same budget
+	 * as Transfer FW.
+	 */
 	mbox_cmd = (struct cxl_mbox_cmd) {
 		.opcode = CXL_MBOX_OP_ACTIVATE_FW,
 		.size_in = sizeof(activate),
 		.payload_in = &activate,
+		.poll_interval_ms = 1000,
+		.poll_count = 30,
 	};
 
 	/* Only offline activation supported for now */
-- 
2.34.1


  reply	other threads:[~2026-11-25 12:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 12:43 [RFC PATCH 0/4] cxl/memdev: Activate firmware without a reset Unsung Lee
2026-11-25 12:43 ` Unsung Lee [this message]
2026-11-25 12:43 ` [RFC PATCH 2/4] cxl/memdev: Keep pending slot and activation capabilities from Get FW Info Unsung Lee
2026-11-25 12:43 ` [RFC PATCH 3/4] cxl/memdev: Add firmware_activate to activate firmware without a reset Unsung Lee
2026-11-25 12:57   ` sashiko-bot
2026-11-27 20:05   ` Davidlohr Bueso
2026-12-01 23:20     ` Dave Jiang
2026-11-25 12:43 ` [RFC PATCH 4/4] tools/testing/cxl: Add a knob to advertise online FW activation Unsung Lee
2026-11-25 12:53 ` [RFC PATCH 0/4] cxl/memdev: Activate firmware without a reset Unsung Lee
2026-11-27 19:51 ` Davidlohr Bueso
2026-11-28  6:23   ` us l
2026-12-01 19:07     ` Davidlohr Bueso

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=20261125124358.3583223-2-unsung0317@gmail.com \
    --to=unsung0317@gmail.com \
    --cc=alison.schofield@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=djbw@kernel.org \
    --cc=iweiny@kernel.org \
    --cc=jgroves@micron.com \
    --cc=jic23@kernel.org \
    --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 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.