Commit d5c65d32 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Revert "uas: fix sdev->host->dma_dev"

This reverts commit 558033c2 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: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent da881ded
Loading
Loading
Loading
Loading
+6 −11
Original line number Diff line number Diff line
@@ -837,22 +837,17 @@ static int uas_slave_alloc(struct scsi_device *sdev)
	 */
	blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1));

	if (devinfo->flags & US_FL_MAX_SECTORS_64)
		blk_queue_max_hw_sectors(sdev->request_queue, 64);
	else if (devinfo->flags & US_FL_MAX_SECTORS_240)
		blk_queue_max_hw_sectors(sdev->request_queue, 240);

	return 0;
}

static int uas_slave_configure(struct scsi_device *sdev)
{
	struct uas_dev_info *devinfo = sdev->hostdata;
	struct device *dev = sdev->host->dma_dev;

	if (devinfo->flags & US_FL_MAX_SECTORS_64)
		blk_queue_max_hw_sectors(sdev->request_queue, 64);
	else if (devinfo->flags & US_FL_MAX_SECTORS_240)
		blk_queue_max_hw_sectors(sdev->request_queue, 240);

	blk_queue_max_hw_sectors(sdev->request_queue,
		min_t(size_t, queue_max_hw_sectors(sdev->request_queue),
		      dma_max_mapping_size(dev) >> SECTOR_SHIFT));

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

	usb_set_intfdata(intf, shost);
	result = scsi_add_host_with_dma(shost, &intf->dev, udev->bus->sysdev);
	result = scsi_add_host(shost, &intf->dev);
	if (result)
		goto free_streams;