Skip to contentSkip to conversation

DMA over USB

DISCUSSION Raghavendra 4 participants 11 messages Jul 2, 2014

lore
Share & tools
lore
#0 lore raw

Hello,

I have a query regarding DMA(Direct Memory Access) for the usb devices.

The understanding of DMA actions over PCI is straight forward. PCI devices support bus mastering capability, such that the PCI devices could take the ownership of the bus and perform access to the memory directly, and a software support exists for the same in Linux.

As far as USB devices are concerned, they don?t have the bus mastering capability like the PCI devices.
But the USB URB structure have a field named 'dma_addr_t transfer_dma', used for DMA access. The USB driver allocate the DMA buffers coherently and pass the DMA address to the URBs during its initialization. As far as Linux is concerned, how the DMA action being taking place for USB devices. As per my understanding, the USB host controller is taking care of the DMA operations. But I require a little more insight into it.

Further more, if it is possible for the USB devices, then can this support be also extended towards low-end protocols such as I2C or SPI?

Thanks,
Raghavendra

-------------------------------------------------------------------------------------------------------------------------------
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]

This e-mail is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email is strictly prohibited and appropriate legal action will be taken.
-------------------------------------------------------------------------------------------------------------------------------

#1 lore raw

You might want to ask this question to the USB experts on the linux-usb ML - linux-usb at vger.kernel.org

HTH,
-mandeep

Quoted 41 lines · Raghavendra

Hello,

I have a query regarding DMA(Direct Memory Access) for the usb devices.

The understanding of DMA actions over PCI is straight forward. PCI devices support bus mastering capability, such that the PCI devices could take the ownership of the bus and perform access to the memory directly, and a software support exists for the same in Linux.

As far as USB devices are concerned, they don?t have the bus mastering capability like the PCI devices.
But the USB URB structure have a field named 'dma_addr_t transfer_dma', used for DMA access. The USB driver allocate the DMA buffers coherently and pass the DMA address to the URBs during its initialization. As far as Linux is concerned, how the DMA action being taking place for USB devices. As per my understanding, the USB host controller is taking care of the DMA operations. But I require a little more insight into it.

Further more, if it is possible for the USB devices, then can this support be also extended towards low-end protocols such as I2C or SPI?

Thanks,
Raghavendra

-------------------------------------------------------------------------------------------------------------------------------
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]

This e-mail is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email is strictly prohibited and appropriate legal action will be taken.
-------------------------------------------------------------------------------------------------------------------------------

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

#2 lore raw
In reply to Raghavendra
Quoted 9 lines · Raghavendra

Hello,

I have a query regarding DMA(Direct Memory Access) for the usb devices.

The understanding of DMA actions over PCI is straight forward. PCI devices support bus mastering capability, such that the PCI devices could take the ownership of the bus and perform access to the memory directly, and a software support exists for the same in Linux.

Quoted 8 lines

As far as USB devices are concerned, they don?t have the bus mastering capability like the PCI devices.
But the USB URB structure have a field named 'dma_addr_t transfer_dma', used for DMA access. The USB driver allocate the DMA buffers coherently and pass the DMA address to the URBs during its initialization. As far as Linux is concerned, how the DMA action being taking place for USB devices. As per my understanding, the USB host controller is taking care of the DMA operations. But I require a little more insight into it.

Why, what exactly are you concerned about? What are you trying to do?

Quoted 2 lines

Further more, if it is possible for the USB devices, then can this support be also extended towards low-end protocols such as I2C or SPI?

It depends on your controller chips for those busses, if they support DMA or not.

greg k-h

#3 lore raw
Quoted 19 lines · Greg KH
Quoted 9 lines · Raghavendra

Hello,

I have a query regarding DMA(Direct Memory Access) for the usb devices.

The understanding of DMA actions over PCI is straight forward. PCI devices support bus mastering capability, such that the PCI devices could take the ownership of the bus and perform access to the memory directly, and a software support exists for the same in Linux.

Quoted 8 lines

As far as USB devices are concerned, they don?t have the bus mastering capability like the PCI devices.
But the USB URB structure have a field named 'dma_addr_t transfer_dma', used for DMA access. The USB driver allocate the DMA buffers coherently and pass the DMA address to the URBs during its initialization. As far as Linux is concerned, how the DMA action being taking place for USB devices. As per my understanding, the USB host controller is taking care of the DMA operations. But I require a little more insight into it.

Quoted 1 line

Why, what exactly are you concerned about? What are you trying to do?

Also, you _have_ read the USB DMA documentation, right?

What about the documentation in this area is unclear?

thanks,

greg k-h

#9 lore raw
In reply to Raghavendra

Hi Raghavendra,
In my case, we used USB host design from opencore. And the driver (I don't know where it came from. it's similar to sl811-hcd.c from cypress) writes or reads the data to /from the USB host. Not using DMA. I think if the USB host has DMA capability, tha pio read/write should be chnaged to triggering DMA.
http://lxr.free-electrons.com/source/drivers/usb/host/sl811-hcd.c see line 234.
Chan

?? ?? : "Raghavendra" <[email protected]>
?? ?? : 2014-07-02 14:20:42 ( +09:00 )
?? ?? : kernelnewbies <[email protected]> ?? :
?? : DMA over USB

Hello,

I have a query regarding DMA(Direct Memory Access) for the usb devices.

The understanding of DMA actions over PCI is straight forward. PCI devices support bus mastering capability, such that the PCI devices could take the ownership of the bus and perform access to the memory directly, and a software support exists for the same in Linux.

As far as USB devices are concerned, they don?t have the bus mastering capability like the PCI devices.
But the USB URB structure have a field named 'dma_addr_t transfer_dma', used for DMA access. The USB driver allocate the DMA buffers coherently and pass the DMA address to the URBs during its initialization. As far as Linux is concerned, how the DMA action being taking place for USB devices. As per my understanding, the USB host controller is taking care of the DMA operations. But I require a little more insight into it.

Further more, if it is possible for the USB devices, then can this support be also extended towards low-end protocols such as I2C or SPI?

Thanks,
Raghavendra

-------------------------------------------------------------------------------------------------------------------------------
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]

This e-mail is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email is strictly prohibited and appropriate legal action will be taken.
-------------------------------------------------------------------------------------------------------------------------------

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

#4 lore raw
In reply to Greg KH
Quoted 19 lines · Greg KH
Quoted 18 lines · Greg KH
Quoted 17 lines · Raghavendra

Hello,

I have a query regarding DMA(Direct Memory Access) for the usb devices.

The understanding of DMA actions over PCI is straight forward. PCI devices support bus mastering capability, such that the PCI devices could take the ownership of the bus and perform access to the memory directly, and a software support exists for the same in Linux.

As far as USB devices are concerned, they don?t have the bus mastering capability like the PCI devices.
But the USB URB structure have a field named 'dma_addr_t transfer_dma', used for DMA access. The USB driver allocate the DMA buffers coherently and pass the DMA address to the URBs during its initialization. As far as Linux is concerned, how the DMA action being taking place for USB devices. As per my understanding, the USB host controller is taking care of the DMA operations. But I require a little more insight into it.

Quoted 4 lines
Quoted 1 line

Why, what exactly are you concerned about? What are you trying to do?

Also, you _have_ read the USB DMA documentation, right?

What about the documentation in this area is unclear?

Yes, I have read the documentation and its fine. I am mostly concerned about the all the heavy lifting happening in the background.

Quoted 10 lines

thanks,

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

-------------------------------------------------------------------------------------------------------------------------------
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]

This e-mail is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email is strictly prohibited and appropriate legal action will be taken.
-------------------------------------------------------------------------------------------------------------------------------

#6 lore raw
In reply to Greg KH
Quoted 21 lines · Greg KH
Quoted 20 lines · Raghavendra
Quoted 19 lines · Greg KH
Quoted 18 lines · Greg KH
Quoted 17 lines · Raghavendra

Hello,

I have a query regarding DMA(Direct Memory Access) for the usb devices.

The understanding of DMA actions over PCI is straight forward. PCI devices support bus mastering capability, such that the PCI devices could take the ownership of the bus and perform access to the memory directly, and a software support exists for the same in Linux.

As far as USB devices are concerned, they don?t have the bus mastering capability like the PCI devices.
But the USB URB structure have a field named 'dma_addr_t transfer_dma', used for DMA access. The USB driver allocate the DMA buffers coherently and pass the DMA address to the URBs during its initialization. As far as Linux is concerned, how the DMA action being taking place for USB devices. As per my understanding, the USB host controller is taking care of the DMA operations. But I require a little more insight into it.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Why, what exactly are you concerned about? What are you trying to do?

Also, you _have_ read the USB DMA documentation, right?

What about the documentation in this area is unclear?

Yes, I have read the documentation and its fine. I am mostly concerned about the all the heavy lifting happening in the background.

Why? What exactly are you "concerned" about? What hardware controller? Is something not working properly?

Everything is fine. This is more of a theoretical understanding.

Quoted 2 lines

greg k-h

-------------------------------------------------------------------------------------------------------------------------------
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]

This e-mail is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email is strictly prohibited and appropriate legal action will be taken.
-------------------------------------------------------------------------------------------------------------------------------

#10 lore raw
In reply to Chan Kim
Quoted 50 lines · Chan Kim

Hi Raghavendra,
In my case, we used USB host design from opencore. And the driver (I don't know where it came from. it's similar to sl811-hcd.c from cypress) writes or reads the data to /from the USB host. Not using DMA. I think if the USB host has DMA capability, tha pio read/write should be chnaged to triggering DMA.
http://lxr.free-electrons.com/source/drivers/usb/host/sl811-hcd.c see line 234.
Chan

?? ?? : "Raghavendra" <[email protected]>
?? ?? : 2014-07-02 14:20:42 ( +09:00 )
?? ?? : kernelnewbies <[email protected]> ?? :
?? : DMA over USB

Hello,

I have a query regarding DMA(Direct Memory Access) for the usb devices.

The understanding of DMA actions over PCI is straight forward. PCI devices support bus mastering capability, such that the PCI devices could take the ownership of the bus and perform access to the memory directly, and a software support exists for the same in Linux.

As far as USB devices are concerned, they don?t have the bus mastering capability like the PCI devices.
But the USB URB structure have a field named 'dma_addr_t transfer_dma', used for DMA access. The USB driver allocate the DMA buffers coherently and pass the DMA address to the URBs during its initialization. As far as Linux is concerned, how the DMA action being taking place for USB devices. As per my understanding, the USB host controller is taking care of the DMA operations. But I require a little more insight into it.

Further more, if it is possible for the USB devices, then can this support be also extended towards low-end protocols such as I2C or SPI?

Thanks,
Raghavendra

-------------------------------------------------------------------------------------------------------------------------------
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]

This e-mail is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email is strictly prohibited and appropriate legal action will be taken.
-------------------------------------------------------------------------------------------------------------------------------

Quoted 5 lines

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Thanks Chan.

-------------------------------------------------------------------------------------------------------------------------------
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]

This e-mail is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email is strictly prohibited and appropriate legal action will be taken.
-------------------------------------------------------------------------------------------------------------------------------

#5 lore raw
In reply to Raghavendra
Quoted 20 lines · Raghavendra
Quoted 19 lines · Greg KH
Quoted 18 lines · Greg KH
Quoted 17 lines · Raghavendra

Hello,

I have a query regarding DMA(Direct Memory Access) for the usb devices.

The understanding of DMA actions over PCI is straight forward. PCI devices support bus mastering capability, such that the PCI devices could take the ownership of the bus and perform access to the memory directly, and a software support exists for the same in Linux.

As far as USB devices are concerned, they don?t have the bus mastering capability like the PCI devices.
But the USB URB structure have a field named 'dma_addr_t transfer_dma', used for DMA access. The USB driver allocate the DMA buffers coherently and pass the DMA address to the URBs during its initialization. As far as Linux is concerned, how the DMA action being taking place for USB devices. As per my understanding, the USB host controller is taking care of the DMA operations. But I require a little more insight into it.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Why, what exactly are you concerned about? What are you trying to do?

Also, you _have_ read the USB DMA documentation, right?

What about the documentation in this area is unclear?

Yes, I have read the documentation and its fine. I am mostly concerned about the all the heavy lifting happening in the background.

Why? What exactly are you "concerned" about? What hardware controller? Is something not working properly?

greg k-h

#7 lore raw
In reply to Raghavendra
Quoted 23 lines · Raghavendra
Quoted 22 lines · Greg KH
Quoted 21 lines · Raghavendra
Quoted 20 lines · Greg KH
Quoted 19 lines · Greg KH
Quoted 9 lines · Raghavendra

Hello,

I have a query regarding DMA(Direct Memory Access) for the usb devices.

The understanding of DMA actions over PCI is straight forward. PCI devices support bus mastering capability, such that the PCI devices could take the ownership of the bus and perform access to the memory directly, and a software support exists for the same in Linux.

Quoted 8 lines

As far as USB devices are concerned, they don?t have the bus mastering capability like the PCI devices.
But the USB URB structure have a field named 'dma_addr_t transfer_dma', used for DMA access. The USB driver allocate the DMA buffers coherently and pass the DMA address to the URBs during its initialization. As far as Linux is concerned, how the DMA action being taking place for USB devices. As per my understanding, the USB host controller is taking care of the DMA operations. But I require a little more insight into it.

Why, what exactly are you concerned about? What are you trying to do?

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Also, you _have_ read the USB DMA documentation, right?

What about the documentation in this area is unclear?

Yes, I have read the documentation and its fine. I am mostly concerned about the all the heavy lifting happening in the background.

Why? What exactly are you "concerned" about? What hardware controller? Is something not working properly?

Everything is fine. This is more of a theoretical understanding.

The code is there for your theoretical research :)

#8 lore raw
Quoted 26 lines · Greg KH
Quoted 25 lines · Raghavendra
Quoted 24 lines · Greg KH
Quoted 23 lines · Raghavendra
Quoted 22 lines · Greg KH
Quoted 18 lines · Greg KH
Quoted 9 lines · Raghavendra

Hello,

I have a query regarding DMA(Direct Memory Access) for the usb devices.

The understanding of DMA actions over PCI is straight forward. PCI devices support bus mastering capability, such that the PCI devices could take the ownership of the bus and perform access to the memory directly, and a software support exists for the same in Linux.

Quoted 8 lines

As far as USB devices are concerned, they don?t have the bus mastering capability like the PCI devices.
But the USB URB structure have a field named 'dma_addr_t transfer_dma', used for DMA access. The USB driver allocate the DMA buffers coherently and pass the DMA address to the URBs during its initialization. As far as Linux is concerned, how the DMA action being taking place for USB devices. As per my understanding, the USB host controller is taking care of the DMA operations. But I require a little more insight into it.

Quoted 1 line

Why, what exactly are you concerned about? What are you trying to do?

Also, you _have_ read the USB DMA documentation, right?

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

What about the documentation in this area is unclear?

Yes, I have read the documentation and its fine. I am mostly concerned about the all the heavy lifting happening in the background.

Why? What exactly are you "concerned" about? What hardware controller? Is something not working properly?

Everything is fine. This is more of a theoretical understanding.

The code is there for your theoretical research :)

Ok thanks Greg. I shall look forward to it.

Regards,
Raghavendra

-------------------------------------------------------------------------------------------------------------------------------
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]

This e-mail is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email is strictly prohibited and appropriate legal action will be taken.
-------------------------------------------------------------------------------------------------------------------------------