Re: [PATCH 3/3] dma-mapping: introduce DMA range map, supplanting dma_pfn_offset

From: Christoph Hellwig
Date: Thu Sep 10 2020 - 05:14:51 EST


On Thu, Sep 10, 2020 at 09:53:51AM +0200, Greg KH wrote:
> > /*
> > * Please refer to usb_alloc_dev() to see why we set
> > - * dma_mask and dma_pfn_offset.
> > + * dma_mask and dma_range_map.
> > */
> > intf->dev.dma_mask = dev->dev.dma_mask;
> > - intf->dev.dma_pfn_offset = dev->dev.dma_pfn_offset;
> > + if (dma_direct_copy_range_map(&intf->dev, &dev->dev))
> > + dev_err(&dev->dev, "failed to copy DMA map\n");
>
> We tell the user, but then just keep on running? Is there anything that
> we can do here?
>
> If not, why not have dma_direct_copy_range_map() print out the error?

At least for USB I'm pretty sure this isn't required at all. I've been
running with the patch below on my desktop for two days now trying all
the usb toys I have (in addition to grepping for obvious abuses in
the drivers). remoteproc is a different story, but the DMA handling
seems there is sketchy to start with..

---