diff options
-rw-r--r-- | drivers/ata/libata-eh.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index c89664a77a9c..39f556c02992 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -982,26 +982,27 @@ static int ata_eh_read_log_10h(struct ata_device *dev, | |||
982 | * RETURNS: | 982 | * RETURNS: |
983 | * 0 on success, AC_ERR_* mask on failure | 983 | * 0 on success, AC_ERR_* mask on failure |
984 | */ | 984 | */ |
985 | static unsigned int atapi_eh_request_sense(struct ata_device *dev, | 985 | static unsigned int atapi_eh_request_sense(struct ata_queued_cmd *qc) |
986 | unsigned char *sense_buf) | ||
987 | { | 986 | { |
987 | struct ata_device *dev = qc->dev; | ||
988 | unsigned char *sense_buf = qc->scsicmd->sense_buffer; | ||
988 | struct ata_port *ap = dev->ap; | 989 | struct ata_port *ap = dev->ap; |
989 | struct ata_taskfile tf; | 990 | struct ata_taskfile tf; |
990 | u8 cdb[ATAPI_CDB_LEN]; | 991 | u8 cdb[ATAPI_CDB_LEN]; |
991 | 992 | ||
992 | DPRINTK("ATAPI request sense\n"); | 993 | DPRINTK("ATAPI request sense\n"); |
993 | 994 | ||
994 | ata_tf_init(dev, &tf); | ||
995 | |||
996 | /* FIXME: is this needed? */ | 995 | /* FIXME: is this needed? */ |
997 | memset(sense_buf, 0, SCSI_SENSE_BUFFERSIZE); | 996 | memset(sense_buf, 0, SCSI_SENSE_BUFFERSIZE); |
998 | 997 | ||
999 | /* XXX: why tf_read here? */ | 998 | /* initialize sense_buf with the error register, |
1000 | ap->ops->tf_read(ap, &tf); | 999 | * for the case where they are -not- overwritten |
1001 | 1000 | */ | |
1002 | /* fill these in, for the case where they are -not- overwritten */ | ||
1003 | sense_buf[0] = 0x70; | 1001 | sense_buf[0] = 0x70; |
1004 | sense_buf[2] = tf.feature >> 4; | 1002 | sense_buf[2] = qc->result_tf.feature >> 4; |
1003 | |||
1004 | /* some devices time out if garbage left in tf */ | ||
1005 | ata_tf_init(dev, &tf); | ||
1005 | 1006 | ||
1006 | memset(cdb, 0, ATAPI_CDB_LEN); | 1007 | memset(cdb, 0, ATAPI_CDB_LEN); |
1007 | cdb[0] = REQUEST_SENSE; | 1008 | cdb[0] = REQUEST_SENSE; |
@@ -1165,8 +1166,7 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc, | |||
1165 | 1166 | ||
1166 | case ATA_DEV_ATAPI: | 1167 | case ATA_DEV_ATAPI: |
1167 | if (!(qc->ap->pflags & ATA_PFLAG_FROZEN)) { | 1168 | if (!(qc->ap->pflags & ATA_PFLAG_FROZEN)) { |
1168 | tmp = atapi_eh_request_sense(qc->dev, | 1169 | tmp = atapi_eh_request_sense(qc); |
1169 | qc->scsicmd->sense_buffer); | ||
1170 | if (!tmp) { | 1170 | if (!tmp) { |
1171 | /* ATA_QCFLAG_SENSE_VALID is used to | 1171 | /* ATA_QCFLAG_SENSE_VALID is used to |
1172 | * tell atapi_qc_complete() that sense | 1172 | * tell atapi_qc_complete() that sense |