@@ -569,6 +569,7 @@ int ast_vhub_init_dev(struct ast_vhub *vhub, unsigned int idx)device_initialize(d->port_dev);d->port_dev->release=ast_vhub_dev_release;d->port_dev->parent=parent;+d->port_dev->dma_mask=parent->dma_mask;
This might happen to work out, but is far from correct. Just wait until
you try it on a platform where the USB controller is behind an IOMMU...
It looks like something is more fundamentally wrong here - the device
passed to DMA API calls must be the actual hardware device performing
the DMA, which in USB-land I believe means the controller's sysdev.
Robin.
From: Christoph Hellwig <hch@lst.de> Date: 2021-03-26 12:06:15
On Fri, Mar 26, 2021 at 12:03:03PM +0000, Robin Murphy wrote:
This might happen to work out, but is far from correct. Just wait until you
try it on a platform where the USB controller is behind an IOMMU...
It looks like something is more fundamentally wrong here - the device
passed to DMA API calls must be the actual hardware device performing the
DMA, which in USB-land I believe means the controller's sysdev.
The shiny new usb_intf_get_dma_device API provides the device to use.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On Fri, Mar 26, 2021 at 01:05:26PM +0100, Christoph Hellwig wrote:
On Fri, Mar 26, 2021 at 12:03:03PM +0000, Robin Murphy wrote:
quoted
This might happen to work out, but is far from correct. Just wait until you
try it on a platform where the USB controller is behind an IOMMU...
It looks like something is more fundamentally wrong here - the device
passed to DMA API calls must be the actual hardware device performing the
DMA, which in USB-land I believe means the controller's sysdev.
The shiny new usb_intf_get_dma_device API provides the device to use.
Thanks Robin and Christoph for the feedback.
If I understand correctly, usb_intf_get_dma_device API is mainly for usb
host drivers? I just found usb_gadget_map_request_by_dev API: does it
make sense to replace usb_gadget_map_request with
usb_gadget_map_request_by_dev so we can pass the actual DMA-capable
hardware device (aspeed-vhub platform device) to the API?
Cheers,
Tao
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Christoph Hellwig <hch@lst.de> Date: 2021-03-29 06:18:32
On Sat, Mar 27, 2021 at 03:17:59PM -0700, Tao Ren wrote:
On Fri, Mar 26, 2021 at 01:05:26PM +0100, Christoph Hellwig wrote:
quoted
On Fri, Mar 26, 2021 at 12:03:03PM +0000, Robin Murphy wrote:
quoted
This might happen to work out, but is far from correct. Just wait until you
try it on a platform where the USB controller is behind an IOMMU...
It looks like something is more fundamentally wrong here - the device
passed to DMA API calls must be the actual hardware device performing the
DMA, which in USB-land I believe means the controller's sysdev.
The shiny new usb_intf_get_dma_device API provides the device to use.
Thanks Robin and Christoph for the feedback.
If I understand correctly, usb_intf_get_dma_device API is mainly for usb
host drivers? I just found usb_gadget_map_request_by_dev API: does it
make sense to replace usb_gadget_map_request with
usb_gadget_map_request_by_dev so we can pass the actual DMA-capable
hardware device (aspeed-vhub platform device) to the API?
Oh, right you're dealing with a gadget side driver. Not sure about
the API there, I'll let the relevant maintainers chime in.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On Mon, Mar 29, 2021 at 08:17:35AM +0200, Christoph Hellwig wrote:
On Sat, Mar 27, 2021 at 03:17:59PM -0700, Tao Ren wrote:
quoted
On Fri, Mar 26, 2021 at 01:05:26PM +0100, Christoph Hellwig wrote:
quoted
On Fri, Mar 26, 2021 at 12:03:03PM +0000, Robin Murphy wrote:
quoted
This might happen to work out, but is far from correct. Just wait until you
try it on a platform where the USB controller is behind an IOMMU...
It looks like something is more fundamentally wrong here - the device
passed to DMA API calls must be the actual hardware device performing the
DMA, which in USB-land I believe means the controller's sysdev.
The shiny new usb_intf_get_dma_device API provides the device to use.
Thanks Robin and Christoph for the feedback.
If I understand correctly, usb_intf_get_dma_device API is mainly for usb
host drivers? I just found usb_gadget_map_request_by_dev API: does it
make sense to replace usb_gadget_map_request with
usb_gadget_map_request_by_dev so we can pass the actual DMA-capable
hardware device (aspeed-vhub platform device) to the API?
Oh, right you're dealing with a gadget side driver. Not sure about
the API there, I'll let the relevant maintainers chime in.
Given this is not the right path, I will drop the patch and work out a
new fix soon (by calling usb_gadget_map_request_by_dev, and with
modified subject).
Cheers,
Tao
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel