Thread (30 messages) 30 messages, 7 authors, 2021-03-11

RE: [PATCH v2 1/5] PCI: dwc: Call dma_unmap_page() before freeing the msi page

From: Gustavo Pimentel <hidden>
Date: 2020-09-24 11:56:33
Also in: linux-amlogic, linux-arm-msm, linux-omap, linux-pci, linux-samsung-soc, linux-tegra, lkml

On Thu, Sep 24, 2020 at 12:5:57, Jisheng Zhang 
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
In dw_pcie_free_msi(), call dma_unmap_page() before freeing.

Signed-off-by: Jisheng Zhang <redacted>
---
 drivers/pci/controller/dwc/pcie-designware-host.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index 9dafecba347f..0a19de946351 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -288,8 +288,12 @@ void dw_pcie_free_msi(struct pcie_port *pp)
 	irq_domain_remove(pp->msi_domain);
 	irq_domain_remove(pp->irq_domain);
 
-	if (pp->msi_page)
+	if (pp->msi_page) {
+		struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
+		struct device *dev = pci->dev;
+		dma_unmap_page(dev, pp->msi_data, PAGE_SIZE, DMA_FROM_DEVICE);
 		__free_page(pp->msi_page);
+	}
 }
 
 void dw_pcie_msi_init(struct pcie_port *pp)
-- 
2.28.0
Acked-by: Gustavo Pimentel <redacted>



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help