Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=00bd02027fc4a5cf92a3e538896b3642b40515df
Commit:     00bd02027fc4a5cf92a3e538896b3642b40515df
Parent:     453941455218a81eedcea5dbafa38b8815920a8c
Author:     Jeff Garzik <[EMAIL PROTECTED]>
AuthorDate: Fri Sep 21 07:26:08 2007 -0400
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Fri Oct 12 14:55:40 2007 -0400

    [libata] SCSI: improve FORMAT UNIT; minor code cleanups
    
    * SAT specifies that FORMAT UNIT should be translated into a series
      of READ and WRITE commands that zero the ATA device.  That is far too
      cumbersome to bother with.
    
      Since we don't actually format the device, the old behavior of
      always returning success was inaccurate.  Change FORMAT UNIT from
      returning success immediately (old behavior) to always returning
      an error (new behavior).
    
    * Add some comments around SYNCHRONIZE CACHE
    
    * Shuffle scsi command code around a bit, so that things are close
      to alphabetic order.
    
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/libata-scsi.c |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 7955090..5534880 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2920,14 +2920,9 @@ void ata_scsi_simulate(struct ata_device *dev, struct 
scsi_cmnd *cmd,
        args.done = done;
 
        switch(scsicmd[0]) {
-               /* no-op's, complete with success */
-               case SYNCHRONIZE_CACHE:
-               case REZERO_UNIT:
-               case SEEK_6:
-               case SEEK_10:
-               case TEST_UNIT_READY:
-               case FORMAT_UNIT:               /* FIXME: correct? */
-                       ata_scsi_rbuf_fill(&args, ata_scsiop_noop);
+               /* TODO: worth improving? */
+               case FORMAT_UNIT:
+                       ata_scsi_invalid_field(cmd, done);
                        break;
 
                case INQUIRY:
@@ -2985,6 +2980,20 @@ void ata_scsi_simulate(struct ata_device *dev, struct 
scsi_cmnd *cmd,
                        done(cmd);
                        break;
 
+               /* if we reach this, then writeback caching is disabled,
+                * turning this into a no-op.
+                */
+               case SYNCHRONIZE_CACHE:
+                       /* fall through */
+
+               /* no-op's, complete with success */
+               case REZERO_UNIT:
+               case SEEK_6:
+               case SEEK_10:
+               case TEST_UNIT_READY:
+                       ata_scsi_rbuf_fill(&args, ata_scsiop_noop);
+                       break;
+
                case SEND_DIAGNOSTIC:
                        tmp8 = scsicmd[1] & ~(1 << 3);
                        if ((tmp8 == 0x4) && (!scsicmd[3]) && (!scsicmd[4]))
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to