From d1855ecfb064907a05286efcb22054b9dc94a1d6 Mon Sep 17 00:00:00 2001
From: Jonathan Bell <jonathan@raspberrypi.com>
Date: Fri, 29 May 2026 14:20:27 +0100
Subject: [PATCH] nvme: pci: use LE accessors for HMB segment table entries on
 arm64

Align with the non-arm64 code, as it's technically possible to run the
cpu in BE mode.

Fixes: d30fd123fee1 ("nvme-pci: manually allocate Host Memory Buffer segments on arm64")
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
---
 drivers/nvme/host/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2433,9 +2433,9 @@ static int nvme_alloc_host_mem_multi(str
 	i = dev->nr_host_mem_descs = mapped_nents;
 
 	while (--i >= 0) {
-		descs[i].addr = sg_dma_address(&slist[i]);
+		descs[i].addr = cpu_to_le64(sg_dma_address(&slist[i]));
 		WARN_ON_ONCE(sg_dma_len(&slist[i]) & (NVME_CTRL_PAGE_SIZE - 1));
-		descs[i].size = sg_dma_len(&slist[i]) / NVME_CTRL_PAGE_SIZE;
+		descs[i].size = cpu_to_le32(sg_dma_len(&slist[i]) / NVME_CTRL_PAGE_SIZE);
 	}
 
 	dev->host_mem_size = size;
