Re: DeviceTree and children devices

From: Grant Likely
Date: Mon Oct 24 2011 - 04:24:06 EST


On Mon, Oct 24, 2011 at 10:12 AM, Felipe Balbi <balbi@xxxxxx> wrote:
> On Mon, Oct 24, 2011 at 09:58:39AM +0200, Grant Likely wrote:
>> On Mon, Oct 24, 2011 at 9:49 AM, Felipe Balbi <balbi@xxxxxx> wrote:
>> > diff --git a/drivers/of/platform.c b/drivers/of/platform.c
>> > index ed5a6d3..172d4a9 100644
>> > --- a/drivers/of/platform.c
>> > +++ b/drivers/of/platform.c
>> > @@ -204,7 +204,12 @@ struct platform_device *of_platform_device_create_pdata(
>> >  #if defined(CONFIG_MICROBLAZE)
>> >        dev->archdata.dma_mask = 0xffffffffUL;
>> >  #endif
>> > -       dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
>> > +
>> > +       if (parent)
>> > +               dma_set_coherent_mask(&dev->dev, parent->coherent_dma_mask);
>> > +       else
>> > +               dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));
>> > +
>>
>> Right, this does need to be fixed.  The existing code just matched
>> what the historical powerpc code did, but it is certainly not correct.
>
> should I send patch above correctly ? Or do you want to also solve
> 32-bit coherent mask altogether ? What are your plans for that ? Add a
> separate property to pass coherent_mask size (32-bit, 64-bit, etc) ?

i don't know. I'm not the expert on how the coherent mask should be
set. Your patch does look sane as a starting point, but it bears
looking at by someone more cluefull than me. In particular, someone
should investigate if the dma mask can be calculated from a dma-ranges
property.

g.
--
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/