summaryrefslogtreecommitdiff
path: root/drivers/usb/storage/scsiglue.c
diff options
context:
space:
mode:
authorNamjae Jeon <namjae.jeon@samsung.com>2012-07-07 23:05:28 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-07-20 08:59:00 +0100
commiteaa05dfcdb12cf3a7bedf8918dc8699c00944384 (patch)
treef05101a4a1353bbb578fa2a83634ab7404335873 /drivers/usb/storage/scsiglue.c
parentb81478d82e389dd0961760f5ff6f56b50d29db6d (diff)
[SCSI] usb-storage: add support for write cache quirk
Add support for write cache quirk on usb hdd. scsi driver will be set to wce by detecting write cache quirk in quirk list when plugging usb hdd. Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Pankaj Kumar <pankaj.km@samsung.com> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/usb/storage/scsiglue.c')
-rw-r--r--drivers/usb/storage/scsiglue.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 11418da9bc09..a3d54366afcc 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -236,6 +236,11 @@ static int slave_configure(struct scsi_device *sdev)
US_FL_SCM_MULT_TARG)) &&
us->protocol == USB_PR_BULK)
us->use_last_sector_hacks = 1;
+
+ /* Check if write cache default on flag is set or not */
+ if (us->fflags & US_FL_WRITE_CACHE)
+ sdev->wce_default_on = 1;
+
} else {
/* Non-disk-type devices don't need to blacklist any pages