[libata scsi] verify cmd bug fixes/support
Linux Kernel Mailing List <[email protected]>
| Newsgroups | gmane.linux.kernel.commits.2-4 |
|---|---|
| Message-ID | <[email protected]> |
ChangeSet 1.1545, 2005/02/05 20:31:23-05:00, [email protected] [libata scsi] verify cmd bug fixes/support Also, trim trailing whitespace. drivers/scsi/libata-scsi.c | 27 ++++++++++++++++----------- include/linux/ata.h | 2 ++ 2 files changed, 18 insertions(+), 11 deletions(-) diff -Nru a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c --- a/drivers/scsi/libata-scsi.c 2005-02-07 13:03:50 -08:00 +++ b/drivers/scsi/libata-scsi.c 2005-02-07 13:03:50 -08:00 @@ -203,7 +203,7 @@ {0x40, MEDIUM_ERROR, 0x11, 0x04}, // Uncorrectable ECC error Unrecovered read error /* BBD - block marked bad */ {0x80, MEDIUM_ERROR, 0x11, 0x04}, // Block marked bad Medium error, unrecovered read error - {0xFF, 0xFF, 0xFF, 0xFF}, // END mark + {0xFF, 0xFF, 0xFF, 0xFF}, // END mark }; static unsigned char stat_table[][4] = { /* Must be first because BUSY means no other bits valid */ @@ -211,22 +211,22 @@ {0x20, HARDWARE_ERROR, 0x00, 0x00}, // Device fault {0x08, ABORTED_COMMAND, 0x47, 0x00}, // Timed out in xfer, fake parity for now {0x04, RECOVERED_ERROR, 0x11, 0x00}, // Recovered ECC error Medium error, recovered - {0xFF, 0xFF, 0xFF, 0xFF}, // END mark + {0xFF, 0xFF, 0xFF, 0xFF}, // END mark }; int i = 0; cmd->result = SAM_STAT_CHECK_CONDITION; - + /* * Is this an error we can process/parse */ - + if(drv_stat & ATA_ERR) /* Read the err bits */ err = ata_chk_err(qc->ap); /* Display the ATA level error info */ - + printk(KERN_WARNING "ata%u: status=0x%02x { ", qc->ap->id, drv_stat); if(drv_stat & 0x80) { @@ -243,7 +243,7 @@ if(drv_stat & 0x01) printk("Error "); } printk("}\n"); - + if(err) { printk(KERN_WARNING "ata%u: error=0x%02x { ", qc->ap->id, err); @@ -260,11 +260,11 @@ if(err & 0x02) printk("TrackZeroNotFound "); if(err & 0x01) printk("AddrMarkNotFound "); printk("}\n"); - + /* Should we dump sector info here too ?? */ } - - + + /* Look for err */ while(sense_table[i][0] != 0xFF) { @@ -302,7 +302,7 @@ /* No error ?? */ printk(KERN_ERR "ata%u: called with no error (%02X)!\n", qc->ap->id, drv_stat); /* additional-sense-code[-qualifier] */ - + sb[0] = 0x70; sb[2] = MEDIUM_ERROR; sb[7] = 0x0A; @@ -450,13 +450,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; diff -Nru a/include/linux/ata.h b/include/linux/ata.h --- a/include/linux/ata.h 2005-02-07 13:03:50 -08:00 +++ b/include/linux/ata.h 2005-02-07 13:03:50 -08: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,