aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@suse.de>2011-01-23 09:16:24 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-01-24 13:05:22 -0500
commit75c0b3867b3d3ed17142888cd4f334fbee20e3f7 (patch)
tree29768fd74774032b8a8b5c913506aba18f9bb381 /drivers/scsi/libsas
parent940d7faa4818f386fcdf1b7266ec7b62bf07a7d0 (diff)
[SCSI] libsas: fix ATAPI check condition termination
ATAPI check condition needs to be treated the same as a success or protocol return. The register returns from the PACKET command are all correctly positioned in the device to host register FIS and so we should collect them properly. Right at the moment this doesn't matter because libata sends a request sense always for ATAPI errors, but if it ever checked the registers, we should have the correct contents just in case. Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/libsas')
-rw-r--r--drivers/scsi/libsas/sas_ata.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index e1a395b438ee..4a6e203861d2 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -71,13 +71,13 @@ static enum ata_completion_errors sas_to_ata_err(struct task_status_struct *ts)
71 case SAS_SG_ERR: 71 case SAS_SG_ERR:
72 return AC_ERR_INVALID; 72 return AC_ERR_INVALID;
73 73
74 case SAM_STAT_CHECK_CONDITION:
75 case SAS_OPEN_TO: 74 case SAS_OPEN_TO:
76 case SAS_OPEN_REJECT: 75 case SAS_OPEN_REJECT:
77 SAS_DPRINTK("%s: Saw error %d. What to do?\n", 76 SAS_DPRINTK("%s: Saw error %d. What to do?\n",
78 __func__, ts->stat); 77 __func__, ts->stat);
79 return AC_ERR_OTHER; 78 return AC_ERR_OTHER;
80 79
80 case SAM_STAT_CHECK_CONDITION:
81 case SAS_ABORTED_TASK: 81 case SAS_ABORTED_TASK:
82 return AC_ERR_DEV; 82 return AC_ERR_DEV;
83 83
@@ -107,13 +107,15 @@ static void sas_ata_task_done(struct sas_task *task)
107 sas_ha = dev->port->ha; 107 sas_ha = dev->port->ha;
108 108
109 spin_lock_irqsave(dev->sata_dev.ap->lock, flags); 109 spin_lock_irqsave(dev->sata_dev.ap->lock, flags);
110 if (stat->stat == SAS_PROTO_RESPONSE || stat->stat == SAM_STAT_GOOD) { 110 if (stat->stat == SAS_PROTO_RESPONSE || stat->stat == SAM_STAT_GOOD ||
111 ((stat->stat == SAM_STAT_CHECK_CONDITION &&
112 dev->sata_dev.command_set == ATAPI_COMMAND_SET))) {
111 ata_tf_from_fis(resp->ending_fis, &dev->sata_dev.tf); 113 ata_tf_from_fis(resp->ending_fis, &dev->sata_dev.tf);
112 qc->err_mask |= ac_err_mask(dev->sata_dev.tf.command); 114 qc->err_mask |= ac_err_mask(dev->sata_dev.tf.command);
113 dev->sata_dev.sstatus = resp->sstatus; 115 dev->sata_dev.sstatus = resp->sstatus;
114 dev->sata_dev.serror = resp->serror; 116 dev->sata_dev.serror = resp->serror;
115 dev->sata_dev.scontrol = resp->scontrol; 117 dev->sata_dev.scontrol = resp->scontrol;
116 } else if (stat->stat != SAM_STAT_GOOD) { 118 } else {
117 ac = sas_to_ata_err(stat); 119 ac = sas_to_ata_err(stat);
118 if (ac) { 120 if (ac) {
119 SAS_DPRINTK("%s: SAS error %x\n", __func__, 121 SAS_DPRINTK("%s: SAS error %x\n", __func__,