]> www.infradead.org Git - nvme.git/commit
nvme-pci: skip CMB blocks incompatible with PCI P2P DMA
authorIcenowy Zheng <uwu@icenowy.me>
Wed, 12 Feb 2025 17:04:44 +0000 (01:04 +0800)
committerKeith Busch <kbusch@kernel.org>
Tue, 25 Feb 2025 00:23:57 +0000 (16:23 -0800)
commit56cf7ef0d490b28fad8f8629fc135c5ab7c9f54e
tree4bcd88a4f05eb7c2708e342ecedf704245e52d44
parent6a3572e10f740acd48e2713ef37e92186a3ce5e8
nvme-pci: skip CMB blocks incompatible with PCI P2P DMA

The PCI P2PDMA code will register the CMB block to the memory
hot-plugging subsystem, which have an alignment requirement. Memory
blocks that do not satisfy this alignment requirement (usually 2MB) will
lead to a WARNING from memory hotplugging.

Verify the CMB block's address and size against the alignment and only
try to send CMB blocks compatible with it to prevent this warning.

Tested on Intel DC D4502 SSD, which has a 512K CMB block that is too
small for memory hotplugging (thus PCI P2PDMA).

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/pci.c