Re: [PATCH 2/2] usb-storage: revert from scsi_add_host_with_dma() to scsi_add_host()

From: Christoph Hellwig
Date: Mon Nov 30 2020 - 12:24:46 EST


On Mon, Nov 30, 2020 at 12:20:04PM -0500, Alan Stern wrote:
> > https://lore.kernel.org/linux-usb/fde7e11f-5dfc-8348-c134-a21cb1116285@xxxxxxxxxx/T/#t
>
> It's hard to go wrong with reverting, so it's okay with me.
>
> Still, Hans, have you checked out the difference between the
> scsi_add_host() and scsi_add_host_with_dma() calls? It's just a matter
> of using dev vs. sysdev. In particular, have you checked to see what
> those two devices are on your system?
>
> It seems likely that if one of those calls messes up some DMA settings,
> the other one does too -- just maybe not settings that matter much.

The effects from scsi_add_host_with_dma should be:

(1) picking which device is used for the SCSI dma map helpers
(2) use dma_max_mapping_size() to limite the I/O size

The helpers affected by (1) are not used by UAS (or usb-storage for that
matter), while we do have a real bug in the intel-iommu with bounce
buffering implementation used in the bug report. So my clear bet is on
(2) not limiting the size, but the patch that would have fixed this
did not make a different for Hans, which leaves me a little confused.