lede/target/linux/bcm27xx/patches-6.12/950-0685-nvme-pci-Disable-Host-Memory-Buffer-usage.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= d81c03f05e bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-06-20 17:01:06 +08:00

49 lines
1.3 KiB
Diff

From 4263812f0e010a193c6654f75eda49220066bd57 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Tue, 3 Dec 2024 15:57:01 +0000
Subject: [PATCH] nvme-pci: Disable Host Memory Buffer usage
Some NVME drives seem to request significant amounts of DMA coherent
memory - enough to exhaust our standard 64MB CMA allocation.
Try disabling the feature to see what effect it has - drives should
continue to function without it.
Link: https://github.com/raspberrypi/linux/issues/6504
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
drivers/nvme/host/pci.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2083,6 +2083,7 @@ static void nvme_free_host_mem(struct nv
dev->nr_host_mem_descs = 0;
}
+#if 0
static int __nvme_alloc_host_mem(struct nvme_dev *dev, u64 preferred,
u32 chunk_size)
{
@@ -2151,9 +2152,11 @@ out:
dev->host_mem_descs = NULL;
return -ENOMEM;
}
+#endif
static int nvme_alloc_host_mem(struct nvme_dev *dev, u64 min, u64 preferred)
{
+#if 0
u64 min_chunk = min_t(u64, preferred, PAGE_SIZE * MAX_ORDER_NR_PAGES);
u64 hmminds = max_t(u32, dev->ctrl.hmminds * 4096, PAGE_SIZE * 2);
u64 chunk_size;
@@ -2166,6 +2169,7 @@ static int nvme_alloc_host_mem(struct nv
nvme_free_host_mem(dev);
}
}
+#endif
return -ENOMEM;
}