On Thu, 3 Dec 2015, Steinar H. Gunderson wrote: > On Wed, Dec 02, 2015 at 10:54:52AM -0500, Alan Stern wrote: > >> [ 28.796244] DMAR: Allocating domain for 2-2 failed > > I don't know what the reason is for that. It may be that your kernel > > isn't configured to allocate as much coherent memory as you are asking > > for. We'll have to investigate further, maybe ask somebody who knows > > more about how the DMA subsystem works. > > I'm thinking; maybe should the memory not be allocated against the USB > device, but against the controller it hangs on? (Note that it complains about > allocating the _domain_, not the memory itself.) Do you know if that's > possible from this point in the code? Ah, I see the problem. In usb_alloc_dev(), we set the new USB device's dma_mask equal to the controller's dma_mask, but we don't set the other DMA parameters -- in particular, we don't set the coherent_dma_mask. In fact, it looks like the best approach is to use usb_alloc_coherent() and usb_free_coherent(). Unfortunately this routine doesn't zero out the memory buffer, so you'll have to keep the memset(). > FWIW, I tried against &ps->dev->bus->controller, and it didn't give me any > error messages, but still returns NULL. I'm at a loss. 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