]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
scsi: hisi_sas: Assign NCQ tag for all NCQ commands
authorXiang Chen <chenxiang66@hisilicon.com>
Fri, 6 Sep 2019 12:55:31 +0000 (20:55 +0800)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:23:10 +0000 (14:23 -0300)
BugLink: https://launchpad.net/bugs/1853995
Currently the NCQ tag is only assigned for FPDMA READ and FPDMA WRITE
commands, and for other NCQ commands (such as FPDMA SEND), their NCQ tags
are set in the delivery command to 0.

So for all the NCQ commands, we also need to assign normal NCQ tag for
them, so drop the command type check in hisi_sas_get_ncq_tag() [drop
hisi_sas_get_ncq_tag() altogether actually], and always use the ATA command
NCQ tag when appropriate.

Link: https://lore.kernel.org/r/1567774537-20003-8-git-send-email-john.garry@huawei.com
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 435a05cf8c003221fd945229e2b61b5ecca9070d)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/scsi/hisi_sas/hisi_sas.h
drivers/scsi/hisi_sas/hisi_sas_main.c
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

index f9026ad67732036706a2c7b8f5eddfba1542befc..e53936540b10cf183fe42191dbdb3ee6dc65e477 100644 (file)
@@ -469,7 +469,6 @@ extern u8 hisi_sas_get_ata_protocol(struct host_to_dev_fis *fis,
 extern struct hisi_sas_port *to_hisi_sas_port(struct asd_sas_port *sas_port);
 extern void hisi_sas_sata_done(struct sas_task *task,
                            struct hisi_sas_slot *slot);
-extern int hisi_sas_get_ncq_tag(struct sas_task *task, u32 *tag);
 extern int hisi_sas_get_fw_info(struct hisi_hba *hisi_hba);
 extern int hisi_sas_probe(struct platform_device *pdev,
                          const struct hisi_sas_hw *ops);
index 0870ffa723e80fd8cdfd7e9920001dd6ac1bc73c..be6877931ac43ac4032d02331a0e097dd8c7db69 100644 (file)
@@ -124,21 +124,6 @@ void hisi_sas_sata_done(struct sas_task *task,
 }
 EXPORT_SYMBOL_GPL(hisi_sas_sata_done);
 
-int hisi_sas_get_ncq_tag(struct sas_task *task, u32 *tag)
-{
-       struct ata_queued_cmd *qc = task->uldd_task;
-
-       if (qc) {
-               if (qc->tf.command == ATA_CMD_FPDMA_WRITE ||
-                       qc->tf.command == ATA_CMD_FPDMA_READ) {
-                       *tag = qc->tag;
-                       return 1;
-               }
-       }
-       return 0;
-}
-EXPORT_SYMBOL_GPL(hisi_sas_get_ncq_tag);
-
 /*
  * This function assumes linkrate mask fits in 8 bits, which it
  * does for all HW versions supported.
index 3c6d6ed962265bb1afe2d498ac8122ebef643c0d..95702c1fc26010cad736b45d88b95535562cdcf2 100644 (file)
@@ -2569,7 +2569,10 @@ static void prep_ata_v2_hw(struct hisi_hba *hisi_hba,
        hdr->dw1 = cpu_to_le32(dw1);
 
        /* dw2 */
-       if (task->ata_task.use_ncq && hisi_sas_get_ncq_tag(task, &hdr_tag)) {
+       if (task->ata_task.use_ncq) {
+               struct ata_queued_cmd *qc = task->uldd_task;
+
+               hdr_tag = qc->tag;
                task->ata_task.fis.sector_count |= (u8) (hdr_tag << 3);
                dw2 |= hdr_tag << CMD_HDR_NCQ_TAG_OFF;
        }
index 6c6fba42543ddff3b7c7f719a45dd3e881dfaf2c..095c973b866da313aac5671f6b1d32fdd56fe61f 100644 (file)
@@ -1224,7 +1224,10 @@ static void prep_ata_v3_hw(struct hisi_hba *hisi_hba,
        hdr->dw1 = cpu_to_le32(dw1);
 
        /* dw2 */
-       if (task->ata_task.use_ncq && hisi_sas_get_ncq_tag(task, &hdr_tag)) {
+       if (task->ata_task.use_ncq) {
+               struct ata_queued_cmd *qc = task->uldd_task;
+
+               hdr_tag = qc->tag;
                task->ata_task.fis.sector_count |= (u8) (hdr_tag << 3);
                dw2 |= hdr_tag << CMD_HDR_NCQ_TAG_OFF;
        }