[PATCH v2] ARM: pl330: Fix a race condition

Jassi Brar jaswinder.singh at linaro.org
Sun Dec 11 12:10:15 EST 2011


On 11 December 2011 20:39, Javi Merino <javi.merino at arm.com> wrote:
>>>
>>> What about properly tracking what we have sent to the DMA?  Something
>>> like the following (warning *ugly* and untested code ahead, may eat your
>>> kitten):
>>>
>> Yeah, this is like I said 'marker' method. Though we can clean it up a bit.
>> 1) Pack req_running and lstenq together. Make lsteng return invalid value
>> should there be no buff programmed, otherwise 0 or 1.
>
> This can lead to starvation.  If lstenq is -1 when the DMA hasn't been
> programmed yet, in _trigger() you don't know which buffer is the
> "oldest", so you may end up always starting the new buffer and
> forgetting about the other one.  lstenq as it is right now prevents that.
>
Sorry I don't understand. If lstenq is -1 that means there's no req programmed
so trigger need not do anything. I didn't say we don't need to do anything else.
Though it's just an idea I haven't implemented and it may not work out.
Just please give it a try if you can. Thanks.



More information about the linux-arm-kernel mailing list