Re: [RFC v3] xhci: fix dma mask setup in xhci.c

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

 



Hi,

On Tue, Jul 09, 2013 at 02:43:45PM -0700, Sarah Sharp wrote:
> On Tue, Jul 09, 2013 at 02:59:38PM +0300, Felipe Balbi wrote:
> > Hi,
> > 
> > On Mon, Jul 08, 2013 at 09:55:15PM -0700, Sarah Sharp wrote:
> > > Felipe, Andy, and Seb, I have a couple questions below.
> > > 
> > > On Fri, Jul 05, 2013 at 08:24:56PM +0300, Xenia Ragiadakou wrote:
> > > Felipe, Andy, is there any chance that a platform_device dma_mask
> > > pointer would already be initialized by the time the probe function is
> > > called?  We wouldn't want to overwrite it.  Can you please check the
> > > xhci_plat_probe code?
> > 
> > yes there is. At least if you're booting with Devicetree, OF core sets
> > *all* dma_masks to 32-bits (erroneously IMO):
> > 
> > $ git grep -e dma_mask drivers/of/
> > drivers/of/platform.c:  dev->dev.dma_mask = &dev->archdata.dma_mask;
> > drivers/of/platform.c:  dev->archdata.dma_mask = 0xffffffffUL;
> > drivers/of/platform.c:  dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> > drivers/of/platform.c:  dev->dev.coherent_dma_mask = ~0;
> > drivers/of/platform.c:  dev->dma_mask = ~0;
> 
> Ok, so that means Xenia needs to make sure to check whether the dma_mask
> pointer is non-NULL in xhci-plat.c, so that she doesn't overwrite it with
> a pointer to the coherent dma mask, correct?
> 
> Or should she just overwrite the pointer because the OF core really
> shouldn't be setting the DMA mask pointer?

I think it's safe to overwrite (and perhaps even better to do so)
provided OF core enables 32-bits blindly, without checking anything
about the device.

Eventually that dma_mask setting should, likely, come via DeviceTree to
the platform_devices. Until, we can overwrite with whatever we can
discover out of the device's registers.

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux