Re: [PATCH] of: set dma_mask to point to coherent_dma_mask

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Wed, 6 Nov 2013, Stefano Stabellini wrote:
> On Sat, 2 Nov 2013, Grant Likely wrote:
> > On Wed, 30 Oct 2013 00:05:22 -0500, Rob Herring <robherring2@xxxxxxxxx> wrote:
> > > From: Rob Herring <rob.herring@xxxxxxxxxxx>
> > > 
> > > Platform devices created by DT code don't initialize dma_mask pointer to
> > > anything. Set it to coherent_dma_mask by default if the architecture
> > > code has not set it.
> > > 
> > > Signed-off-by: Rob Herring <rob.herring@xxxxxxxxxxx>
> > 
> > I believe this is okay. I haven't done any testing to back up that
> > opinion though.
> 
> Tested-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

BTW I hope you are planning on sending this upstream soon, because
without it I can very easily corrupt my root fs by simply booting the system.


> > > I think this is at least part of what is needed to fix dma_mask issue
> > > raised by Stefano [1]. Things should work AFAICT with just this, but
> > > I suppose the xgmac driver needs to set the mask as well (not relying
> > > on the default), but some pointing the dma_mask to a valid value is
> > > needed first.
> > > 
> > > Rob
> > > 
> > > [1] http://www.mail-archive.com/linux-kernel@xxxxxxxxxxxxxxx/msg528236.html
> > > 
> > >  drivers/of/platform.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> > > index f6dcde2..fce088e 100644
> > > --- a/drivers/of/platform.c
> > > +++ b/drivers/of/platform.c
> > > @@ -215,6 +215,8 @@ static struct platform_device *of_platform_device_create_pdata(
> > >  	dev->archdata.dma_mask = 0xffffffffUL;
> > >  #endif
> > >  	dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> > > +	if (!dev->dev.dma_mask)
> > > +		dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
> > >  	dev->dev.bus = &platform_bus_type;
> > >  	dev->dev.platform_data = platform_data;
> > >  
> 
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux