Skip to content
Snippets Groups Projects
Commit 6a3572e1 authored by Icenowy Zheng's avatar Icenowy Zheng Committed by Keith Busch
Browse files

nvme-pci: clean up CMBMSC when registering CMB fails


CMB decoding should get disabled when the CMB block isn't successfully
registered to P2P DMA subsystem.

Clean up the CMBMSC register in this error handling codepath to disable
CMB decoding (and CMBLOC/CMBSZ registers).

Signed-off-by: Icenowy Zheng's avatarIcenowy Zheng <uwu@icenowy.me>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent 8c1624b6
No related branches found
No related tags found
No related merge requests found
......@@ -2003,6 +2003,7 @@ static void nvme_map_cmb(struct nvme_dev *dev)
if (pci_p2pdma_add_resource(pdev, bar, size, offset)) {
dev_warn(dev->ctrl.device,
"failed to register the CMB\n");
hi_lo_writeq(0, dev->bar + NVME_REG_CMBMSC);
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment