On Mon, Oct 14, 2024 at 11:47:28AM +0800, bingbu.cao@xxxxxxxxx wrote: > From: Bingbu Cao <bingbu.cao@xxxxxxxxx> > > DMA ops are a helper for architectures and not for drivers to override > the DMA implementation. Driver should not override the DMA > implementation. This patch remove the dma_ops override and expose the > IPU6 DMA mapping APIs. That's a good rationale, but it might make sense to mention what you're actually changing here as well. > + ret = dma_map_sgtable(&pdev->dev, sgt, DMA_TO_DEVICE, 0); > + if (ret) { > + sg_free_table(sgt); > + goto out; > + } > + > + ret = ipu6_dma_map_sgtable(sys, sgt, DMA_TO_DEVICE, 0); This looks like the only user of ipu6_dma_map_sgtable, any reason to not open code it here? > kfree(pages); > @@ -607,7 +615,10 @@ EXPORT_SYMBOL_NS_GPL(ipu6_buttress_map_fw_image, INTEL_IPU6); > void ipu6_buttress_unmap_fw_image(struct ipu6_bus_device *sys, > struct sg_table *sgt) > { > - dma_unmap_sgtable(&sys->auxdev.dev, sgt, DMA_TO_DEVICE, 0); > + struct pci_dev *pdev = sys->isp->pdev; > + > + ipu6_dma_unmap_sgtable(sys, sgt, DMA_TO_DEVICE, 0); Same for ipu6_dma_unmap_sgtable