summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorIcenowy Zheng <uwu@icenowy.me>2025-02-13 01:04:43 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-10 14:33:38 +0200
commit159ef31d187c9479963c3a663be992c7e57aa5e2 (patch)
treec306bc4576432dc65a9ae940624c8b85218e1ce0 /drivers
parent6fca3c84f134c27ab9775e1e9e561d3d172e6881 (diff)
downloadlinux-159ef31d187c9479963c3a663be992c7e57aa5e2.tar.gz
linux-159ef31d187c9479963c3a663be992c7e57aa5e2.tar.bz2
linux-159ef31d187c9479963c3a663be992c7e57aa5e2.zip
nvme-pci: clean up CMBMSC when registering CMB fails
[ Upstream commit 6a3572e10f740acd48e2713ef37e92186a3ce5e8 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/nvme/host/pci.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index afcb9668dad9..bfca71f958a0 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1949,6 +1949,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;
}