Commit 4e7e03c4 authored by Jeff Garzik's avatar Jeff Garzik

[libata] fix bug with READ(6) and WRITE(6) SCSI commands

Must set the LBA bit on all transfers, not just {read,write}{10,16}
scsi commands.
parent c769b6dd
...@@ -229,15 +229,14 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) ...@@ -229,15 +229,14 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
tf->hob_lbam = 0; tf->hob_lbam = 0;
tf->hob_lbah = 0; tf->hob_lbah = 0;
tf->protocol = qc->dev->xfer_protocol; tf->protocol = qc->dev->xfer_protocol;
tf->device |= ATA_LBA;
if (scsicmd[0] == READ_10 || scsicmd[0] == READ_6 || if (scsicmd[0] == READ_10 || scsicmd[0] == READ_6 ||
scsicmd[0] == READ_16) { scsicmd[0] == READ_16) {
tf->command = qc->dev->read_cmd; tf->command = qc->dev->read_cmd;
VPRINTK("reading\n");
} else { } else {
tf->command = qc->dev->write_cmd; tf->command = qc->dev->write_cmd;
tf->flags |= ATA_TFLAG_WRITE; tf->flags |= ATA_TFLAG_WRITE;
VPRINTK("writing\n");
} }
if (scsicmd[0] == READ_10 || scsicmd[0] == WRITE_10) { if (scsicmd[0] == READ_10 || scsicmd[0] == WRITE_10) {
...@@ -258,7 +257,6 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) ...@@ -258,7 +257,6 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
qc->nsect = scsicmd[8]; qc->nsect = scsicmd[8];
} }
tf->device |= ATA_LBA;
tf->nsect = scsicmd[8]; tf->nsect = scsicmd[8];
tf->lbal = scsicmd[5]; tf->lbal = scsicmd[5];
...@@ -303,7 +301,6 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) ...@@ -303,7 +301,6 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
qc->nsect = scsicmd[13]; qc->nsect = scsicmd[13];
} }
tf->device |= ATA_LBA;
tf->nsect = scsicmd[13]; tf->nsect = scsicmd[13];
tf->lbal = scsicmd[9]; tf->lbal = scsicmd[9];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment