Skip to content

Commit 6a3572e

Browse files
Icenowykeithbusch
authored andcommitted
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 <uwu@icenowy.me> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 8c1624b commit 6a3572e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/nvme/host/pci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,6 +2003,7 @@ static void nvme_map_cmb(struct nvme_dev *dev)
20032003
if (pci_p2pdma_add_resource(pdev, bar, size, offset)) {
20042004
dev_warn(dev->ctrl.device,
20052005
"failed to register the CMB\n");
2006+
hi_lo_writeq(0, dev->bar + NVME_REG_CMBMSC);
20062007
return;
20072008
}
20082009

0 commit comments

Comments
 (0)