Re: [PATCH] char: xillybus: Eliminate redundant wrappers to DMA related calls

From: Eli Billauer
Date: Mon Sep 27 2021 - 11:35:54 EST


On 27/09/21 10:47, Arnd Bergmann wrote:
+static void xilly_sync_for_device(struct xilly_endpoint *ep,
> + dma_addr_t dma_handle,
> + size_t size,
> + int direction)
> +{
> + if (ep->make_sync_calls)
> + dma_sync_single_for_device(ep->dev, dma_handle,
> + size, direction);
> +}

These wrappers should not even be needed. When the device is
marked as coherent in DT, the dma_sync_*() calls are supposed
to do nothing, in a relatively efficient way. I would not expect
the extra conditional to give you any measurable performance
benefit over what you get normally, and it should not make a
functional difference either.

Can you remove the inlines and the ->make_sync_calls flag?


Thanks, I had no idea that the sync functions neutralize themselves this way. That is, since commit 591c1ee465ce ("of: configure the platform device dma parameters") from back in April 2014.

So indeed, I shall remove the the @make_sync_calls entry and related wrapper functions, and resubmit an second version of this patch.

Thanks again,
Eli