Skip to content

Commit 962eb22

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 35d150c commit 962eb22

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
@@ -2075,6 +2075,7 @@ static void nvme_free_host_mem(struct nvme_dev *dev)
20752075
dev->nr_host_mem_descs = 0;
20762076
}
20772077

2078+
#if 0
20782079
static int nvme_alloc_host_mem_single(struct nvme_dev *dev, u64 size)
20792080
{
20802081
dev->hmb_sgt = dma_alloc_noncontiguous(dev->dev, size,
@@ -2169,9 +2170,11 @@ static int nvme_alloc_host_mem_multi(struct nvme_dev *dev, u64 preferred,
21692170
dev->host_mem_descs = NULL;
21702171
return -ENOMEM;
21712172
}
2173+
#endif
21722174

21732175
static int nvme_alloc_host_mem(struct nvme_dev *dev, u64 min, u64 preferred)
21742176
{
2177+
#if 0
21752178
u64 min_chunk = min_t(u64, preferred, PAGE_SIZE * MAX_ORDER_NR_PAGES);
21762179
u64 hmminds = max_t(u32, dev->ctrl.hmminds * 4096, PAGE_SIZE * 2);
21772180
u64 chunk_size;
@@ -2193,6 +2196,7 @@ static int nvme_alloc_host_mem(struct nvme_dev *dev, u64 min, u64 preferred)
21932196
nvme_free_host_mem(dev);
21942197
}
21952198
}
2199+
#endif
21962200

21972201
return -ENOMEM;
21982202
}

0 commit comments

Comments
 (0)