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

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

 



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

Felipe, we're discussing the fact that the xHCI host currently does not
set up 64-bit coherent DMA, so we get 64-bit addresses for USB buffers,
but not xHCI data structures.  Xenia has a patch to fix it, which can be
found here: http://marc.info/?l=linux-usb&m=137052855612729&w=2

Andy thinks the patch has issues with non-PCI xHCI hosts.

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?

It's funny that the code worked before.  Perhaps setting the dma_mask
pointer should be a separate patch for stable?

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