All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: bingbu.cao@intel.com
Cc: linux-media@vger.kernel.org, sakari.ailus@linux.intel.com,
	hch@lst.de, andriy.shevchenko@linux.intel.com,
	bingbu.cao@linux.intel.com
Subject: Re: [PATCH 1/5] media: ipu6: not override the dma_ops of device in driver
Date: Mon, 14 Oct 2024 07:53:06 +0200	[thread overview]
Message-ID: <20241014055306.GB20331@lst.de> (raw)
In-Reply-To: <20241014034732.3109440-1-bingbu.cao@intel.com>

On Mon, Oct 14, 2024 at 11:47:28AM +0800, bingbu.cao@intel.com wrote:
> From: Bingbu Cao <bingbu.cao@intel.com>
> 
> 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


  parent reply	other threads:[~2024-10-14  5:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14  3:47 [PATCH 1/5] media: ipu6: not override the dma_ops of device in driver bingbu.cao
2024-10-14  3:47 ` [PATCH 2/5] media: ipu6: use the IPU6 DMA mapping APIs to do mapping bingbu.cao
2024-10-14  3:47 ` [PATCH 3/5] media: ipu6: remove architecture DMA ops dependency in Kconfig bingbu.cao
2024-10-14  3:47 ` [PATCH 4/5] Documentation: ipu6: remove the dma_ops part from the doc bingbu.cao
2024-10-14  3:47 ` [PATCH 5/5] media: ipu6: use PFN_UP() and sg_virt() for code simplicity bingbu.cao
2024-10-14  5:54   ` Christoph Hellwig
2024-10-14 10:31     ` Bingbu Cao
2024-10-15  4:59       ` Christoph Hellwig
2024-10-14  5:53 ` Christoph Hellwig [this message]
2024-10-14  5:59   ` [PATCH 1/5] media: ipu6: not override the dma_ops of device in driver Bingbu Cao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241014055306.GB20331@lst.de \
    --to=hch@lst.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bingbu.cao@intel.com \
    --cc=bingbu.cao@linux.intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.