Re: [OPW kernel] xhci.c: dma_set_mask

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

 



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.

The xHCI PCI driver sets the hc_driver->flag for HCD_MEMORY, which means
the USB host controller requires DMA.  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.

Separately from the PCI probe function, the xHCI driver in xhci.c:4665
tests whether the host supports 32-bit DMA or 64-bit DMA.  This is an
xHCI-specific DMA capability, not a generic PCI DMA capability.

Does that answer your 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