Linux CXL
 help / color / mirror / Atom feed
From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>
Cc: "Williams, Dan J" <dan.j.williams@intel.com>,
	"Schofield, Alison" <alison.schofield@intel.com>,
	"Jiang, Dave" <dave.jiang@intel.com>,
	"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>,
	"Weiny, Ira" <ira.weiny@intel.com>
Subject: Re: [PATCH ndctl 4/5] cxl: add an update-firmware command
Date: Mon, 24 Apr 2023 23:14:43 +0000	[thread overview]
Message-ID: <2d2ddb4d0af46a97b6d7b4ee854976a0ebfc2c61.camel@intel.com> (raw)
In-Reply-To: <20230405-vv-fw_update-v1-4-722a7a5baea3@intel.com>

On Fri, 2023-04-21 at 21:10 -0600, Vishal Verma wrote:
> Add a new cxl-update-firmware command to initiate a firmware update on a
> given memdev. This allows using a specified file to pass in as the
> firmware binary for one or more memdevs, allows for a blocking mode,
> where the command only exits after the update is complete for every
> specified memdev, and includes an option to cancel an in-progress
> update. Add the supporting libcxl APIs for the above functions as well.
> 
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
>  cxl/lib/private.h             |   5 ++
>  cxl/lib/libcxl.c              | 114 ++++++++++++++++++++++++++++++++++++++++++
>  cxl/builtin.h                 |   1 +
>  cxl/libcxl.h                  |   2 +
>  cxl/cxl.c                     |   1 +
>  cxl/memdev.c                  |  73 ++++++++++++++++++++++++++-
>  Documentation/cxl/meson.build |   1 +
>  cxl/lib/libcxl.sym            |   2 +
>  8 files changed, 198 insertions(+), 1 deletion(-)
> 
Looks like I forgot to 'git add Documentation/cxl/cxl-update-firmware.txt'.
I'll fix it for v2, but in the meanwhile here's what that looks like:


// SPDX-License-Identifier: GPL-2.0

cxl-update-firmware(1)
======================

NAME
----
cxl-update-firmware - update the firmware on a CXL memdev

SYNOPSIS
--------
[verse]
'cxl update-firmware <mem0> [<mem1>..<memN>] [<options>]'

DESCRIPTION
-----------

Update the firmware on one or more CXL mem devices. The mem devices
must support the set of firmware related mailbox commands.

This command doesn't directly issue the transfer / activate firmware
mailbox commands. Instead, the kernel's firmware loader facility is
used to provide the kernel with the data, and the kernel handles
performing the actual update while also managing time slicing the
transfer w.r.t. other background commands.

EXAMPLE
-------
----
# cxl update-firmware mem0 -F firmware.bin -w
[
  {
    "memdev":"mem0",
    "pmem_size":1073741824,
    "ram_size":1073741824,
    "serial":0,
    "numa_node":0,
    "host":"cxl_mem.0",
    "firmware":{
      "num_slots":3,
      "active_slot":2,
      "online_activate_capable":false,
      "slot_1_version":"cxl_test_fw_001",
      "slot_2_version":"cxl_test_fw_002",
      "slot_3_version":"cxl_test_new_fw",
      "fw_update_in_progress":false
    }
  }
]
firmware update completed on 1 mem device
----

OPTIONS
-------

include::bus-option.txt[]

-F::
--firmware-file::
	Firmware image file to use for the update.

-c::
--cancel::
	Attempt to abort an in-progress firmware update. This may
	fail depending on what stage the update process is in.

-w::
--wait::
	By default, the update-firmware command only initiates the
	firmware update, and returns, while the update operation
	happens asynchronously in the background. This option makes
	the firmware update command synchronous by waiting for it to
	complete before returning.

	If --wait is passed in without an accompanying firmware-file,
	it will initiate a wait on any current in-progress firmware
	updates, and then return.

include::verbose-option.txt[]

include::../copyright.txt[]

SEE ALSO
--------
linkcxl:cxl-list[1],

  reply	other threads:[~2023-04-24 23:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-22  3:09 [PATCH ndctl 0/5] cxl: firmware update support for libcxl and cxl-cli Vishal Verma
2023-04-22  3:09 ` [PATCH ndctl 1/5] cxl/memdev.c: allow filtering memdevs by bus Vishal Verma
2023-05-19 17:57   ` Dave Jiang
2023-04-22  3:10 ` [PATCH ndctl 2/5] cxl/list: print firmware info in memdev listings Vishal Verma
2023-05-19 18:21   ` Dave Jiang
2023-04-22  3:10 ` [PATCH ndctl 3/5] cxl/fw_loader: add APIs to get current state of the FW loader mechanism Vishal Verma
2023-05-19 18:49   ` Dave Jiang
2023-04-22  3:10 ` [PATCH ndctl 4/5] cxl: add an update-firmware command Vishal Verma
2023-04-24 23:14   ` Verma, Vishal L [this message]
2023-05-19 18:57   ` Dave Jiang
2023-04-22  3:10 ` [PATCH ndctl 5/5] test/cxl-update-firmware: add a unit test for firmware update Vishal Verma
2023-05-19 19:00   ` Dave Jiang

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=2d2ddb4d0af46a97b6d7b4ee854976a0ebfc2c61.camel@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    /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