Re: [OPW kernel] xhci.c: dma_set_mask

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

 



On Tue, 14 May 2013, Sarah Sharp wrote:

> On Wed, May 15, 2013 at 04:56:00AM +0300, Xenia Ragiadakou wrote:
> > Hi Sarah,
> 
> Hi Ksenia!
> 
> > In xhci.c line 4665, the function dma_set_mask is used to enable
> > 64-bit DMA addressing
> > (if i understood correctly).
> > 
> > However, accordingly to the Documentation/DMA-API-HOWTO.txt, there
> > is possibility
> > that the platform cannot support the DMA addressing of the device.
> > So the return value of dma_set_mask needs to be tested if it equals
> > zero and if not
> > go to error label. Am I right?
> >
> > Can we assume that 64 bit or 32 bit DMA addressing will always be supported?
> > This is the first time i come through these stuff so my intuition is
> > limited.
> 
> All xHCI hosts are required to support DMA, by the xHCI specification.
> You just can't get USB 3.0 speeds without DMA.
> 
> Or are you concerned that the xHCI host will support 64-bit DMA, but the
> system only supports 32-bit DMA?  Because that would be a question for
> Alan Stern, who has worked on the USB core for far longer than I have.

I suppose it is possible.  It's also possible that the xHCI hardware 
might support 32-bit DMA only.

> The xHCI PCI driver sets the hc_driver->flag for HCD_MEMORY, which means
> the USB host controller requires DMA.

Actually it means that the host controller uses memory-mapped I/O for 
register accesses.  HCD_MEMORY has no connection with DMA.  Maybe 
you're thinking of the uses_dma flag in struct usb_bus.

>  In drivers/usb/core/hcd-pci.c
> (which is what the xHCI PCI driver calls into in its probe function),
> the USB core will fail the init if the device doesn't support DMA.

No, it won't.  The uses_dma flag gets set during initialization in 
usb_create_shared_hcd(), but it isn't checked at all during init.

Alan Stern

--
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