Skip to content

Commit d5c65d3

Browse files
committed
Revert "uas: fix sdev->host->dma_dev"
This reverts commit 558033c as Hans reports it causes problems on some systems. Until a "real" fix for this can be found, revert this change to get normal functionality back. Link: https://lore.kernel.org/r/70ca74c2-4a80-e25b-eca9-a63a75516673@redhat.com Cc: Tom Yan <tom.ty89@gmail.com> Cc: Alan Stern <stern@rowland.harvard.edu> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent da881de commit d5c65d3

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

drivers/usb/storage/uas.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -837,22 +837,17 @@ static int uas_slave_alloc(struct scsi_device *sdev)
837837
*/
838838
blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1));
839839

840+
if (devinfo->flags & US_FL_MAX_SECTORS_64)
841+
blk_queue_max_hw_sectors(sdev->request_queue, 64);
842+
else if (devinfo->flags & US_FL_MAX_SECTORS_240)
843+
blk_queue_max_hw_sectors(sdev->request_queue, 240);
844+
840845
return 0;
841846
}
842847

843848
static int uas_slave_configure(struct scsi_device *sdev)
844849
{
845850
struct uas_dev_info *devinfo = sdev->hostdata;
846-
struct device *dev = sdev->host->dma_dev;
847-
848-
if (devinfo->flags & US_FL_MAX_SECTORS_64)
849-
blk_queue_max_hw_sectors(sdev->request_queue, 64);
850-
else if (devinfo->flags & US_FL_MAX_SECTORS_240)
851-
blk_queue_max_hw_sectors(sdev->request_queue, 240);
852-
853-
blk_queue_max_hw_sectors(sdev->request_queue,
854-
min_t(size_t, queue_max_hw_sectors(sdev->request_queue),
855-
dma_max_mapping_size(dev) >> SECTOR_SHIFT));
856851

857852
if (devinfo->flags & US_FL_NO_REPORT_OPCODES)
858853
sdev->no_report_opcodes = 1;
@@ -1038,7 +1033,7 @@ static int uas_probe(struct usb_interface *intf, const struct usb_device_id *id)
10381033
shost->can_queue = devinfo->qdepth - 2;
10391034

10401035
usb_set_intfdata(intf, shost);
1041-
result = scsi_add_host_with_dma(shost, &intf->dev, udev->bus->sysdev);
1036+
result = scsi_add_host(shost, &intf->dev);
10421037
if (result)
10431038
goto free_streams;
10441039

0 commit comments

Comments
 (0)