scb->ata_task.total_xfer_len = cpu_to_le32(task->total_xfer_len);
scb->ata_task.fis = task->ata_task.fis;
- scb->ata_task.fis.fis_type = 0x27;
if (likely(!task->ata_task.device_control_reg_update))
scb->ata_task.fis.flags |= 0x80; /* C=1: update ATA cmd reg */
scb->ata_task.fis.flags &= 0xF0; /* PM_PORT field shall be 0 */
task->dev = dev;
+ task->ata_task.fis.fis_type = 0x27;
task->ata_task.fis.command = command;
task->ata_task.fis.features = features;
task->ata_task.fis.device = d2h_fis->device;
sas_fill_in_rphy(dev, dev->rphy);
- res = sas_rphy_add(dev->rphy);
- if (res)
- goto out_err;
-
- return res;
+ return 0;
out_err:
dev->sata_dev.identify_packet_device = NULL;
dev->sata_dev.identify_device = NULL;
res = sas_notify_lldd_dev_found(dev);
if (res)
- goto out_err2;
+ return res;
switch (dev->dev_type) {
case SATA_DEV:
default:
break;
}
- if (res)
- goto out_err;
-
sas_notify_lldd_dev_gone(dev);
- res = sas_notify_lldd_dev_found(dev);
- if (res)
- goto out_err2;
-
- res = sas_rphy_add(dev->rphy);
- if (res)
- goto out_err;
-
- return res;
+ if (!res) {
+ sas_notify_lldd_dev_found(dev);
+ res = sas_rphy_add(dev->rphy);
+ }
-out_err:
- sas_notify_lldd_dev_gone(dev);
-out_err2:
return res;
}
task->task_proto = SAS_PROTOCOL_STP;
task->task_done = sas_ata_task_done;
+ if (qc->tf.command == ATA_CMD_FPDMA_WRITE ||
+ qc->tf.command == ATA_CMD_FPDMA_READ) {
+ /* Need to zero out the tag libata assigned us */
+ qc->tf.nsect = 0;
+ }
+
ata_tf_to_fis(&qc->tf, (u8*)&task->ata_task.fis, 0);
task->uldd_task = qc;
if (is_atapi_taskfile(&qc->tf)) {