summaryrefslogtreecommitdiff
path: root/drivers/usb/storage/scsiglue.c
diff options
context:
space:
mode:
authorTom Yan <tom.ty89@gmail.com>2020-09-03 21:17:23 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-04 18:00:38 +0300
commit0154012f8018bba4d9971d1007c12ffd48539ddb (patch)
tree974d2f048b99c7f1e435abb25d99e455ffc5c9c2 /drivers/usb/storage/scsiglue.c
parentf0dbd25f422f6abb44b6317cbf881b921741e753 (diff)
downloadlinux-0154012f8018bba4d9971d1007c12ffd48539ddb.tar.xz
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>
Diffstat (limited to 'drivers/usb/storage/scsiglue.c')
-rw-r--r--drivers/usb/storage/scsiglue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index e5a971b83e3f..560efd1479ba 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -92,7 +92,7 @@ static int slave_alloc (struct scsi_device *sdev)
static int slave_configure(struct scsi_device *sdev)
{
struct us_data *us = host_to_us(sdev->host);
- struct device *dev = us->pusb_dev->bus->sysdev;
+ struct device *dev = sdev->host->dma_dev;
/*
* Many devices have trouble transferring more than 32KB at a time,