Commit 3f17422b authored by Damien Le Moal's avatar Damien Le Moal Committed by Tejun Heo

libata-scsi: Fix translation of REPORT ZONES command

Include reporting options when translating REPORT ZONES commmand to
ATA NCQ, and make sure we only look at the actually specified bits
in the CDB for the options.
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@hgst.com>
[hch: update patch description]
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 5b844b63
...@@ -3468,7 +3468,7 @@ static unsigned int ata_scsi_zbc_in_xlat(struct ata_queued_cmd *qc) ...@@ -3468,7 +3468,7 @@ static unsigned int ata_scsi_zbc_in_xlat(struct ata_queued_cmd *qc)
goto invalid_param_len; goto invalid_param_len;
} }
sect = n_block / 512; sect = n_block / 512;
options = cdb[14]; options = cdb[14] & 0xbf;
if (ata_ncq_enabled(qc->dev) && if (ata_ncq_enabled(qc->dev) &&
ata_fpdma_zac_mgmt_in_supported(qc->dev)) { ata_fpdma_zac_mgmt_in_supported(qc->dev)) {
...@@ -3478,7 +3478,7 @@ static unsigned int ata_scsi_zbc_in_xlat(struct ata_queued_cmd *qc) ...@@ -3478,7 +3478,7 @@ static unsigned int ata_scsi_zbc_in_xlat(struct ata_queued_cmd *qc)
tf->nsect = qc->tag << 3; tf->nsect = qc->tag << 3;
tf->feature = sect & 0xff; tf->feature = sect & 0xff;
tf->hob_feature = (sect >> 8) & 0xff; tf->hob_feature = (sect >> 8) & 0xff;
tf->auxiliary = ATA_SUBCMD_ZAC_MGMT_IN_REPORT_ZONES; tf->auxiliary = ATA_SUBCMD_ZAC_MGMT_IN_REPORT_ZONES | (options << 8);
} else { } else {
tf->command = ATA_CMD_ZAC_MGMT_IN; tf->command = ATA_CMD_ZAC_MGMT_IN;
tf->feature = ATA_SUBCMD_ZAC_MGMT_IN_REPORT_ZONES; tf->feature = ATA_SUBCMD_ZAC_MGMT_IN_REPORT_ZONES;
......
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