summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-10 22:04:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-10 22:06:13 +0000
commitd3c9538e832cbb11de3562dff384f31b05254776 (patch)
tree94e74f7bdf03e89603a995045ee6897764137be2
parentApplying patch from Chris Lamb <lamby@debian.org> to make build reproducible ... (diff)
downloadlibnvme-d3c9538e832cbb11de3562dff384f31b05254776.tar.xz
libnvme-d3c9538e832cbb11de3562dff384f31b05254776.zip
Adding patch from upstream to fix FTBFS on big endian, thanks to Benjamin Drung <bdrung@debian.org> (Closes: #1023826).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--debian/patches/series1
-rw-r--r--debian/patches/upstream/0001-ftbfs-big-endian.patch44
2 files changed, 45 insertions, 0 deletions
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..f4c448e
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+upstream/0001-ftbfs-big-endian.patch
diff --git a/debian/patches/upstream/0001-ftbfs-big-endian.patch b/debian/patches/upstream/0001-ftbfs-big-endian.patch
new file mode 100644
index 0000000..f92cc8f
--- /dev/null
+++ b/debian/patches/upstream/0001-ftbfs-big-endian.patch
@@ -0,0 +1,44 @@
+Author: Jeremy Kerr <jk@codeconstruct.com.au>
+Description: mi: endian fixes
+ We have a couple of endian issues in the mi code: one where we're not
+ converting cdw0 for MI commands, and one where we're using the wrong
+ byte length for an existing conversion. There is also an error in the
+ test suite, where we should be converting the nsze field of a
+ nvme_id_ns.
+ .
+ This change fixes those, so that the test suite passes on a BE platform
+ (ppc64 in my case).
+
+diff -Naurp libnvme.orig/src/nvme/mi.c libnvme/src/nvme/mi.c
+--- libnvme.orig/src/nvme/mi.c
++++ libnvme/src/nvme/mi.c
+@@ -139,7 +139,7 @@ int nvme_mi_scan_ep(nvme_mi_ep_t ep, boo
+ struct nvme_mi_ctrl *ctrl;
+ __u16 id;
+
+- id = le32_to_cpu(list.identifier[i]);
++ id = le16_to_cpu(list.identifier[i]);
+ if (!id)
+ continue;
+
+@@ -985,7 +985,7 @@ static int nvme_mi_read_data(nvme_mi_ep_
+ req_hdr.hdr.nmp = (NVME_MI_ROR_REQ << 7) |
+ (NVME_MI_MT_MI << 3); /* we always use command slot 0 */
+ req_hdr.opcode = nvme_mi_mi_opcode_mi_data_read;
+- req_hdr.cdw0 = cdw0;
++ req_hdr.cdw0 = cpu_to_le32(cdw0);
+
+ memset(&req, 0, sizeof(req));
+ req.hdr = &req_hdr.hdr;
+diff -Naurp libnvme.orig/test/mi.c libnvme/test/mi.c
+--- libnvme.orig/test/mi.c
++++ libnvme/test/mi.c
+@@ -1287,7 +1287,7 @@ static void test_admin_ns_mgmt_create(st
+ assert(!rc);
+ assert(ns == 0x01020304);
+
+- nsid.nsze = 42;
++ nsid.nsze = cpu_to_le64(42);
+ rc = nvme_mi_admin_ns_mgmt_create(ctrl, &nsid, 0, &ns);
+ assert(rc);
+ }