Skip to content

Commit e0df973

Browse files
committed
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 <[email protected]>
1 parent 3f59db5 commit e0df973

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
@@ -1973,6 +1973,7 @@ static void nvme_free_host_mem(struct nvme_dev *dev)
19731973
dev->nr_host_mem_descs = 0;
19741974
}
19751975

1976+
#if 0
19761977
static int __nvme_alloc_host_mem(struct nvme_dev *dev, u64 preferred,
19771978
u32 chunk_size)
19781979
{
@@ -2040,9 +2041,11 @@ static int __nvme_alloc_host_mem(struct nvme_dev *dev, u64 preferred,
20402041
dev->host_mem_descs = NULL;
20412042
return -ENOMEM;
20422043
}
2044+
#endif
20432045

20442046
static int nvme_alloc_host_mem(struct nvme_dev *dev, u64 min, u64 preferred)
20452047
{
2048+
#if 0
20462049
u64 min_chunk = min_t(u64, preferred, PAGE_SIZE * MAX_ORDER_NR_PAGES);
20472050
u64 hmminds = max_t(u32, dev->ctrl.hmminds * 4096, PAGE_SIZE * 2);
20482051
u64 chunk_size;
@@ -2055,6 +2058,7 @@ static int nvme_alloc_host_mem(struct nvme_dev *dev, u64 min, u64 preferred)
20552058
nvme_free_host_mem(dev);
20562059
}
20572060
}
2061+
#endif
20582062

20592063
return -ENOMEM;
20602064
}

0 commit comments

Comments
 (0)