Re: [PATCH 1/2] DMAENGINE: define a dummy filter function for coh901318

From: Dan Williams
Date: Wed Sep 29 2010 - 18:51:58 EST


On Wed, Sep 29, 2010 at 3:36 PM, Linus Walleij
<linus.ml.walleij@xxxxxxxxx> wrote:
> 2010/9/29 Dan Williams <dan.j.williams@xxxxxxxxx>:
>> On Tue, Sep 28, 2010 at 12:03 AM, Linus Walleij <linus.walleij@xxxxxxxxxxxxxx> wrote:
>>> All platform data has to be made conditional on
>>> as to avoid cluttering the code with other #ifdef:s.
>>>
>>
>> The filter id function assumes that the channel passed in is a
>> coh901318 which requires that you are in a mach-u300 build and that no
>> other dma driver will ever appear on this platform.  Which may be
>> true,
>
> It is... I promise, the platform only has COH901318 and is not being
> refined into future derivates with any multi-DMA-engine variants.
>
> Feels a bit over-engineered to take that aspect into account.
> Can't we handle it the day we have a platform available with
> two or more diverse DMA controllers?

Yeah, no rush to change it now.

>
>> but it would be safer to look at
>> chan->device->dev->platform_data and deduce that it is indeed a
>> coh901318 channel before de-referencing private fields.
>
> I read it like you want a patch also patching the filter function to
> do this check or am I misreading it?

Yes.

>
> Right now it atleast has the other theoretical upside (as compared to
> having another totally different DMA block): it can support
> multiple instances of COH901318:s, handling each a subset of
> channels. In this case the filter function will locate the right channel
> on the right instance -> elegant.
>
>> Taken further
>> if you rewrite the filter_id function in terms of platform_data then
>> it could live purely in the arch code and not depend on the driver.
>> ...or did you already try this route and hit a snag?
>
> Nah can probably be done, it just feels more elegant to check
> the channel ID (in this case a simple number) against the thing
> that's actually registered in the driver.
>
> It will be a bigger patch fixing a sort of different problem though,
> this will just fix my problem of compiling the platform without
> DMA support, which is currently not possible without a lot of
> #ifdefs in the platform code.

You can add my acked-by to this one and take it through the arch tree.

...but an eventual patch killing a driver specific export and making
the filter function intrinsically safe (i.e. without needing to know
it is a config bool, or that no other dma blocks will show up on this
machine) would be readily accepted.

--
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/