]> git.baikalelectronics.ru Git - kernel.git/commit
usb-storage: fix sdev->host->dma_dev
authorTom Yan <tom.ty89@gmail.com>
Thu, 3 Sep 2020 18:17:23 +0000 (02:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Sep 2020 15:00:38 +0000 (17:00 +0200)
commit43ee50a35f9c8379c1b37cfeb5a08190e6b44275
tree974d2f048b99c7f1e435abb25d99e455ffc5c9c2
parent53c22f546c8ae044ce75e28b6987327130f03f4a
usb-storage: fix sdev->host->dma_dev

Use scsi_add_host_with_dma() instead of scsi_add_host().

When the scsi request queue is initialized/allocated, hw_max_sectors is clamped
to the dma max mapping size. Therefore, the correct device that should be used
for the clamping needs to be set.

The same clamping is still needed in usb-storage as hw_max_sectors could be
changed there. The original clamping would be invalidated in such cases.

Signed-off-by: Tom Yan <tom.ty89@gmail.com>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20200903181725.2931-1-tom.ty89@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/storage/scsiglue.c
drivers/usb/storage/usb.c