summaryrefslogtreecommitdiff
path: root/drivers/ata/libata-scsi.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2016-04-25 13:45:54 +0300
committerTejun Heo <tj@kernel.org>2016-05-09 19:36:46 +0300
commit284b3b77ea883234dadb2cbf97b145c3c30fe4bd (patch)
tree2faa832ef21a350e2d6b5e4c238f70e38e0e6502 /drivers/ata/libata-scsi.c
parent27708a9579ee069c6e0ebb6e61ac1114ed1d546c (diff)
downloadlinux-284b3b77ea883234dadb2cbf97b145c3c30fe4bd.tar.xz
libata: NCQ encapsulation for ZAC MANAGEMENT OUT
Add NCQ encapsulation for ZAC MANAGEMENT OUT and evaluate NCQ Non-Data log pages to figure out if NCQ encapsulation is supported. Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r--drivers/ata/libata-scsi.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 6afd0840ebbe..43403aa0801f 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3506,11 +3506,19 @@ static unsigned int ata_scsi_zbc_out_xlat(struct ata_queued_cmd *qc)
reset_all = cdb[14] & 0x1;
- tf->protocol = ATA_PROT_NODATA;
- tf->command = ATA_CMD_ZAC_MGMT_OUT;
- tf->feature = sa;
- tf->hob_feature = reset_all & 0x1;
-
+ if (ata_ncq_enabled(qc->dev) &&
+ ata_fpdma_zac_mgmt_out_supported(qc->dev)) {
+ tf->protocol = ATA_PROT_NCQ;
+ tf->command = ATA_CMD_NCQ_NON_DATA;
+ tf->hob_nsect = ATA_SUBCMD_NCQ_NON_DATA_ZAC_MGMT_OUT;
+ tf->nsect = qc->tag << 3;
+ tf->auxiliary = sa | (reset_all & 0x1) << 8;
+ } else {
+ tf->protocol = ATA_PROT_NODATA;
+ tf->command = ATA_CMD_ZAC_MGMT_OUT;
+ tf->feature = sa;
+ tf->hob_feature = reset_all & 0x1;
+ }
tf->lbah = (block >> 16) & 0xff;
tf->lbam = (block >> 8) & 0xff;
tf->lbal = block & 0xff;