linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] scsi: fix internal write cache issue on usb hdd.
@ 2012-06-06 12:19 Namjae Jeon
  0 siblings, 0 replies; only message in thread
From: Namjae Jeon @ 2012-06-06 12:19 UTC (permalink / raw)
  To: James.Bottomley, gregkh, mdharm-usb
  Cc: linux-usb, linux-scsi, linux-kernel, Namjae Jeon

The numbers of USB HDDs(All USB HDD I checked) does not respond correctly to scsi mode sense command for retrieving the write cache page status. Even though write cache is enabled by default, due to scsi driver assume that cache is not enabled which in turn might lead to loss of data since data still will be in cache.
This result that all filesystems is not stable on USB HDD when the device is unplugged abruptly, even though these are having journaling feature.
Our first trying is that scsi driver send ATA command(ATA Pass through, #58) to USB HDD after failure from normal routine to know write cache enable.
We have known it is dangerous after testing several USB HDD. some of HDD is stalled by this command(A-DATA HDD). So we tried to make the patch James's suggestion(usb quirk) on version 2 that add product ID and verdor ID of USB HDD to USB quirk list after checking write cache.
All filesystem will be stable on USB HDD registered in quirk list. And it will be updated continuously.

	scsi: set to WCE if usb cache quirk is present.
	usb: storage: add support write cache quirk on usb hdd.
	usb: core: update usb devices for write cache quirk in quirk.

 drivers/scsi/sd.c          |    9 +++++++--
 include/scsi/scsi_device.h |    1 +
 drivers/usb/storage/scsiglue.c |    6 ++++++
 drivers/usb/storage/usb.c      |    5 ++++-
 include/linux/usb/quirks.h     |    3 +++
 include/linux/usb_usual.h      |    4 +++-
 drivers/usb/core/quirks.c |    6 ++++++
-- 
1.7.9.5

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-06 12:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-06 12:19 [PATCH 0/3] scsi: fix internal write cache issue on usb hdd Namjae Jeon

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).