diff options
-rw-r--r-- | drivers/scsi/libata-core.c | 6 | ||||
-rw-r--r-- | drivers/scsi/libata-scsi.c | 12 |
2 files changed, 11 insertions, 7 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index f731bbdd4236..d568914c4344 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -3131,14 +3131,14 @@ void ata_eng_timeout(struct ata_port *ap) | |||
3131 | DPRINTK("ENTER\n"); | 3131 | DPRINTK("ENTER\n"); |
3132 | 3132 | ||
3133 | qc = ata_qc_from_tag(ap, ap->active_tag); | 3133 | qc = ata_qc_from_tag(ap, ap->active_tag); |
3134 | if (!qc) { | 3134 | if (qc) |
3135 | ata_qc_timeout(qc); | ||
3136 | else { | ||
3135 | printk(KERN_ERR "ata%u: BUG: timeout without command\n", | 3137 | printk(KERN_ERR "ata%u: BUG: timeout without command\n", |
3136 | ap->id); | 3138 | ap->id); |
3137 | goto out; | 3139 | goto out; |
3138 | } | 3140 | } |
3139 | 3141 | ||
3140 | ata_qc_timeout(qc); | ||
3141 | |||
3142 | out: | 3142 | out: |
3143 | DPRINTK("EXIT\n"); | 3143 | DPRINTK("EXIT\n"); |
3144 | } | 3144 | } |
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index c58a7a19780f..1c3a10fb3c44 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c | |||
@@ -225,7 +225,7 @@ void ata_to_sense_error(struct ata_queued_cmd *qc, u8 drv_stat) | |||
225 | }; | 225 | }; |
226 | int i = 0; | 226 | int i = 0; |
227 | 227 | ||
228 | cmd->result = SAM_STAT_CHECK_CONDITION; | 228 | cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; |
229 | 229 | ||
230 | /* | 230 | /* |
231 | * Is this an error we can process/parse | 231 | * Is this an error we can process/parse |
@@ -1468,7 +1468,7 @@ unsigned int ata_scsiop_report_luns(struct ata_scsi_args *args, u8 *rbuf, | |||
1468 | void ata_scsi_badcmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), u8 asc, u8 ascq) | 1468 | void ata_scsi_badcmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), u8 asc, u8 ascq) |
1469 | { | 1469 | { |
1470 | DPRINTK("ENTER\n"); | 1470 | DPRINTK("ENTER\n"); |
1471 | cmd->result = SAM_STAT_CHECK_CONDITION; | 1471 | cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; |
1472 | 1472 | ||
1473 | cmd->sense_buffer[0] = 0x70; | 1473 | cmd->sense_buffer[0] = 0x70; |
1474 | cmd->sense_buffer[2] = ILLEGAL_REQUEST; | 1474 | cmd->sense_buffer[2] = ILLEGAL_REQUEST; |
@@ -1529,8 +1529,11 @@ static int atapi_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat) | |||
1529 | { | 1529 | { |
1530 | struct scsi_cmnd *cmd = qc->scsicmd; | 1530 | struct scsi_cmnd *cmd = qc->scsicmd; |
1531 | 1531 | ||
1532 | VPRINTK("ENTER, drv_stat == 0x%x\n", drv_stat); | ||
1533 | |||
1532 | if (unlikely(drv_stat & (ATA_BUSY | ATA_DRQ))) | 1534 | if (unlikely(drv_stat & (ATA_BUSY | ATA_DRQ))) |
1533 | ata_to_sense_error(qc, drv_stat); | 1535 | ata_to_sense_error(qc, drv_stat); |
1536 | |||
1534 | else if (unlikely(drv_stat & ATA_ERR)) { | 1537 | else if (unlikely(drv_stat & ATA_ERR)) { |
1535 | DPRINTK("request check condition\n"); | 1538 | DPRINTK("request check condition\n"); |
1536 | 1539 | ||
@@ -1546,7 +1549,9 @@ static int atapi_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat) | |||
1546 | qc->scsidone(cmd); | 1549 | qc->scsidone(cmd); |
1547 | 1550 | ||
1548 | return 1; | 1551 | return 1; |
1549 | } else { | 1552 | } |
1553 | |||
1554 | else { | ||
1550 | u8 *scsicmd = cmd->cmnd; | 1555 | u8 *scsicmd = cmd->cmnd; |
1551 | 1556 | ||
1552 | if (scsicmd[0] == INQUIRY) { | 1557 | if (scsicmd[0] == INQUIRY) { |
@@ -1578,7 +1583,6 @@ static int atapi_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat) | |||
1578 | } | 1583 | } |
1579 | 1584 | ||
1580 | qc->scsidone(cmd); | 1585 | qc->scsidone(cmd); |
1581 | |||
1582 | return 0; | 1586 | return 0; |
1583 | } | 1587 | } |
1584 | /** | 1588 | /** |