summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ata/acard-ahci.c4
-rw-r--r--drivers/ata/libahci.c8
-rw-r--r--drivers/ata/libata-core.c8
-rw-r--r--drivers/ata/libata-scsi.c10
-rw-r--r--drivers/ata/sata_dwc_460ex.c14
-rw-r--r--drivers/ata/sata_fsl.c6
-rw-r--r--drivers/ata/sata_mv.c24
-rw-r--r--drivers/ata/sata_nv.c32
-rw-r--r--drivers/ata/sata_sil24.c6
9 files changed, 56 insertions, 56 deletions
diff --git a/drivers/ata/acard-ahci.c b/drivers/ata/acard-ahci.c
index 940ddbc59aa7..583e366be7e2 100644
--- a/drivers/ata/acard-ahci.c
+++ b/drivers/ata/acard-ahci.c
@@ -271,7 +271,7 @@ static void acard_ahci_qc_prep(struct ata_queued_cmd *qc)
271 * Fill in command table information. First, the header, 271 * Fill in command table information. First, the header,
272 * a SATA Register - Host to Device command FIS. 272 * a SATA Register - Host to Device command FIS.
273 */ 273 */
274 cmd_tbl = pp->cmd_tbl + qc->tag * AHCI_CMD_TBL_SZ; 274 cmd_tbl = pp->cmd_tbl + qc->hw_tag * AHCI_CMD_TBL_SZ;
275 275
276 ata_tf_to_fis(&qc->tf, qc->dev->link->pmp, 1, cmd_tbl); 276 ata_tf_to_fis(&qc->tf, qc->dev->link->pmp, 1, cmd_tbl);
277 if (is_atapi) { 277 if (is_atapi) {
@@ -294,7 +294,7 @@ static void acard_ahci_qc_prep(struct ata_queued_cmd *qc)
294 if (is_atapi) 294 if (is_atapi)
295 opts |= AHCI_CMD_ATAPI | AHCI_CMD_PREFETCH; 295 opts |= AHCI_CMD_ATAPI | AHCI_CMD_PREFETCH;
296 296
297 ahci_fill_cmd_slot(pp, qc->tag, opts); 297 ahci_fill_cmd_slot(pp, qc->hw_tag, opts);
298} 298}
299 299
300static bool acard_ahci_qc_fill_rtf(struct ata_queued_cmd *qc) 300static bool acard_ahci_qc_fill_rtf(struct ata_queued_cmd *qc)
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 7adcf3caabd0..d043597295fa 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -1645,7 +1645,7 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc)
1645 * Fill in command table information. First, the header, 1645 * Fill in command table information. First, the header,
1646 * a SATA Register - Host to Device command FIS. 1646 * a SATA Register - Host to Device command FIS.
1647 */ 1647 */
1648 cmd_tbl = pp->cmd_tbl + qc->tag * AHCI_CMD_TBL_SZ; 1648 cmd_tbl = pp->cmd_tbl + qc->hw_tag * AHCI_CMD_TBL_SZ;
1649 1649
1650 ata_tf_to_fis(&qc->tf, qc->dev->link->pmp, 1, cmd_tbl); 1650 ata_tf_to_fis(&qc->tf, qc->dev->link->pmp, 1, cmd_tbl);
1651 if (is_atapi) { 1651 if (is_atapi) {
@@ -1666,7 +1666,7 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc)
1666 if (is_atapi) 1666 if (is_atapi)
1667 opts |= AHCI_CMD_ATAPI | AHCI_CMD_PREFETCH; 1667 opts |= AHCI_CMD_ATAPI | AHCI_CMD_PREFETCH;
1668 1668
1669 ahci_fill_cmd_slot(pp, qc->tag, opts); 1669 ahci_fill_cmd_slot(pp, qc->hw_tag, opts);
1670} 1670}
1671 1671
1672static void ahci_fbs_dec_intr(struct ata_port *ap) 1672static void ahci_fbs_dec_intr(struct ata_port *ap)
@@ -2002,7 +2002,7 @@ unsigned int ahci_qc_issue(struct ata_queued_cmd *qc)
2002 pp->active_link = qc->dev->link; 2002 pp->active_link = qc->dev->link;
2003 2003
2004 if (ata_is_ncq(qc->tf.protocol)) 2004 if (ata_is_ncq(qc->tf.protocol))
2005 writel(1 << qc->tag, port_mmio + PORT_SCR_ACT); 2005 writel(1 << qc->hw_tag, port_mmio + PORT_SCR_ACT);
2006 2006
2007 if (pp->fbs_enabled && pp->fbs_last_dev != qc->dev->link->pmp) { 2007 if (pp->fbs_enabled && pp->fbs_last_dev != qc->dev->link->pmp) {
2008 u32 fbs = readl(port_mmio + PORT_FBS); 2008 u32 fbs = readl(port_mmio + PORT_FBS);
@@ -2012,7 +2012,7 @@ unsigned int ahci_qc_issue(struct ata_queued_cmd *qc)
2012 pp->fbs_last_dev = qc->dev->link->pmp; 2012 pp->fbs_last_dev = qc->dev->link->pmp;
2013 } 2013 }
2014 2014
2015 writel(1 << qc->tag, port_mmio + PORT_CMD_ISSUE); 2015 writel(1 << qc->hw_tag, port_mmio + PORT_CMD_ISSUE);
2016 2016
2017 ahci_sw_activity(qc->dev->link); 2017 ahci_sw_activity(qc->dev->link);
2018 2018
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 4dc67c770429..1687e24d3633 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5177,7 +5177,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc)
5177 5177
5178 /* command should be marked inactive atomically with qc completion */ 5178 /* command should be marked inactive atomically with qc completion */
5179 if (ata_is_ncq(qc->tf.protocol)) { 5179 if (ata_is_ncq(qc->tf.protocol)) {
5180 link->sactive &= ~(1 << qc->tag); 5180 link->sactive &= ~(1 << qc->hw_tag);
5181 if (!link->sactive) 5181 if (!link->sactive)
5182 ap->nr_active_links--; 5182 ap->nr_active_links--;
5183 } else { 5183 } else {
@@ -5405,16 +5405,16 @@ void ata_qc_issue(struct ata_queued_cmd *qc)
5405 WARN_ON_ONCE(ap->ops->error_handler && ata_tag_valid(link->active_tag)); 5405 WARN_ON_ONCE(ap->ops->error_handler && ata_tag_valid(link->active_tag));
5406 5406
5407 if (ata_is_ncq(prot)) { 5407 if (ata_is_ncq(prot)) {
5408 WARN_ON_ONCE(link->sactive & (1 << qc->tag)); 5408 WARN_ON_ONCE(link->sactive & (1 << qc->hw_tag));
5409 5409
5410 if (!link->sactive) 5410 if (!link->sactive)
5411 ap->nr_active_links++; 5411 ap->nr_active_links++;
5412 link->sactive |= 1 << qc->tag; 5412 link->sactive |= 1 << qc->hw_tag;
5413 } else { 5413 } else {
5414 WARN_ON_ONCE(link->sactive); 5414 WARN_ON_ONCE(link->sactive);
5415 5415
5416 ap->nr_active_links++; 5416 ap->nr_active_links++;
5417 link->active_tag = qc->tag; 5417 link->active_tag = qc->hw_tag;
5418 } 5418 }
5419 5419
5420 qc->flags |= ATA_QCFLAG_ACTIVE; 5420 qc->flags |= ATA_QCFLAG_ACTIVE;
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 8d76de9189e4..28e1af2bae5f 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1898,7 +1898,7 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc)
1898 qc->nbytes = n_block * scmd->device->sector_size; 1898 qc->nbytes = n_block * scmd->device->sector_size;
1899 1899
1900 rc = ata_build_rw_tf(&qc->tf, qc->dev, block, n_block, tf_flags, 1900 rc = ata_build_rw_tf(&qc->tf, qc->dev, block, n_block, tf_flags,
1901 qc->tag, class); 1901 qc->hw_tag, class);
1902 1902
1903 if (likely(rc == 0)) 1903 if (likely(rc == 0))
1904 return 0; 1904 return 0;
@@ -3236,7 +3236,7 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
3236 3236
3237 /* For NCQ commands copy the tag value */ 3237 /* For NCQ commands copy the tag value */
3238 if (ata_is_ncq(tf->protocol)) 3238 if (ata_is_ncq(tf->protocol))
3239 tf->nsect = qc->tag << 3; 3239 tf->nsect = qc->hw_tag << 3;
3240 3240
3241 /* enforce correct master/slave bit */ 3241 /* enforce correct master/slave bit */
3242 tf->device = dev->devno ? 3242 tf->device = dev->devno ?
@@ -3516,7 +3516,7 @@ static unsigned int ata_scsi_write_same_xlat(struct ata_queued_cmd *qc)
3516 tf->protocol = ATA_PROT_NCQ; 3516 tf->protocol = ATA_PROT_NCQ;
3517 tf->command = ATA_CMD_FPDMA_SEND; 3517 tf->command = ATA_CMD_FPDMA_SEND;
3518 tf->hob_nsect = ATA_SUBCMD_FPDMA_SEND_DSM & 0x1f; 3518 tf->hob_nsect = ATA_SUBCMD_FPDMA_SEND_DSM & 0x1f;
3519 tf->nsect = qc->tag << 3; 3519 tf->nsect = qc->hw_tag << 3;
3520 tf->hob_feature = (size / 512) >> 8; 3520 tf->hob_feature = (size / 512) >> 8;
3521 tf->feature = size / 512; 3521 tf->feature = size / 512;
3522 3522
@@ -3736,7 +3736,7 @@ static unsigned int ata_scsi_zbc_in_xlat(struct ata_queued_cmd *qc)
3736 tf->protocol = ATA_PROT_NCQ; 3736 tf->protocol = ATA_PROT_NCQ;
3737 tf->command = ATA_CMD_FPDMA_RECV; 3737 tf->command = ATA_CMD_FPDMA_RECV;
3738 tf->hob_nsect = ATA_SUBCMD_FPDMA_RECV_ZAC_MGMT_IN & 0x1f; 3738 tf->hob_nsect = ATA_SUBCMD_FPDMA_RECV_ZAC_MGMT_IN & 0x1f;
3739 tf->nsect = qc->tag << 3; 3739 tf->nsect = qc->hw_tag << 3;
3740 tf->feature = sect & 0xff; 3740 tf->feature = sect & 0xff;
3741 tf->hob_feature = (sect >> 8) & 0xff; 3741 tf->hob_feature = (sect >> 8) & 0xff;
3742 tf->auxiliary = ATA_SUBCMD_ZAC_MGMT_IN_REPORT_ZONES | (options << 8); 3742 tf->auxiliary = ATA_SUBCMD_ZAC_MGMT_IN_REPORT_ZONES | (options << 8);
@@ -3815,7 +3815,7 @@ static unsigned int ata_scsi_zbc_out_xlat(struct ata_queued_cmd *qc)
3815 tf->protocol = ATA_PROT_NCQ_NODATA; 3815 tf->protocol = ATA_PROT_NCQ_NODATA;
3816 tf->command = ATA_CMD_NCQ_NON_DATA; 3816 tf->command = ATA_CMD_NCQ_NON_DATA;
3817 tf->feature = ATA_SUBCMD_NCQ_NON_DATA_ZAC_MGMT_OUT; 3817 tf->feature = ATA_SUBCMD_NCQ_NON_DATA_ZAC_MGMT_OUT;
3818 tf->nsect = qc->tag << 3; 3818 tf->nsect = qc->hw_tag << 3;
3819 tf->auxiliary = sa | ((u16)all << 8); 3819 tf->auxiliary = sa | ((u16)all << 8);
3820 } else { 3820 } else {
3821 tf->protocol = ATA_PROT_NODATA; 3821 tf->protocol = ATA_PROT_NODATA;
diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
index ce3d6674ef80..6f142aa54f5f 100644
--- a/drivers/ata/sata_dwc_460ex.c
+++ b/drivers/ata/sata_dwc_460ex.c
@@ -761,7 +761,7 @@ static void sata_dwc_dma_xfer_complete(struct ata_port *ap, u32 check_status)
761 if (tag > 0) { 761 if (tag > 0) {
762 dev_info(ap->dev, 762 dev_info(ap->dev,
763 "%s tag=%u cmd=0x%02x dma dir=%s proto=%s dmacr=0x%08x\n", 763 "%s tag=%u cmd=0x%02x dma dir=%s proto=%s dmacr=0x%08x\n",
764 __func__, qc->tag, qc->tf.command, 764 __func__, qc->hw_tag, qc->tf.command,
765 get_dma_dir_descript(qc->dma_dir), 765 get_dma_dir_descript(qc->dma_dir),
766 get_prot_descript(qc->tf.protocol), 766 get_prot_descript(qc->tf.protocol),
767 sata_dwc_readl(&hsdev->sata_dwc_regs->dmacr)); 767 sata_dwc_readl(&hsdev->sata_dwc_regs->dmacr));
@@ -789,7 +789,7 @@ static int sata_dwc_qc_complete(struct ata_port *ap, struct ata_queued_cmd *qc,
789{ 789{
790 u8 status = 0; 790 u8 status = 0;
791 u32 mask = 0x0; 791 u32 mask = 0x0;
792 u8 tag = qc->tag; 792 u8 tag = qc->hw_tag;
793 struct sata_dwc_device *hsdev = HSDEV_FROM_AP(ap); 793 struct sata_dwc_device *hsdev = HSDEV_FROM_AP(ap);
794 struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap); 794 struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap);
795 hsdev->sactive_queued = 0; 795 hsdev->sactive_queued = 0;
@@ -997,7 +997,7 @@ static void sata_dwc_bmdma_setup_by_tag(struct ata_queued_cmd *qc, u8 tag)
997 997
998static void sata_dwc_bmdma_setup(struct ata_queued_cmd *qc) 998static void sata_dwc_bmdma_setup(struct ata_queued_cmd *qc)
999{ 999{
1000 u8 tag = qc->tag; 1000 u8 tag = qc->hw_tag;
1001 1001
1002 if (ata_is_ncq(qc->tf.protocol)) { 1002 if (ata_is_ncq(qc->tf.protocol)) {
1003 dev_dbg(qc->ap->dev, "%s: ap->link.sactive=0x%08x tag=%d\n", 1003 dev_dbg(qc->ap->dev, "%s: ap->link.sactive=0x%08x tag=%d\n",
@@ -1059,7 +1059,7 @@ static void sata_dwc_bmdma_start_by_tag(struct ata_queued_cmd *qc, u8 tag)
1059 1059
1060static void sata_dwc_bmdma_start(struct ata_queued_cmd *qc) 1060static void sata_dwc_bmdma_start(struct ata_queued_cmd *qc)
1061{ 1061{
1062 u8 tag = qc->tag; 1062 u8 tag = qc->hw_tag;
1063 1063
1064 if (ata_is_ncq(qc->tf.protocol)) { 1064 if (ata_is_ncq(qc->tf.protocol)) {
1065 dev_dbg(qc->ap->dev, "%s: ap->link.sactive=0x%08x tag=%d\n", 1065 dev_dbg(qc->ap->dev, "%s: ap->link.sactive=0x%08x tag=%d\n",
@@ -1074,17 +1074,17 @@ static void sata_dwc_bmdma_start(struct ata_queued_cmd *qc)
1074static unsigned int sata_dwc_qc_issue(struct ata_queued_cmd *qc) 1074static unsigned int sata_dwc_qc_issue(struct ata_queued_cmd *qc)
1075{ 1075{
1076 u32 sactive; 1076 u32 sactive;
1077 u8 tag = qc->tag; 1077 u8 tag = qc->hw_tag;
1078 struct ata_port *ap = qc->ap; 1078 struct ata_port *ap = qc->ap;
1079 struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap); 1079 struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap);
1080 1080
1081#ifdef DEBUG_NCQ 1081#ifdef DEBUG_NCQ
1082 if (qc->tag > 0 || ap->link.sactive > 1) 1082 if (qc->hw_tag > 0 || ap->link.sactive > 1)
1083 dev_info(ap->dev, 1083 dev_info(ap->dev,
1084 "%s ap id=%d cmd(0x%02x)=%s qc tag=%d prot=%s ap active_tag=0x%08x ap sactive=0x%08x\n", 1084 "%s ap id=%d cmd(0x%02x)=%s qc tag=%d prot=%s ap active_tag=0x%08x ap sactive=0x%08x\n",
1085 __func__, ap->print_id, qc->tf.command, 1085 __func__, ap->print_id, qc->tf.command,
1086 ata_get_cmd_descript(qc->tf.command), 1086 ata_get_cmd_descript(qc->tf.command),
1087 qc->tag, get_prot_descript(qc->tf.protocol), 1087 qc->hw_tag, get_prot_descript(qc->tf.protocol),
1088 ap->link.active_tag, ap->link.sactive); 1088 ap->link.active_tag, ap->link.sactive);
1089#endif 1089#endif
1090 1090
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index 95bf3abda6f6..cb67847d2157 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -519,7 +519,7 @@ static void sata_fsl_qc_prep(struct ata_queued_cmd *qc)
519 struct sata_fsl_port_priv *pp = ap->private_data; 519 struct sata_fsl_port_priv *pp = ap->private_data;
520 struct sata_fsl_host_priv *host_priv = ap->host->private_data; 520 struct sata_fsl_host_priv *host_priv = ap->host->private_data;
521 void __iomem *hcr_base = host_priv->hcr_base; 521 void __iomem *hcr_base = host_priv->hcr_base;
522 unsigned int tag = sata_fsl_tag(qc->tag, hcr_base); 522 unsigned int tag = sata_fsl_tag(qc->hw_tag, hcr_base);
523 struct command_desc *cd; 523 struct command_desc *cd;
524 u32 desc_info = CMD_DESC_RES | CMD_DESC_SNOOP_ENABLE; 524 u32 desc_info = CMD_DESC_RES | CMD_DESC_SNOOP_ENABLE;
525 u32 num_prde = 0; 525 u32 num_prde = 0;
@@ -566,7 +566,7 @@ static unsigned int sata_fsl_qc_issue(struct ata_queued_cmd *qc)
566 struct ata_port *ap = qc->ap; 566 struct ata_port *ap = qc->ap;
567 struct sata_fsl_host_priv *host_priv = ap->host->private_data; 567 struct sata_fsl_host_priv *host_priv = ap->host->private_data;
568 void __iomem *hcr_base = host_priv->hcr_base; 568 void __iomem *hcr_base = host_priv->hcr_base;
569 unsigned int tag = sata_fsl_tag(qc->tag, hcr_base); 569 unsigned int tag = sata_fsl_tag(qc->hw_tag, hcr_base);
570 570
571 VPRINTK("xx_qc_issue called,CQ=0x%x,CA=0x%x,CE=0x%x,CC=0x%x\n", 571 VPRINTK("xx_qc_issue called,CQ=0x%x,CA=0x%x,CE=0x%x,CC=0x%x\n",
572 ioread32(CQ + hcr_base), 572 ioread32(CQ + hcr_base),
@@ -595,7 +595,7 @@ static bool sata_fsl_qc_fill_rtf(struct ata_queued_cmd *qc)
595 struct sata_fsl_port_priv *pp = qc->ap->private_data; 595 struct sata_fsl_port_priv *pp = qc->ap->private_data;
596 struct sata_fsl_host_priv *host_priv = qc->ap->host->private_data; 596 struct sata_fsl_host_priv *host_priv = qc->ap->host->private_data;
597 void __iomem *hcr_base = host_priv->hcr_base; 597 void __iomem *hcr_base = host_priv->hcr_base;
598 unsigned int tag = sata_fsl_tag(qc->tag, hcr_base); 598 unsigned int tag = sata_fsl_tag(qc->hw_tag, hcr_base);
599 struct command_desc *cd; 599 struct command_desc *cd;
600 600
601 cd = pp->cmdentry + tag; 601 cd = pp->cmdentry + tag;
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 42d4589b43d4..3a08f38c695c 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -1802,7 +1802,7 @@ static void mv_fill_sg(struct ata_queued_cmd *qc)
1802 struct mv_sg *mv_sg, *last_sg = NULL; 1802 struct mv_sg *mv_sg, *last_sg = NULL;
1803 unsigned int si; 1803 unsigned int si;
1804 1804
1805 mv_sg = pp->sg_tbl[qc->tag]; 1805 mv_sg = pp->sg_tbl[qc->hw_tag];
1806 for_each_sg(qc->sg, sg, qc->n_elem, si) { 1806 for_each_sg(qc->sg, sg, qc->n_elem, si) {
1807 dma_addr_t addr = sg_dma_address(sg); 1807 dma_addr_t addr = sg_dma_address(sg);
1808 u32 sg_len = sg_dma_len(sg); 1808 u32 sg_len = sg_dma_len(sg);
@@ -1903,9 +1903,9 @@ static void mv_bmdma_setup(struct ata_queued_cmd *qc)
1903 writel(0, port_mmio + BMDMA_CMD); 1903 writel(0, port_mmio + BMDMA_CMD);
1904 1904
1905 /* load PRD table addr. */ 1905 /* load PRD table addr. */
1906 writel((pp->sg_tbl_dma[qc->tag] >> 16) >> 16, 1906 writel((pp->sg_tbl_dma[qc->hw_tag] >> 16) >> 16,
1907 port_mmio + BMDMA_PRD_HIGH); 1907 port_mmio + BMDMA_PRD_HIGH);
1908 writelfl(pp->sg_tbl_dma[qc->tag], 1908 writelfl(pp->sg_tbl_dma[qc->hw_tag],
1909 port_mmio + BMDMA_PRD_LOW); 1909 port_mmio + BMDMA_PRD_LOW);
1910 1910
1911 /* issue r/w command */ 1911 /* issue r/w command */
@@ -2071,17 +2071,17 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)
2071 */ 2071 */
2072 if (!(tf->flags & ATA_TFLAG_WRITE)) 2072 if (!(tf->flags & ATA_TFLAG_WRITE))
2073 flags |= CRQB_FLAG_READ; 2073 flags |= CRQB_FLAG_READ;
2074 WARN_ON(MV_MAX_Q_DEPTH <= qc->tag); 2074 WARN_ON(MV_MAX_Q_DEPTH <= qc->hw_tag);
2075 flags |= qc->tag << CRQB_TAG_SHIFT; 2075 flags |= qc->hw_tag << CRQB_TAG_SHIFT;
2076 flags |= (qc->dev->link->pmp & 0xf) << CRQB_PMP_SHIFT; 2076 flags |= (qc->dev->link->pmp & 0xf) << CRQB_PMP_SHIFT;
2077 2077
2078 /* get current queue index from software */ 2078 /* get current queue index from software */
2079 in_index = pp->req_idx; 2079 in_index = pp->req_idx;
2080 2080
2081 pp->crqb[in_index].sg_addr = 2081 pp->crqb[in_index].sg_addr =
2082 cpu_to_le32(pp->sg_tbl_dma[qc->tag] & 0xffffffff); 2082 cpu_to_le32(pp->sg_tbl_dma[qc->hw_tag] & 0xffffffff);
2083 pp->crqb[in_index].sg_addr_hi = 2083 pp->crqb[in_index].sg_addr_hi =
2084 cpu_to_le32((pp->sg_tbl_dma[qc->tag] >> 16) >> 16); 2084 cpu_to_le32((pp->sg_tbl_dma[qc->hw_tag] >> 16) >> 16);
2085 pp->crqb[in_index].ctrl_flags = cpu_to_le16(flags); 2085 pp->crqb[in_index].ctrl_flags = cpu_to_le16(flags);
2086 2086
2087 cw = &pp->crqb[in_index].ata_cmd[0]; 2087 cw = &pp->crqb[in_index].ata_cmd[0];
@@ -2164,17 +2164,17 @@ static void mv_qc_prep_iie(struct ata_queued_cmd *qc)
2164 if (!(tf->flags & ATA_TFLAG_WRITE)) 2164 if (!(tf->flags & ATA_TFLAG_WRITE))
2165 flags |= CRQB_FLAG_READ; 2165 flags |= CRQB_FLAG_READ;
2166 2166
2167 WARN_ON(MV_MAX_Q_DEPTH <= qc->tag); 2167 WARN_ON(MV_MAX_Q_DEPTH <= qc->hw_tag);
2168 flags |= qc->tag << CRQB_TAG_SHIFT; 2168 flags |= qc->hw_tag << CRQB_TAG_SHIFT;
2169 flags |= qc->tag << CRQB_HOSTQ_SHIFT; 2169 flags |= qc->hw_tag << CRQB_HOSTQ_SHIFT;
2170 flags |= (qc->dev->link->pmp & 0xf) << CRQB_PMP_SHIFT; 2170 flags |= (qc->dev->link->pmp & 0xf) << CRQB_PMP_SHIFT;
2171 2171
2172 /* get current queue index from software */ 2172 /* get current queue index from software */
2173 in_index = pp->req_idx; 2173 in_index = pp->req_idx;
2174 2174
2175 crqb = (struct mv_crqb_iie *) &pp->crqb[in_index]; 2175 crqb = (struct mv_crqb_iie *) &pp->crqb[in_index];
2176 crqb->addr = cpu_to_le32(pp->sg_tbl_dma[qc->tag] & 0xffffffff); 2176 crqb->addr = cpu_to_le32(pp->sg_tbl_dma[qc->hw_tag] & 0xffffffff);
2177 crqb->addr_hi = cpu_to_le32((pp->sg_tbl_dma[qc->tag] >> 16) >> 16); 2177 crqb->addr_hi = cpu_to_le32((pp->sg_tbl_dma[qc->hw_tag] >> 16) >> 16);
2178 crqb->flags = cpu_to_le32(flags); 2178 crqb->flags = cpu_to_le32(flags);
2179 2179
2180 crqb->ata_cmd[0] = cpu_to_le32( 2180 crqb->ata_cmd[0] = cpu_to_le32(
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index b6e9ad6d33c9..d83afc3dbf94 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -1342,11 +1342,11 @@ static void nv_adma_fill_sg(struct ata_queued_cmd *qc, struct nv_adma_cpb *cpb)
1342 1342
1343 for_each_sg(qc->sg, sg, qc->n_elem, si) { 1343 for_each_sg(qc->sg, sg, qc->n_elem, si) {
1344 aprd = (si < 5) ? &cpb->aprd[si] : 1344 aprd = (si < 5) ? &cpb->aprd[si] :
1345 &pp->aprd[NV_ADMA_SGTBL_LEN * qc->tag + (si-5)]; 1345 &pp->aprd[NV_ADMA_SGTBL_LEN * qc->hw_tag + (si-5)];
1346 nv_adma_fill_aprd(qc, sg, si, aprd); 1346 nv_adma_fill_aprd(qc, sg, si, aprd);
1347 } 1347 }
1348 if (si > 5) 1348 if (si > 5)
1349 cpb->next_aprd = cpu_to_le64(((u64)(pp->aprd_dma + NV_ADMA_SGTBL_SZ * qc->tag))); 1349 cpb->next_aprd = cpu_to_le64(((u64)(pp->aprd_dma + NV_ADMA_SGTBL_SZ * qc->hw_tag)));
1350 else 1350 else
1351 cpb->next_aprd = cpu_to_le64(0); 1351 cpb->next_aprd = cpu_to_le64(0);
1352} 1352}
@@ -1371,7 +1371,7 @@ static int nv_adma_use_reg_mode(struct ata_queued_cmd *qc)
1371static void nv_adma_qc_prep(struct ata_queued_cmd *qc) 1371static void nv_adma_qc_prep(struct ata_queued_cmd *qc)
1372{ 1372{
1373 struct nv_adma_port_priv *pp = qc->ap->private_data; 1373 struct nv_adma_port_priv *pp = qc->ap->private_data;
1374 struct nv_adma_cpb *cpb = &pp->cpb[qc->tag]; 1374 struct nv_adma_cpb *cpb = &pp->cpb[qc->hw_tag];
1375 u8 ctl_flags = NV_CPB_CTL_CPB_VALID | 1375 u8 ctl_flags = NV_CPB_CTL_CPB_VALID |
1376 NV_CPB_CTL_IEN; 1376 NV_CPB_CTL_IEN;
1377 1377
@@ -1389,7 +1389,7 @@ static void nv_adma_qc_prep(struct ata_queued_cmd *qc)
1389 wmb(); 1389 wmb();
1390 1390
1391 cpb->len = 3; 1391 cpb->len = 3;
1392 cpb->tag = qc->tag; 1392 cpb->tag = qc->hw_tag;
1393 cpb->next_cpb_idx = 0; 1393 cpb->next_cpb_idx = 0;
1394 1394
1395 /* turn on NCQ flags for NCQ commands */ 1395 /* turn on NCQ flags for NCQ commands */
@@ -1452,9 +1452,9 @@ static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc)
1452 pp->last_issue_ncq = curr_ncq; 1452 pp->last_issue_ncq = curr_ncq;
1453 } 1453 }
1454 1454
1455 writew(qc->tag, mmio + NV_ADMA_APPEND); 1455 writew(qc->hw_tag, mmio + NV_ADMA_APPEND);
1456 1456
1457 DPRINTK("Issued tag %u\n", qc->tag); 1457 DPRINTK("Issued tag %u\n", qc->hw_tag);
1458 1458
1459 return 0; 1459 return 0;
1460} 1460}
@@ -1716,8 +1716,8 @@ static void nv_swncq_qc_to_dq(struct ata_port *ap, struct ata_queued_cmd *qc)
1716 1716
1717 /* queue is full */ 1717 /* queue is full */
1718 WARN_ON(dq->tail - dq->head == ATA_MAX_QUEUE); 1718 WARN_ON(dq->tail - dq->head == ATA_MAX_QUEUE);
1719 dq->defer_bits |= (1 << qc->tag); 1719 dq->defer_bits |= (1 << qc->hw_tag);
1720 dq->tag[dq->tail++ & (ATA_MAX_QUEUE - 1)] = qc->tag; 1720 dq->tag[dq->tail++ & (ATA_MAX_QUEUE - 1)] = qc->hw_tag;
1721} 1721}
1722 1722
1723static struct ata_queued_cmd *nv_swncq_qc_from_dq(struct ata_port *ap) 1723static struct ata_queued_cmd *nv_swncq_qc_from_dq(struct ata_port *ap)
@@ -1996,7 +1996,7 @@ static void nv_swncq_fill_sg(struct ata_queued_cmd *qc)
1996 struct ata_bmdma_prd *prd; 1996 struct ata_bmdma_prd *prd;
1997 unsigned int si, idx; 1997 unsigned int si, idx;
1998 1998
1999 prd = pp->prd + ATA_MAX_PRD * qc->tag; 1999 prd = pp->prd + ATA_MAX_PRD * qc->hw_tag;
2000 2000
2001 idx = 0; 2001 idx = 0;
2002 for_each_sg(qc->sg, sg, qc->n_elem, si) { 2002 for_each_sg(qc->sg, sg, qc->n_elem, si) {
@@ -2034,16 +2034,16 @@ static unsigned int nv_swncq_issue_atacmd(struct ata_port *ap,
2034 2034
2035 DPRINTK("Enter\n"); 2035 DPRINTK("Enter\n");
2036 2036
2037 writel((1 << qc->tag), pp->sactive_block); 2037 writel((1 << qc->hw_tag), pp->sactive_block);
2038 pp->last_issue_tag = qc->tag; 2038 pp->last_issue_tag = qc->hw_tag;
2039 pp->dhfis_bits &= ~(1 << qc->tag); 2039 pp->dhfis_bits &= ~(1 << qc->hw_tag);
2040 pp->dmafis_bits &= ~(1 << qc->tag); 2040 pp->dmafis_bits &= ~(1 << qc->hw_tag);
2041 pp->qc_active |= (0x1 << qc->tag); 2041 pp->qc_active |= (0x1 << qc->hw_tag);
2042 2042
2043 ap->ops->sff_tf_load(ap, &qc->tf); /* load tf registers */ 2043 ap->ops->sff_tf_load(ap, &qc->tf); /* load tf registers */
2044 ap->ops->sff_exec_command(ap, &qc->tf); 2044 ap->ops->sff_exec_command(ap, &qc->tf);
2045 2045
2046 DPRINTK("Issued tag %u\n", qc->tag); 2046 DPRINTK("Issued tag %u\n", qc->hw_tag);
2047 2047
2048 return 0; 2048 return 0;
2049} 2049}
@@ -2193,7 +2193,7 @@ static void nv_swncq_dmafis(struct ata_port *ap)
2193 rw = qc->tf.flags & ATA_TFLAG_WRITE; 2193 rw = qc->tf.flags & ATA_TFLAG_WRITE;
2194 2194
2195 /* load PRD table addr. */ 2195 /* load PRD table addr. */
2196 iowrite32(pp->prd_dma + ATA_PRD_TBL_SZ * qc->tag, 2196 iowrite32(pp->prd_dma + ATA_PRD_TBL_SZ * qc->hw_tag,
2197 ap->ioaddr.bmdma_addr + ATA_DMA_TABLE_OFS); 2197 ap->ioaddr.bmdma_addr + ATA_DMA_TABLE_OFS);
2198 2198
2199 /* specify data direction, triple-check start bit is clear */ 2199 /* specify data direction, triple-check start bit is clear */
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 4b1995e2d044..227e63544233 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -849,7 +849,7 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc)
849 struct sil24_sge *sge; 849 struct sil24_sge *sge;
850 u16 ctrl = 0; 850 u16 ctrl = 0;
851 851
852 cb = &pp->cmd_block[sil24_tag(qc->tag)]; 852 cb = &pp->cmd_block[sil24_tag(qc->hw_tag)];
853 853
854 if (!ata_is_atapi(qc->tf.protocol)) { 854 if (!ata_is_atapi(qc->tf.protocol)) {
855 prb = &cb->ata.prb; 855 prb = &cb->ata.prb;
@@ -891,7 +891,7 @@ static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc)
891 struct ata_port *ap = qc->ap; 891 struct ata_port *ap = qc->ap;
892 struct sil24_port_priv *pp = ap->private_data; 892 struct sil24_port_priv *pp = ap->private_data;
893 void __iomem *port = sil24_port_base(ap); 893 void __iomem *port = sil24_port_base(ap);
894 unsigned int tag = sil24_tag(qc->tag); 894 unsigned int tag = sil24_tag(qc->hw_tag);
895 dma_addr_t paddr; 895 dma_addr_t paddr;
896 void __iomem *activate; 896 void __iomem *activate;
897 897
@@ -911,7 +911,7 @@ static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc)
911 911
912static bool sil24_qc_fill_rtf(struct ata_queued_cmd *qc) 912static bool sil24_qc_fill_rtf(struct ata_queued_cmd *qc)
913{ 913{
914 sil24_read_tf(qc->ap, qc->tag, &qc->result_tf); 914 sil24_read_tf(qc->ap, qc->hw_tag, &qc->result_tf);
915 return true; 915 return true;
916} 916}
917 917