mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: guzebing <guzebing1612@gmail.com>,
	dave@stgolabs.net, jic23@kernel.org, alison.schofield@intel.com,
	vishal.l.verma@intel.com, djbw@kernel.org, iweiny@kernel.org,
	ming.li@zohomail.com
Cc: linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cxl/memdev: Fix firmware upload exact-fit handling
Date: Tue, 14 Jul 2026 09:50:43 -0700	[thread overview]
Message-ID: <b41cdb78-e861-4d12-82f9-a647a194bf08@intel.com> (raw)
In-Reply-To: <20260713112744.2543829-1-guzebing1612@gmail.com>



On 7/13/26 4:27 AM, guzebing wrote:
> From: Guzebing <Guzebing1612@gmail.com>
> 
> cxl_fw_prepare() classifies a firmware image as a one-shot transfer
> only when its Transfer FW input payload is smaller than the mailbox
> payload size. An image that exactly fills the payload is therefore
> treated as a multi-part transfer.
> 
> The firmware loader invokes cxl_fw_write() only once for that image.
> Since both offset == 0 and remaining == 0, the multi-part action
> selection sends INITIATE, never sends END, and then attempts to activate
> the target slot.
> 
> Include equality in the one-shot classification so exact-fit images use
> the FULL action.
> 
> Fixes: 9521875bbe00 ("cxl: add a firmware update mechanism using the sysfs firmware loader")
> Signed-off-by: Guzebing <Guzebing1612@gmail.com>

Applied to cxl/next
af5035e1b3e4

> ---
>  drivers/cxl/core/memdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/core/memdev.c b/drivers/cxl/core/memdev.c
> index 33a3d2e7b13af..45e7d2be17e09 100644
> --- a/drivers/cxl/core/memdev.c
> +++ b/drivers/cxl/core/memdev.c
> @@ -921,7 +921,7 @@ static enum fw_upload_err cxl_fw_prepare(struct fw_upload *fwl, const u8 *data,
>  	if (!size)
>  		return FW_UPLOAD_ERR_INVALID_SIZE;
>  
> -	mds->fw.oneshot = struct_size(transfer, data, size) <
> +	mds->fw.oneshot = struct_size(transfer, data, size) <=
>  			    cxl_mbox->payload_size;
>  
>  	if (cxl_mem_get_fw_info(mds))


      parent reply	other threads:[~2026-07-14 16:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13 11:27 guzebing
2026-07-13 17:32 ` Dave Jiang
2026-07-14 16:50 ` Dave Jiang [this message]

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=b41cdb78-e861-4d12-82f9-a647a194bf08@intel.com \
    --to=dave.jiang@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=dave@stgolabs.net \
    --cc=djbw@kernel.org \
    --cc=guzebing1612@gmail.com \
    --cc=iweiny@kernel.org \
    --cc=jic23@kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.li@zohomail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome