Christoph, Thanks for the review comments. On 10/14/24 1:53 PM, Christoph Hellwig wrote: > 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. Ack. I will reword the message. > >> + 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? The Intel IPU6 driver contains 2 modules, this symbol is defined in intel_ipu6 module. The map/unmap_sgtable are also used by another driver - intel_ipu6_isys. > >> 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 > -- Best regards, Bingbu Cao