[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87mw498yp8.fsf@free.fr>
Date: Thu, 19 Feb 2015 20:53:55 +0100
From: Robert Jarzmik <robert.jarzmik@...e.fr>
To: Daniel Mack <daniel@...que.org>
Cc: Haojian Zhuang <haojian.zhuang@...il.com>,
Vinod Koul <vinod.koul@...el.com>,
Arnd Bergmann <arnd@...db.de>,
Vasily Khoruzhick <anarsoul@...il.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
dmaengine@...r.kernel.org
Subject: Re: [PATCH v2 1/2] dma: mmp_dma: add support for legacy transition
Daniel Mack <daniel@...que.org> writes:
> Hi Robert,
>
> Thanks for pushing this topic :)
> One minor nit:
>
>> +int mmp_pdma_toggle_reserved_channel(int legacy_channel)
>> +{
>> + if (legacy_unavailable & (1 << legacy_channel))
>> + return -EBUSY;
>> + legacy_reserved ^= 1 << legacy_channel;
>> + return 0;
>> +}
>> +EXPORT_SYMBOL_GPL(mmp_pdma_toggle_reserved_channel);
>
> My concern is that if pxa_request_dma() is called more than once for
> whatever reason by a legacy implementation, the toggled bit mask might
> get out of sync.
This is not possible.
The first call to pxa_request_dma() sets dma_channels[i].name to a non-NULL
value.
The second call to pxa_request_dma() cannot take the same i as
!dma_channels[i].name is not fullfilled.
> As we know exactly on the caller site what we want to achieve, let's make the
> API explicit with something like:
>
> int mmp_pdma_set_reserved_channel(int legacy_channel, bool reserved)
Even if I have no strong opinion about it, I'll let the patch as it is, unless
you really want me to add the reserved parameter, in which case I'll release a
v3.
Cheers.
--
Robert
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists