[RFC PATCH kernel 01/17] pci/dma/tsm: Call disable DMA bus hook on cleanup
From: Alexey Kardashevskiy
Date: Wed Sep 16 2026 - 08:15:41 EST
Since XXXX ("PCI, device core: Add private memory access for DEVICE_TRUST_TCB")
the TSM subsystem relies on the PCI subsystem to ask the TSM to enable
DMA.
That misses teardown path to disable DMA, add it now.
Fixes: XXXX ("PCI, device core: Add private memory access for DEVICE_TRUST_TCB")
Signed-off-by: Alexey Kardashevskiy <aik@xxxxxxx>
---
Squash into "PCI, device core: Add private memory access for
DEVICE_TRUST_TCB"?
---
drivers/pci/pci-driver.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index a036f3d7e6d5..633926b55da6 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -1739,6 +1739,9 @@ static void pci_dma_cleanup(struct device *dev)
if (!driver->driver_managed_dma)
iommu_device_unuse_default_domain(dev);
+
+ if (device_tcb_trusted(dev))
+ pci_tsm_disable_dma(to_pci_dev(dev));
}
/*
--
2.55.0