mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 15:22:21 -04:00
cxl/memdev: Fix firmware upload exact-fit handling
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: 9521875bbe ("cxl: add a firmware update mechanism using the sysfs firmware loader")
Signed-off-by: Guzebing <Guzebing1612@gmail.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20260713112744.2543829-1-guzebing1612@gmail.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user