Commit 75c0b386 authored by James Bottomley's avatar James Bottomley

[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: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 940d7faa
...@@ -71,13 +71,13 @@ static enum ata_completion_errors sas_to_ata_err(struct task_status_struct *ts) ...@@ -71,13 +71,13 @@ static enum ata_completion_errors sas_to_ata_err(struct task_status_struct *ts)
case SAS_SG_ERR: case SAS_SG_ERR:
return AC_ERR_INVALID; return AC_ERR_INVALID;
case SAM_STAT_CHECK_CONDITION:
case SAS_OPEN_TO: case SAS_OPEN_TO:
case SAS_OPEN_REJECT: case SAS_OPEN_REJECT:
SAS_DPRINTK("%s: Saw error %d. What to do?\n", SAS_DPRINTK("%s: Saw error %d. What to do?\n",
__func__, ts->stat); __func__, ts->stat);
return AC_ERR_OTHER; return AC_ERR_OTHER;
case SAM_STAT_CHECK_CONDITION:
case SAS_ABORTED_TASK: case SAS_ABORTED_TASK:
return AC_ERR_DEV; return AC_ERR_DEV;
...@@ -107,13 +107,15 @@ static void sas_ata_task_done(struct sas_task *task) ...@@ -107,13 +107,15 @@ static void sas_ata_task_done(struct sas_task *task)
sas_ha = dev->port->ha; sas_ha = dev->port->ha;
spin_lock_irqsave(dev->sata_dev.ap->lock, flags); spin_lock_irqsave(dev->sata_dev.ap->lock, flags);
if (stat->stat == SAS_PROTO_RESPONSE || stat->stat == SAM_STAT_GOOD) { if (stat->stat == SAS_PROTO_RESPONSE || stat->stat == SAM_STAT_GOOD ||
((stat->stat == SAM_STAT_CHECK_CONDITION &&
dev->sata_dev.command_set == ATAPI_COMMAND_SET))) {
ata_tf_from_fis(resp->ending_fis, &dev->sata_dev.tf); ata_tf_from_fis(resp->ending_fis, &dev->sata_dev.tf);
qc->err_mask |= ac_err_mask(dev->sata_dev.tf.command); qc->err_mask |= ac_err_mask(dev->sata_dev.tf.command);
dev->sata_dev.sstatus = resp->sstatus; dev->sata_dev.sstatus = resp->sstatus;
dev->sata_dev.serror = resp->serror; dev->sata_dev.serror = resp->serror;
dev->sata_dev.scontrol = resp->scontrol; dev->sata_dev.scontrol = resp->scontrol;
} else if (stat->stat != SAM_STAT_GOOD) { } else {
ac = sas_to_ata_err(stat); ac = sas_to_ata_err(stat);
if (ac) { if (ac) {
SAS_DPRINTK("%s: SAS error %x\n", __func__, SAS_DPRINTK("%s: SAS error %x\n", __func__,
......
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