linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libata-dev-2.6: verify cmd bug fixes/support
@ 2005-02-02  0:34 Brett Russ
  2005-02-02  3:33 ` Jeff Garzik
  0 siblings, 1 reply; 4+ messages in thread
From: Brett Russ @ 2005-02-02  0:34 UTC (permalink / raw)
  To: linux-ide

Below find a patch which gets the read verify command working.  Note 
that in order to get this 100% working one also needs to apply Albert 
Lee's patch:
http://article.gmane.org/gmane.linux.ide/2798
to libata* before or after this.  I've stripped out his portion of the 
changes because I can't sign off on his work.

This work was verified using a SATA bus analyzer and the sg_verify 
utility which sends VERIFY_10.  Should libata support VERIFY_12?

Signed-off-by: Brett Russ <russb@emc.com>

===== drivers/scsi/libata-scsi.c 1.68 vs edited =====
--- 1.68/drivers/scsi/libata-scsi.c     2004-12-29 02:35:53 -05:00
+++ edited/drivers/scsi/libata-scsi.c   2005-02-01 19:26:55 -05:00
@@ -741,13 +741,18 @@
         }

         if (lba48) {
+               tf->command = ATA_CMD_VERIFY_EXT;
+
                 tf->hob_nsect = (n_sect >> 8) & 0xff;

                 tf->hob_lbah = (sect >> 40) & 0xff;
                 tf->hob_lbam = (sect >> 32) & 0xff;
                 tf->hob_lbal = (sect >> 24) & 0xff;
-       } else
+       } else {
+               tf->command = ATA_CMD_VERIFY;
+
                 tf->device |= (sect >> 24) & 0xf;
+       }

         tf->nsect = n_sect & 0xff;

===== include/linux/ata.h 1.20 vs edited =====
--- 1.20/include/linux/ata.h    2004-11-14 03:21:22 -05:00
+++ edited/include/linux/ata.h  2005-02-01 16:28:09 -05:00
@@ -123,6 +123,9 @@
         ATA_CMD_PIO_WRITE_EXT   = 0x34,
         ATA_CMD_SET_FEATURES    = 0xEF,
         ATA_CMD_PACKET          = 0xA0,
+       ATA_CMD_VERIFY          = 0x40,
+       ATA_CMD_VERIFY_EXT      = 0x42,
+

         /* SETFEATURES stuff */
         SETFEATURES_XFER        = 0x03,

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libata-dev-2.6: verify cmd bug fixes/support
  2005-02-02  0:34 [PATCH] libata-dev-2.6: verify cmd bug fixes/support Brett Russ
@ 2005-02-02  3:33 ` Jeff Garzik
  2005-02-02 13:19   ` [PATCH] libata-2.6: " Brett Russ
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2005-02-02  3:33 UTC (permalink / raw)
  To: Brett Russ; +Cc: linux-ide

Brett Russ wrote:
> Below find a patch which gets the read verify command working.  Note 
> that in order to get this 100% working one also needs to apply Albert 
> Lee's patch:
> http://article.gmane.org/gmane.linux.ide/2798
> to libata* before or after this.  I've stripped out his portion of the 
> changes because I can't sign off on his work.
> 
> This work was verified using a SATA bus analyzer and the sg_verify 
> utility which sends VERIFY_10.  Should libata support VERIFY_12?

Unless there is some major application which needs _12 variants, I would 
prefer to avoid implementing them.

I want libata-scsi.c to be compatible with the upcoming T10 "SAT" 
specification, but I also wish to avoid translations which are rarely 
used (keeps the code small).


> ===== drivers/scsi/libata-scsi.c 1.68 vs edited =====
> --- 1.68/drivers/scsi/libata-scsi.c     2004-12-29 02:35:53 -05:00
> +++ edited/drivers/scsi/libata-scsi.c   2005-02-01 19:26:55 -05:00
> @@ -741,13 +741,18 @@
>         }
> 
>         if (lba48) {
> +               tf->command = ATA_CMD_VERIFY_EXT;
> +
>                 tf->hob_nsect = (n_sect >> 8) & 0xff;
> 
>                 tf->hob_lbah = (sect >> 40) & 0xff;
>                 tf->hob_lbam = (sect >> 32) & 0xff;
>                 tf->hob_lbal = (sect >> 24) & 0xff;
> -       } else
> +       } else {
> +               tf->command = ATA_CMD_VERIFY;
> +
>                 tf->device |= (sect >> 24) & 0xf;
> +       }
> 
>         tf->nsect = n_sect & 0xff;
> 
> ===== include/linux/ata.h 1.20 vs edited =====
> --- 1.20/include/linux/ata.h    2004-11-14 03:21:22 -05:00
> +++ edited/include/linux/ata.h  2005-02-01 16:28:09 -05:00
> @@ -123,6 +123,9 @@
>         ATA_CMD_PIO_WRITE_EXT   = 0x34,
>         ATA_CMD_SET_FEATURES    = 0xEF,
>         ATA_CMD_PACKET          = 0xA0,
> +       ATA_CMD_VERIFY          = 0x40,
> +       ATA_CMD_VERIFY_EXT      = 0x42,

Your patch looks good, and I tried to apply it, but apparently your 
mailer turned all tabs into spaces.  Can you resend?

	Jeff




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libata-2.6: verify cmd bug fixes/support
  2005-02-02  3:33 ` Jeff Garzik
@ 2005-02-02 13:19   ` Brett Russ
  2005-02-06  1:31     ` Jeff Garzik
  0 siblings, 1 reply; 4+ messages in thread
From: Brett Russ @ 2005-02-02 13:19 UTC (permalink / raw)
  To: linux-ide

[-- Attachment #1: Type: text/plain, Size: 301 bytes --]

Below is a resend of a patch which gets the read verify command working. 
  I moved the patch to the libata-2.6 tree since that seems to be where 
Albert's patch ended up, so let's keep them together.  Sending as an 
attachment to avoid mailer interference.

Signed-off-by: Brett Russ <russb@emc.com>

[-- Attachment #2: libata-2.6.10-rc2-verify.diff --]
[-- Type: text/x-patch, Size: 933 bytes --]

===== drivers/scsi/libata-scsi.c 1.63 vs edited =====
--- 1.63/drivers/scsi/libata-scsi.c	2005-02-01 22:24:53 -05:00
+++ edited/drivers/scsi/libata-scsi.c	2005-02-02 08:03:50 -05:00
@@ -488,13 +488,18 @@
 	}
 
 	if (lba48) {
+		tf->command = ATA_CMD_VERIFY_EXT;
+
 		tf->hob_nsect = (n_sect >> 8) & 0xff;
 
 		tf->hob_lbah = (sect >> 40) & 0xff;
 		tf->hob_lbam = (sect >> 32) & 0xff;
 		tf->hob_lbal = (sect >> 24) & 0xff;
-	} else
+	} else {
+		tf->command = ATA_CMD_VERIFY;
+
 		tf->device |= (sect >> 24) & 0xf;
+	}
 
 	tf->nsect = n_sect & 0xff;
 
===== include/linux/ata.h 1.21 vs edited =====
--- 1.21/include/linux/ata.h	2004-11-06 13:44:16 -05:00
+++ edited/include/linux/ata.h	2005-02-02 08:15:49 -05:00
@@ -123,6 +123,8 @@
 	ATA_CMD_PIO_WRITE_EXT	= 0x34,
 	ATA_CMD_SET_FEATURES	= 0xEF,
 	ATA_CMD_PACKET		= 0xA0,
+	ATA_CMD_VERIFY		= 0x40,
+	ATA_CMD_VERIFY_EXT	= 0x42,
 
 	/* SETFEATURES stuff */
 	SETFEATURES_XFER	= 0x03,

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libata-2.6: verify cmd bug fixes/support
  2005-02-02 13:19   ` [PATCH] libata-2.6: " Brett Russ
@ 2005-02-06  1:31     ` Jeff Garzik
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2005-02-06  1:31 UTC (permalink / raw)
  To: Brett Russ; +Cc: linux-ide

Brett Russ wrote:
> Below is a resend of a patch which gets the read verify command working. 
>  I moved the patch to the libata-2.6 tree since that seems to be where 
> Albert's patch ended up, so let's keep them together.  Sending as an 
> attachment to avoid mailer interference.
> 
> Signed-off-by: Brett Russ <russb@emc.com>

applied, thanks



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-02-06  1:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-02  0:34 [PATCH] libata-dev-2.6: verify cmd bug fixes/support Brett Russ
2005-02-02  3:33 ` Jeff Garzik
2005-02-02 13:19   ` [PATCH] libata-2.6: " Brett Russ
2005-02-06  1:31     ` 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).