Skip to content

Commit fda47c0

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 e33702e commit fda47c0

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
@@ -1936,6 +1936,7 @@ static void nvme_free_host_mem(struct nvme_dev *dev)
19361936
dev->nr_host_mem_descs = 0;
19371937
}
19381938

1939+
#if 0
19391940
static int __nvme_alloc_host_mem(struct nvme_dev *dev, u64 preferred,
19401941
u32 chunk_size)
19411942
{
@@ -2003,9 +2004,11 @@ static int __nvme_alloc_host_mem(struct nvme_dev *dev, u64 preferred,
20032004
dev->host_mem_descs = NULL;
20042005
return -ENOMEM;
20052006
}
2007+
#endif
20062008

20072009
static int nvme_alloc_host_mem(struct nvme_dev *dev, u64 min, u64 preferred)
20082010
{
2011+
#if 0
20092012
u64 min_chunk = min_t(u64, preferred, PAGE_SIZE * MAX_ORDER_NR_PAGES);
20102013
u64 hmminds = max_t(u32, dev->ctrl.hmminds * 4096, PAGE_SIZE * 2);
20112014
u64 chunk_size;
@@ -2018,6 +2021,7 @@ static int nvme_alloc_host_mem(struct nvme_dev *dev, u64 min, u64 preferred)
20182021
nvme_free_host_mem(dev);
20192022
}
20202023
}
2024+
#endif
20212025

20222026
return -ENOMEM;
20232027
}

0 commit comments

Comments
 (0)