Skip to content

Commit

Permalink
nvme-pci: Disable Host Memory Buffer usage
Browse files Browse the repository at this point in the history
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: raspberrypi#6504

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
  • Loading branch information
pelwell committed Dec 3, 2024
1 parent 1993b45 commit d97eb7e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/nvme/host/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1936,6 +1936,7 @@ static void nvme_free_host_mem(struct nvme_dev *dev)
dev->nr_host_mem_descs = 0;
}

#if 0
static int __nvme_alloc_host_mem(struct nvme_dev *dev, u64 preferred,
u32 chunk_size)
{
Expand Down Expand Up @@ -2003,9 +2004,11 @@ static int __nvme_alloc_host_mem(struct nvme_dev *dev, u64 preferred,
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;
Expand All @@ -2018,6 +2021,7 @@ static int nvme_alloc_host_mem(struct nvme_dev *dev, u64 min, u64 preferred)
nvme_free_host_mem(dev);
}
}
#endif

return -ENOMEM;
}
Expand Down

0 comments on commit d97eb7e

Please sign in to comment.