* RE: PATCH for disabling write cache on SATA drives
@ 2004-06-29 19:19 Edwards, Scott (MED, Kelly IT Resouces)
2004-06-30 3:03 ` Jeff Garzik
0 siblings, 1 reply; 5+ messages in thread
From: Edwards, Scott (MED, Kelly IT Resouces) @ 2004-06-29 19:19 UTC (permalink / raw)
To: 'Jeff Garzik'
Cc: 'linux-scsi@vger.kernel.org', linux-ide,
'sedwards@xmission.com'
On Monday, June 28, 2004 at 6:12 PM, Jeff Garzik wrote:
> On Fri, Jun 25, 2004 at 06:21:24PM -0500, Edwards, Scott (MED, Kelly
IT Resouces) wrote:
>>
>> I don't know if this is useful for anyone or if anyone even cares,
but just
>> in case someone does, this is the patch I made to disable the write
cache on
>> the Serial ATA drives. It doesn't make the write cache controllable
from
>> the user level, it just ALWAYS disables it. (I tried to make one
that could
>> be sent via an ioctl, but there were far too many things that I
didn't
>> understand and it didn't work.) Since I have never done this before
I don't
>> know if there is some protocol that I missed, if so I'm sorry. If
there are
>> glaring stupid mistakes (very likely) please let me know.
>
> In principle your patch is fine, but I would really like to find a
> better way of allowing the user to do this.
>
> My immediate guess would be to use the standard SCSI method of
disabling
> write cache, and have that initiate wbcache disable on the SATA side.
>
> Long term, this would be augmented by an "ATA passthru" opcode or
ioctl.
>
> Jeff
I first tried to make a real scsi ioctl command in libata-scsi.c, so I
could just use the scsiinfo program to disable the write cache. I made
a xlat_mode_select command but it didn't work and management didn't want
me
spending more time trying to figure it out. And really for it to work
correctly there would have to be a xlat_mode_sense because now it is
just
simulated (in ata_scsi_simulate).
I'm willing to work on it on my own time as soon as I get a SATA drive,
if someone would be willing to advise me on how to send the ATA commands
to the drive (I think this is where it failed before).
Thanks
-Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PATCH for disabling write cache on SATA drives
2004-06-29 19:19 PATCH for disabling write cache on SATA drives Edwards, Scott (MED, Kelly IT Resouces)
@ 2004-06-30 3:03 ` Jeff Garzik
2004-06-30 3:47 ` J. Scott Edwards
0 siblings, 1 reply; 5+ messages in thread
From: Jeff Garzik @ 2004-06-30 3:03 UTC (permalink / raw)
To: Edwards, Scott (MED, Kelly IT Resouces)
Cc: 'linux-scsi@vger.kernel.org', linux-ide,
'sedwards@xmission.com'
Edwards, Scott (MED, Kelly IT Resouces) wrote:
> On Monday, June 28, 2004 at 6:12 PM, Jeff Garzik wrote:
>
>
>>On Fri, Jun 25, 2004 at 06:21:24PM -0500, Edwards, Scott (MED, Kelly
>
> IT Resouces) wrote:
>
>>>I don't know if this is useful for anyone or if anyone even cares,
>
> but just
>
>>>in case someone does, this is the patch I made to disable the write
>
> cache on
>
>>>the Serial ATA drives. It doesn't make the write cache controllable
>
> from
>
>>>the user level, it just ALWAYS disables it. (I tried to make one
>
> that could
>
>>>be sent via an ioctl, but there were far too many things that I
>
> didn't
>
>>>understand and it didn't work.) Since I have never done this before
>
> I don't
>
>>>know if there is some protocol that I missed, if so I'm sorry. If
>
> there are
>
>>>glaring stupid mistakes (very likely) please let me know.
>>
>>In principle your patch is fine, but I would really like to find a
>>better way of allowing the user to do this.
>>
>>My immediate guess would be to use the standard SCSI method of
>
> disabling
>
>>write cache, and have that initiate wbcache disable on the SATA side.
>>
>>Long term, this would be augmented by an "ATA passthru" opcode or
>
> ioctl.
>
>> Jeff
>
>
> I first tried to make a real scsi ioctl command in libata-scsi.c, so I
> could just use the scsiinfo program to disable the write cache. I made
> a xlat_mode_select command but it didn't work and management didn't want
> me
> spending more time trying to figure it out. And really for it to work
> correctly there would have to be a xlat_mode_sense because now it is
> just
> simulated (in ata_scsi_simulate).
>
> I'm willing to work on it on my own time as soon as I get a SATA drive,
> if someone would be willing to advise me on how to send the ATA commands
> to the drive (I think this is where it failed before).
Basically, it involves the translation of MODE SELECT, something I've
been meaning to add, but is low priority. If you wanted to work on
that, that would be quite useful.
The following is a proposal for translating ATA to SCSI:
http://www.t10.org/ftp/t10/document.04/04-196r0.pdf
In that proposal, it describes the use of MODE SELECT Caching Mode Page
(8h).
Note that, in addition to actually issuing the SET FEATURES command, to
disable/enable writeback caching, you must update libata's internal copy
of the IDENTIFY DEVICE page. This involves either re-issuing IDENTIFY
DEVICE (difficult), or simply updating the 'enabled' bit in the
internally cached data (easy).
Jeff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PATCH for disabling write cache on SATA drives
2004-06-30 3:03 ` Jeff Garzik
@ 2004-06-30 3:47 ` J. Scott Edwards
2004-06-30 3:55 ` Jeff Garzik
0 siblings, 1 reply; 5+ messages in thread
From: J. Scott Edwards @ 2004-06-30 3:47 UTC (permalink / raw)
To: Jeff Garzik; +Cc: 'linux-scsi@vger.kernel.org', linux-ide
Jeff Garzik wrote:
>
> Basically, it involves the translation of MODE SELECT, something I've been
> meaning to add, but is low priority. If you wanted to work on that, that
> would be quite useful.
This is what I did, but now I'm not sure if I still have the code. We had
a couple of discs get trashed during testing. I hope the code wasn't on
one of them. ;-) I can probably do it again anyway.
> The following is a proposal for translating ATA to SCSI:
> http://www.t10.org/ftp/t10/document.04/04-196r0.pdf
>
> In that proposal, it describes the use of MODE SELECT Caching Mode Page (8h).
I will give it a look, some nice bedtime reading :)
> Note that, in addition to actually issuing the SET FEATURES command, to
> disable/enable writeback caching, you must update libata's internal copy of
> the IDENTIFY DEVICE page. This involves either re-issuing IDENTIFY DEVICE
> (difficult), or simply updating the 'enabled' bit in the internally cached
> data (easy).
>
I have already given this some thought. I agree that re-issuing the
IDENTIFY DEVICE would be difficult, but I would feel more confident that
the SET FEATURES actually worked if it was read back. Maybe I could do it
in two stages, do the easy one first and just update the cached data.
Then later wrestle with re-issuing the IDENTIFY DEVICE?
If I'm not installing my server this weekend I will buy a SATA drive and
take a shot at it again. If I end up installing the server this weekend
it will be a couple of weeks before I will have time (we are moving).
Thanks
-Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PATCH for disabling write cache on SATA drives
2004-06-30 3:47 ` J. Scott Edwards
@ 2004-06-30 3:55 ` Jeff Garzik
0 siblings, 0 replies; 5+ messages in thread
From: Jeff Garzik @ 2004-06-30 3:55 UTC (permalink / raw)
To: J. Scott Edwards; +Cc: 'linux-scsi@vger.kernel.org', linux-ide
J. Scott Edwards wrote:
> I have already given this some thought. I agree that re-issuing the
> IDENTIFY DEVICE would be difficult, but I would feel more confident that
> the SET FEATURES actually worked if it was read back. Maybe I could do
> it in two stages, do the easy one first and just update the cached data.
> Then later wrestle with re-issuing the IDENTIFY DEVICE?
I would definitely suggest two stages, as I haven't yet added the
infrastructure to re-issue commands (such as IDENTIFY DEVICE) yet :)
Jeff
^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <1F6D1D1660975A4887628A011443A1BC07734BF9@uswaumsx13medge.med.ge.com>]
* Re: PATCH for disabling write cache on SATA drives
[not found] <1F6D1D1660975A4887628A011443A1BC07734BF9@uswaumsx13medge.med.ge.com>
@ 2004-06-29 0:12 ` Jeff Garzik
0 siblings, 0 replies; 5+ messages in thread
From: Jeff Garzik @ 2004-06-29 0:12 UTC (permalink / raw)
To: Edwards, Scott (MED, Kelly IT Resouces)
Cc: 'linux-scsi@vger.kernel.org', linux-ide
On Fri, Jun 25, 2004 at 06:21:24PM -0500, Edwards, Scott (MED, Kelly IT Resouces) wrote:
>
> I don't know if this is useful for anyone or if anyone even cares, but just
> in case someone does, this is the patch I made to disable the write cache on
> the Serial ATA drives. It doesn't make the write cache controllable from
> the user level, it just ALWAYS disables it. (I tried to make one that could
> be sent via an ioctl, but there were far too many things that I didn't
> understand and it didn't work.) Since I have never done this before I don't
> know if there is some protocol that I missed, if so I'm sorry. If there are
> glaring stupid mistakes (very likely) please let me know.
In principle your patch is fine, but I would really like to find a
better way of allowing the user to do this.
My immediate guess would be to use the standard SCSI method of disabling
write cache, and have that initiate wbcache disable on the SATA side.
Long term, this would be augmented by an "ATA passthru" opcode or ioctl.
Jeff
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-06-30 3:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-29 19:19 PATCH for disabling write cache on SATA drives Edwards, Scott (MED, Kelly IT Resouces)
2004-06-30 3:03 ` Jeff Garzik
2004-06-30 3:47 ` J. Scott Edwards
2004-06-30 3:55 ` Jeff Garzik
[not found] <1F6D1D1660975A4887628A011443A1BC07734BF9@uswaumsx13medge.med.ge.com>
2004-06-29 0:12 ` Jeff Garzik
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).