diff options
Diffstat (limited to 'drivers/ata/sata_fsl.c')
-rw-r--r-- | drivers/ata/sata_fsl.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index 7325f77480d..b0214d00d50 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c | |||
@@ -678,7 +678,7 @@ static void sata_fsl_port_stop(struct ata_port *ap) | |||
678 | iowrite32(temp, hcr_base + HCONTROL); | 678 | iowrite32(temp, hcr_base + HCONTROL); |
679 | 679 | ||
680 | /* Poll for controller to go offline - should happen immediately */ | 680 | /* Poll for controller to go offline - should happen immediately */ |
681 | ata_wait_register(hcr_base + HSTATUS, ONLINE, ONLINE, 1, 1); | 681 | ata_wait_register(ap, hcr_base + HSTATUS, ONLINE, ONLINE, 1, 1); |
682 | 682 | ||
683 | ap->private_data = NULL; | 683 | ap->private_data = NULL; |
684 | dma_free_coherent(dev, SATA_FSL_PORT_PRIV_DMA_SZ, | 684 | dma_free_coherent(dev, SATA_FSL_PORT_PRIV_DMA_SZ, |
@@ -729,7 +729,8 @@ try_offline_again: | |||
729 | iowrite32(temp, hcr_base + HCONTROL); | 729 | iowrite32(temp, hcr_base + HCONTROL); |
730 | 730 | ||
731 | /* Poll for controller to go offline */ | 731 | /* Poll for controller to go offline */ |
732 | temp = ata_wait_register(hcr_base + HSTATUS, ONLINE, ONLINE, 1, 500); | 732 | temp = ata_wait_register(ap, hcr_base + HSTATUS, ONLINE, ONLINE, |
733 | 1, 500); | ||
733 | 734 | ||
734 | if (temp & ONLINE) { | 735 | if (temp & ONLINE) { |
735 | ata_port_printk(ap, KERN_ERR, | 736 | ata_port_printk(ap, KERN_ERR, |
@@ -752,7 +753,7 @@ try_offline_again: | |||
752 | /* | 753 | /* |
753 | * PHY reset should remain asserted for atleast 1ms | 754 | * PHY reset should remain asserted for atleast 1ms |
754 | */ | 755 | */ |
755 | msleep(1); | 756 | ata_msleep(ap, 1); |
756 | 757 | ||
757 | /* | 758 | /* |
758 | * Now, bring the host controller online again, this can take time | 759 | * Now, bring the host controller online again, this can take time |
@@ -766,7 +767,7 @@ try_offline_again: | |||
766 | temp |= HCONTROL_PMP_ATTACHED; | 767 | temp |= HCONTROL_PMP_ATTACHED; |
767 | iowrite32(temp, hcr_base + HCONTROL); | 768 | iowrite32(temp, hcr_base + HCONTROL); |
768 | 769 | ||
769 | temp = ata_wait_register(hcr_base + HSTATUS, ONLINE, 0, 1, 500); | 770 | temp = ata_wait_register(ap, hcr_base + HSTATUS, ONLINE, 0, 1, 500); |
770 | 771 | ||
771 | if (!(temp & ONLINE)) { | 772 | if (!(temp & ONLINE)) { |
772 | ata_port_printk(ap, KERN_ERR, | 773 | ata_port_printk(ap, KERN_ERR, |
@@ -784,7 +785,7 @@ try_offline_again: | |||
784 | * presence | 785 | * presence |
785 | */ | 786 | */ |
786 | 787 | ||
787 | temp = ata_wait_register(hcr_base + HSTATUS, 0xFF, 0, 1, 500); | 788 | temp = ata_wait_register(ap, hcr_base + HSTATUS, 0xFF, 0, 1, 500); |
788 | if ((!(temp & 0x10)) || ata_link_offline(link)) { | 789 | if ((!(temp & 0x10)) || ata_link_offline(link)) { |
789 | ata_port_printk(ap, KERN_WARNING, | 790 | ata_port_printk(ap, KERN_WARNING, |
790 | "No Device OR PHYRDY change,Hstatus = 0x%x\n", | 791 | "No Device OR PHYRDY change,Hstatus = 0x%x\n", |
@@ -797,7 +798,7 @@ try_offline_again: | |||
797 | * Wait for the first D2H from device,i.e,signature update notification | 798 | * Wait for the first D2H from device,i.e,signature update notification |
798 | */ | 799 | */ |
799 | start_jiffies = jiffies; | 800 | start_jiffies = jiffies; |
800 | temp = ata_wait_register(hcr_base + HSTATUS, 0xFF, 0x10, | 801 | temp = ata_wait_register(ap, hcr_base + HSTATUS, 0xFF, 0x10, |
801 | 500, jiffies_to_msecs(deadline - start_jiffies)); | 802 | 500, jiffies_to_msecs(deadline - start_jiffies)); |
802 | 803 | ||
803 | if ((temp & 0xFF) != 0x18) { | 804 | if ((temp & 0xFF) != 0x18) { |
@@ -880,7 +881,7 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class, | |||
880 | iowrite32(pmp, CQPMP + hcr_base); | 881 | iowrite32(pmp, CQPMP + hcr_base); |
881 | iowrite32(1, CQ + hcr_base); | 882 | iowrite32(1, CQ + hcr_base); |
882 | 883 | ||
883 | temp = ata_wait_register(CQ + hcr_base, 0x1, 0x1, 1, 5000); | 884 | temp = ata_wait_register(ap, CQ + hcr_base, 0x1, 0x1, 1, 5000); |
884 | if (temp & 0x1) { | 885 | if (temp & 0x1) { |
885 | ata_port_printk(ap, KERN_WARNING, "ATA_SRST issue failed\n"); | 886 | ata_port_printk(ap, KERN_WARNING, "ATA_SRST issue failed\n"); |
886 | 887 | ||
@@ -896,7 +897,7 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class, | |||
896 | goto err; | 897 | goto err; |
897 | } | 898 | } |
898 | 899 | ||
899 | msleep(1); | 900 | ata_msleep(ap, 1); |
900 | 901 | ||
901 | /* | 902 | /* |
902 | * SATA device enters reset state after receving a Control register | 903 | * SATA device enters reset state after receving a Control register |
@@ -915,7 +916,7 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class, | |||
915 | if (pmp != SATA_PMP_CTRL_PORT) | 916 | if (pmp != SATA_PMP_CTRL_PORT) |
916 | iowrite32(pmp, CQPMP + hcr_base); | 917 | iowrite32(pmp, CQPMP + hcr_base); |
917 | iowrite32(1, CQ + hcr_base); | 918 | iowrite32(1, CQ + hcr_base); |
918 | msleep(150); /* ?? */ | 919 | ata_msleep(ap, 150); /* ?? */ |
919 | 920 | ||
920 | /* | 921 | /* |
921 | * The above command would have signalled an interrupt on command | 922 | * The above command would have signalled an interrupt on command |
@@ -1137,17 +1138,13 @@ static void sata_fsl_host_intr(struct ata_port *ap) | |||
1137 | ioread32(hcr_base + CE)); | 1138 | ioread32(hcr_base + CE)); |
1138 | 1139 | ||
1139 | for (i = 0; i < SATA_FSL_QUEUE_DEPTH; i++) { | 1140 | for (i = 0; i < SATA_FSL_QUEUE_DEPTH; i++) { |
1140 | if (done_mask & (1 << i)) { | 1141 | if (done_mask & (1 << i)) |
1141 | qc = ata_qc_from_tag(ap, i); | ||
1142 | if (qc) { | ||
1143 | ata_qc_complete(qc); | ||
1144 | } | ||
1145 | DPRINTK | 1142 | DPRINTK |
1146 | ("completing ncq cmd,tag=%d,CC=0x%x,CA=0x%x\n", | 1143 | ("completing ncq cmd,tag=%d,CC=0x%x,CA=0x%x\n", |
1147 | i, ioread32(hcr_base + CC), | 1144 | i, ioread32(hcr_base + CC), |
1148 | ioread32(hcr_base + CA)); | 1145 | ioread32(hcr_base + CA)); |
1149 | } | ||
1150 | } | 1146 | } |
1147 | ata_qc_complete_multiple(ap, ap->qc_active ^ done_mask); | ||
1151 | return; | 1148 | return; |
1152 | 1149 | ||
1153 | } else if ((ap->qc_active & (1 << ATA_TAG_INTERNAL))) { | 1150 | } else if ((ap->qc_active & (1 << ATA_TAG_INTERNAL))) { |