linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Kappner <agk@godking.net>
To: stern@rowland.harvard.edu, oneukum@suse.com
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	usb-storage@lists.one-eyed-alien.net, gregkh@linuxfoundation.org,
	Alexander Kappner <agk@godking.net>
Subject: [PATCH v2 1/2] usb-storage: Add support for FL_ALWAYS_SYNC flag in the UAS driver
Date: Fri, 18 May 2018 21:50:15 -0700	[thread overview]
Message-ID: <1526705416-12573-2-git-send-email-agk@godking.net> (raw)
In-Reply-To: <1526705416-12573-1-git-send-email-agk@godking.net>

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: Alexander Kappner <agk@godking.net>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@vger.kernel.org>
Acked-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/usb/storage/uas.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index 6034c39..9e9de54 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -836,6 +836,12 @@ static int uas_slave_configure(struct scsi_device *sdev)
 	if (devinfo->flags & US_FL_BROKEN_FUA)
 		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);
 	return 0;
 }
-- 
2.1.4


  reply	other threads:[~2018-05-19  4:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16 20:01 [PATCH] usb-storage: Add quirks to make G-Technology "G-Drive" work Alexander Kappner
2018-05-16 20:55 ` Alan Stern
2018-05-17  8:15   ` Alexander Kappner
2018-05-17 12:58     ` Oliver Neukum
2018-05-17 18:38       ` Alexander Kappner
2018-05-17 19:13         ` Alan Stern
2018-05-18 17:51           ` Alexander Kappner
2018-05-18 20:35             ` Alan Stern
2018-05-19  4:50               ` [PATCH v2 0/2] " Alexander Kappner
2018-05-19  4:50                 ` Alexander Kappner [this message]
2018-05-22  8:58                   ` [PATCH v2 1/2] [usb-storage] Add support for FL_ALWAYS_SYNC flag in the UAS driver Oliver Neukum
2018-05-19  4:50                 ` [PATCH v2 2/2] usb-storage: Add compatibility quirk flags for G-Technologies G-Drive Alexander Kappner
2018-05-21 17:47                 ` [PATCH v2 0/2] Re: usb-storage: Add quirks to make G-Technology "G-Drive" work Alan Stern
2018-05-22  8:57                   ` [usb-storage] " Oliver Neukum
2018-05-17 14:44     ` [usb-storage] Re: [PATCH] " Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1526705416-12573-2-git-send-email-agk@godking.net \
    --to=agk@godking.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=stern@rowland.harvard.edu \
    --cc=usb-storage@lists.one-eyed-alien.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).