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

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

 



On Fri, Jun 07, 2013 at 11:37:53PM +0300, Felipe Balbi wrote:
> Hi,
> 
> On Fri, Jun 07, 2013 at 10:19:23AM -0700, Sarah Sharp wrote:
> > Adding Felipe.
> > 
> > Xenia, Felipe is the USB "gadget" maintainer, and also added code for
> > non-PCI xHCI hosts.  Felipe, Xenia is my summer intern through the FOSS
> > Outreach Program for Women: http://kernelnewbies.org/OPWIntro
> 
> Hey, cool Sarah :-)
> 
> Welcome Xenia :-)

Ah, slight correction, my intern wants to be called Ksenia.  Xenia is
her legal name, but everyone calls her Ksenia. :)

> > On Fri, Jun 07, 2013 at 03:00:47PM +0300, Mathias Nyman wrote:
> > > Andy explained his concern in more detail to me irl.
> > > 
> > > The beef is that the dma_mask is a pointer while dma_coherent_mask
> > > is a u64 value in struct device, and dma_set_mask() fails if
> > > dev->dma_mask doesn't point anywhere.
> > > 
> > > This is not a problem for PCI enumerated devices because PCI probe
> > > sets a default 32bit mask and makes the dma_mask of all new PCI
> > > devices point to this value.
> > > 
> > > For non-pci enumerated devices the device dma_mask may be NULL and
> > > dma_set_mask() may fail even if dma is supported on the host
> > > machine.
> > > 
> > > for example ehci-platform.c solves this by adding:
> > > 
> > > if (!dev->dev.dma_mask)
> > >     dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
> > > if (!dev->dev.coherent_dma_mask)
> > >     dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> > 
> > So it sounds like xhci_plat_setup() in xhci-plat.c needs to do something
> > similar before it calls xhci_gen_setup().  Felipe, do you agree?
> 
> (now, after reading the whole thing...)
> 
> I'll agree with that :)
> 
> > It's funny that the code worked before.  Perhaps setting the dma_mask
> > pointer should be a separate patch for stable?
> 
> sounds like a good plan to me :-)

Great!  Ok, Ksenia, can you create those two patches?  The first patch
in the series should add setting the dma_mask pointer to
xhci_plat_setup().  The second patch will be the same as this patch.
Let me know via IRC if you have any questions.

Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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

  Powered by Linux