Commit c839680e authored by Alexander Kappner's avatar Alexander Kappner Committed by Greg Kroah-Hartman

usb-storage: Add support for FL_ALWAYS_SYNC flag in the UAS driver

commit 8c4e97dd upstream.

The ALWAYS_SYNC flag is currently honored by the usb-storage driver but not UAS
and is required to work around devices that become unstable upon being
queried for cache. This code is taken straight from:
drivers/usb/storage/scsiglue.c:284
Signed-off-by: default avatarAlexander Kappner <agk@godking.net>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@vger.kernel.org>
Acked-by: default avatarOliver Neukum <oneukum@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f31eb729
...@@ -836,6 +836,12 @@ static int uas_slave_configure(struct scsi_device *sdev) ...@@ -836,6 +836,12 @@ static int uas_slave_configure(struct scsi_device *sdev)
if (devinfo->flags & US_FL_BROKEN_FUA) if (devinfo->flags & US_FL_BROKEN_FUA)
sdev->broken_fua = 1; sdev->broken_fua = 1;
/* UAS also needs to support FL_ALWAYS_SYNC */
if (devinfo->flags & US_FL_ALWAYS_SYNC) {
sdev->skip_ms_page_3f = 1;
sdev->skip_ms_page_8 = 1;
sdev->wce_default_on = 1;
}
scsi_change_queue_depth(sdev, devinfo->qdepth - 2); scsi_change_queue_depth(sdev, devinfo->qdepth - 2);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment