All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Davidlohr Bueso <dave@stgolabs.net>, Unsung Lee <unsung0317@gmail.com>
Cc: linux-cxl@vger.kernel.org, Jonathan Cameron <jic23@kernel.org>,
	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: Re: [RFC PATCH 3/4] cxl/memdev: Add firmware_activate to activate firmware without a reset
Date: Tue, 1 Dec 2026 16:20:46 -0700	[thread overview]
Message-ID: <59a544bf-3897-40c5-bf41-90d9e9806aa2@intel.com> (raw)
In-Reply-To: <20261127200544.nzz2kbxcwuns5zv6@offworld>



On 11/27/26 1:05 PM, Davidlohr Bueso wrote:
> On Wed, 25 Nov 2026, Unsung Lee wrote:
> 
>> +What:        /sys/bus/cxl/devices/memX/firmware_activate
>> +Date:        November, 2026
>> +KernelVersion:    v7.6
>> +Contact:    linux-cxl@vger.kernel.org
>> +Description:
>> +        (WO) Write a firmware slot number to activate the firmware in
>> +        that slot now, without a reset ("online" activation in the
>> +        Activate FW command). Firmware uploaded through
>> +        /sys/class/firmware/memX/ is set up for activation on the next
>> +        cold reset; this attribute lets userspace switch to it earlier.
>> +        Like sanitize, this requires the device to be disabled, that
>> +        is, not actively decoding any HPA ranges, so the caller has to
>> +        take its memory offline and destroy its regions first. The
>> +        write fails with EOPNOTSUPP if the device does not support
>> +        online activation, EINVAL for an invalid or already active
>> +        slot, and EBUSY if the device is decoding memory, a firmware
>> +        upload or a sanitize is in progress, or a different slot is set
>> +        up for activation on the next cold reset. Only the decoders of
>> +        this host are checked. If the device fails the command, the
>> +        write fails with the error of the mailbox command: ENXIO for
>> +        most device errors, including a device still busy with an
>> +        earlier activation, or ETIMEDOUT if the command does not
>> +        complete in time. While the device activates, committing a
>> +        region on it fails with EBUSY. If the command times out, the
>> +        device may still be activating. Until a later write finds the
>> +        slot running or an activation succeeds, committing a region
>> +        still fails with EBUSY, a firmware upload fails with the error
>> +        device-busy, and sanitize and secure erase fail with EBUSY. If
>> +        the device ends up keeping its old firmware, this lasts until
>> +        cxl_pci is bound again; firmware can be uploaded again after
>> +        that. If the device still reports another slot set up for
>> +        activation on the next cold reset after the online activation,
>> +        a warning is logged. The firmware_version attribute is read
>> +        once at probe and is not updated by an online activation; the
>> +        version of each slot is available from the Get FW Info command.
>> +        If this file is not present, the device does not support
>> +        firmware update.
> 
> EWAYTOOLONG ... please less specific details about return codes and comparisons
> with with other ABI files.

Agreed. And it reads AI generated. In general for commit logs, comments, and documentation, AI tends to be way too wordy on the verbiage. Please rewrite it so it's easily readable for a human and gets to the point. Providing a possible example below. I used an agent to rework it. Feel free to modify further with what Davidlohr asked.

What:           /sys/bus/cxl/devices/memX/firmware_activate
Date:           November, 2026
KernelVersion:  v7.6
Contact:        linux-cxl@vger.kernel.org
Description:
                (WO) Write a slot number to activate its firmware now, with
                no reset (online Activate FW). Otherwise firmware uploaded
                through /sys/class/firmware/memX/ activates on the next cold
                reset. Absent if the device does not support firmware update.

                Offline the device's memory and destroy its regions first.
                Only this host's decoders are checked.

                EOPNOTSUPP: no online activation support.
                EINVAL:     invalid or already active slot.
                EBUSY:      device decoding memory, upload or sanitize in
                            progress, or another slot pending for cold reset.
                ENXIO:      most device errors, including an earlier
                            activation still running.
                ETIMEDOUT:  command timed out.

                Region commit fails with EBUSY during activation. After
                ETIMEDOUT, region commit, sanitize and secure erase (EBUSY)
                and firmware upload (device-busy) stay blocked until a later
                write finds the slot running or an activation succeeds. If
                the old firmware stays, rebind cxl_pci to clear this.

                A warning is logged if another slot is still pending for cold
                reset afterward. firmware_version is not updated; read slot
                versions with Get FW Info.
> 
> Thanks,
> Davidlohr


  reply	other threads:[~2026-12-01 23:20 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 ` [RFC PATCH 1/4] cxl/memdev: Poll for completion of Activate FW Unsung Lee
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 [this message]
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=59a544bf-3897-40c5-bf41-90d9e9806aa2@intel.com \
    --to=dave.jiang@intel.com \
    --cc=alison.schofield@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=unsung0317@gmail.com \
    --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.