Re: [PATCH v2] Add support for usbfs zerocopy.

From: Oliver Neukum
Date: Mon Jan 11 2016 - 06:10:50 EST


On Thu, 2016-01-07 at 10:40 -0500, Alan Stern wrote:
> > I understand there are some requirements on the allocation such that
> > large blocks are not always available. But what is the proper way to
> > determine the upper limit of the size such that the user can avoid
> > generating warnings like this? (Also, the application really wants
> to
> > be able to allocate large buffers, maybe tune swiotlb=?.)
>
> It's debatable whether this should have generated a warning. Why
> doesn't dma_alloc_coherent() simply fail silently?

I suspect many drivers to be unable to deal well with a failure.
Having this report makes "my device doesn't work" easier to solve
as a bug report.

Hence it seems to me that a driver which can handle a failure
with a good fallback should indicate this with a flag to the
VM layer.

Regards
Oliver