lkml.org 
[lkml]   [2014]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3 58/59] dmaengine: Add a warning for drivers not using the generic slave caps retrieval
Date
Hi Maxime,

Thank you for the patch.

On Wednesday 22 October 2014 17:44:12 Maxime Ripard wrote:
> For the slave caps retrieval to be really useful, most drivers need to
> implement it.
>
> Hence, we need to be slightly more aggressive, and trigger a warning at
> registration time for drivers that don't fill their caps infos in order to
> encourage them to implement it.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---
> drivers/dma/dmaengine.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
> index 98e9431f85ec..4e18981b16bd 100644
> --- a/drivers/dma/dmaengine.c
> +++ b/drivers/dma/dmaengine.c
> @@ -827,6 +827,9 @@ int dma_async_device_register(struct dma_device *device)
> BUG_ON(!device->device_issue_pending);
> BUG_ON(!device->dev);
>
> + WARN(dma_has_cap(DMA_SLAVE, device->cap_mask) &&
> !device->generic_slave_caps,
> + "this driver doesn't support generic slave capabilities
> reporting\n");
> +

This might be slightly too aggressive. I agree with your previous comment on
all DMA engine drivers returning the same capabilities for all channels, but
it might not be true anymore in the future, in which case drivers will need to
implement a custom slave caps function. We could delay support for that to
when it's needed though.

> /* note: this only matters in the
> * CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=n case
> */

--
Regards,

Laurent Pinchart



\
 
 \ /
  Last update: 2014-10-22 23:41    [W:0.437 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site