Hi Christoph,

> Why do you want to free coherent dma allocations from irq context?
> They generally are a long-term resource that as a rule of thumb should
> be allocated in ->probe and freed in ->remove.

The device specific HCD only does dma_declare_coherent_memory (with
HCD_LOCAL_MEM) in ->probe, and dma_release_declared_memory in ->remove.

However, the generic USB core does a lot more:

https://lists.linuxfoundation.org/pipermail/iommu/2018-March/026338.html

Critically, it performs the following calls:

           usb_hcd_irq
        -> ohci_irq
        -> ohci_work
        -> process_done_list
        -> takeback_td
        -> finish_urb
        -> usb_hcd_giveback_urb
        -> __usb_hcd_giveback_urb
        -> unmap_urb_for_dma
        -> usb_hcd_unmap_urb_for_dma
        -> hcd_free_coherent
        -> hcd_buffer_free
        -> dma_free_coherent
        -> dma_free_attrs

Could this be avoided in a reasonable way?

Fredrik
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to