Skip to content

Commit c580470

Browse files
pelwellpopcornmix
authored andcommitted
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: #6504 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
1 parent 397373b commit c580470

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/nvme/host/pci.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,6 +1969,7 @@ static void nvme_free_host_mem(struct nvme_dev *dev)
19691969
dev->nr_host_mem_descs = 0;
19701970
}
19711971

1972+
#if 0
19721973
static int __nvme_alloc_host_mem(struct nvme_dev *dev, u64 preferred,
19731974
u32 chunk_size)
19741975
{
@@ -2037,9 +2038,11 @@ static int __nvme_alloc_host_mem(struct nvme_dev *dev, u64 preferred,
20372038
dev->host_mem_descs = NULL;
20382039
return -ENOMEM;
20392040
}
2041+
#endif
20402042

20412043
static int nvme_alloc_host_mem(struct nvme_dev *dev, u64 min, u64 preferred)
20422044
{
2045+
#if 0
20432046
u64 min_chunk = min_t(u64, preferred, PAGE_SIZE * MAX_ORDER_NR_PAGES);
20442047
u64 hmminds = max_t(u32, dev->ctrl.hmminds * 4096, PAGE_SIZE * 2);
20452048
u64 chunk_size;
@@ -2052,6 +2055,7 @@ static int nvme_alloc_host_mem(struct nvme_dev *dev, u64 min, u64 preferred)
20522055
nvme_free_host_mem(dev);
20532056
}
20542057
}
2058+
#endif
20552059

20562060
return -ENOMEM;
20572061
}

0 commit comments

Comments
 (0)