diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-12-03 02:38:13 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-12-03 02:38:13 -0500 |
commit | 467832032cc07626880363efa8625719c16c04eb (patch) | |
tree | ee9a62c04f0b3106e412bc1b2dd1cea5566d5ca7 /drivers/ata | |
parent | 66d2a5952eab875f1286e04f738ef029afdaf013 (diff) | |
parent | 22763c5cf3690a681551162c15d34d935308c8d7 (diff) |
Merge commit 'v2.6.32' into next
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/ahci.c | 40 | ||||
-rw-r--r-- | drivers/ata/libata-core.c | 9 | ||||
-rw-r--r-- | drivers/ata/sata_fsl.c | 84 | ||||
-rw-r--r-- | drivers/ata/sata_via.c | 1 |
4 files changed, 85 insertions, 49 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index a06f5d6375a8..a3241a1a710b 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -2718,6 +2718,30 @@ static bool ahci_sb600_enable_64bit(struct pci_dev *pdev) | |||
2718 | }, | 2718 | }, |
2719 | .driver_data = "20071026", /* yyyymmdd */ | 2719 | .driver_data = "20071026", /* yyyymmdd */ |
2720 | }, | 2720 | }, |
2721 | /* | ||
2722 | * All BIOS versions for the MSI K9A2 Platinum (MS-7376) | ||
2723 | * support 64bit DMA. | ||
2724 | * | ||
2725 | * BIOS versions earlier than 1.5 had the Manufacturer DMI | ||
2726 | * fields as "MICRO-STAR INTERANTIONAL CO.,LTD". | ||
2727 | * This spelling mistake was fixed in BIOS version 1.5, so | ||
2728 | * 1.5 and later have the Manufacturer as | ||
2729 | * "MICRO-STAR INTERNATIONAL CO.,LTD". | ||
2730 | * So try to match on DMI_BOARD_VENDOR of "MICRO-STAR INTER". | ||
2731 | * | ||
2732 | * BIOS versions earlier than 1.9 had a Board Product Name | ||
2733 | * DMI field of "MS-7376". This was changed to be | ||
2734 | * "K9A2 Platinum (MS-7376)" in version 1.9, but we can still | ||
2735 | * match on DMI_BOARD_NAME of "MS-7376". | ||
2736 | */ | ||
2737 | { | ||
2738 | .ident = "MSI K9A2 Platinum", | ||
2739 | .matches = { | ||
2740 | DMI_MATCH(DMI_BOARD_VENDOR, | ||
2741 | "MICRO-STAR INTER"), | ||
2742 | DMI_MATCH(DMI_BOARD_NAME, "MS-7376"), | ||
2743 | }, | ||
2744 | }, | ||
2721 | { } | 2745 | { } |
2722 | }; | 2746 | }; |
2723 | const struct dmi_system_id *match; | 2747 | const struct dmi_system_id *match; |
@@ -2729,18 +2753,24 @@ static bool ahci_sb600_enable_64bit(struct pci_dev *pdev) | |||
2729 | !match) | 2753 | !match) |
2730 | return false; | 2754 | return false; |
2731 | 2755 | ||
2756 | if (!match->driver_data) | ||
2757 | goto enable_64bit; | ||
2758 | |||
2732 | dmi_get_date(DMI_BIOS_DATE, &year, &month, &date); | 2759 | dmi_get_date(DMI_BIOS_DATE, &year, &month, &date); |
2733 | snprintf(buf, sizeof(buf), "%04d%02d%02d", year, month, date); | 2760 | snprintf(buf, sizeof(buf), "%04d%02d%02d", year, month, date); |
2734 | 2761 | ||
2735 | if (strcmp(buf, match->driver_data) >= 0) { | 2762 | if (strcmp(buf, match->driver_data) >= 0) |
2736 | dev_printk(KERN_WARNING, &pdev->dev, "%s: enabling 64bit DMA\n", | 2763 | goto enable_64bit; |
2737 | match->ident); | 2764 | else { |
2738 | return true; | ||
2739 | } else { | ||
2740 | dev_printk(KERN_WARNING, &pdev->dev, "%s: BIOS too old, " | 2765 | dev_printk(KERN_WARNING, &pdev->dev, "%s: BIOS too old, " |
2741 | "forcing 32bit DMA, update BIOS\n", match->ident); | 2766 | "forcing 32bit DMA, update BIOS\n", match->ident); |
2742 | return false; | 2767 | return false; |
2743 | } | 2768 | } |
2769 | |||
2770 | enable_64bit: | ||
2771 | dev_printk(KERN_WARNING, &pdev->dev, "%s: enabling 64bit DMA\n", | ||
2772 | match->ident); | ||
2773 | return true; | ||
2744 | } | 2774 | } |
2745 | 2775 | ||
2746 | static bool ahci_broken_system_poweroff(struct pci_dev *pdev) | 2776 | static bool ahci_broken_system_poweroff(struct pci_dev *pdev) |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index d7f0f1b1ae3e..dc72690ed5db 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -4919,10 +4919,11 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev) | |||
4919 | */ | 4919 | */ |
4920 | void ata_qc_free(struct ata_queued_cmd *qc) | 4920 | void ata_qc_free(struct ata_queued_cmd *qc) |
4921 | { | 4921 | { |
4922 | struct ata_port *ap = qc->ap; | 4922 | struct ata_port *ap; |
4923 | unsigned int tag; | 4923 | unsigned int tag; |
4924 | 4924 | ||
4925 | WARN_ON_ONCE(qc == NULL); /* ata_qc_from_tag _might_ return NULL */ | 4925 | WARN_ON_ONCE(qc == NULL); /* ata_qc_from_tag _might_ return NULL */ |
4926 | ap = qc->ap; | ||
4926 | 4927 | ||
4927 | qc->flags = 0; | 4928 | qc->flags = 0; |
4928 | tag = qc->tag; | 4929 | tag = qc->tag; |
@@ -4934,11 +4935,13 @@ void ata_qc_free(struct ata_queued_cmd *qc) | |||
4934 | 4935 | ||
4935 | void __ata_qc_complete(struct ata_queued_cmd *qc) | 4936 | void __ata_qc_complete(struct ata_queued_cmd *qc) |
4936 | { | 4937 | { |
4937 | struct ata_port *ap = qc->ap; | 4938 | struct ata_port *ap; |
4938 | struct ata_link *link = qc->dev->link; | 4939 | struct ata_link *link; |
4939 | 4940 | ||
4940 | WARN_ON_ONCE(qc == NULL); /* ata_qc_from_tag _might_ return NULL */ | 4941 | WARN_ON_ONCE(qc == NULL); /* ata_qc_from_tag _might_ return NULL */ |
4941 | WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE)); | 4942 | WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE)); |
4943 | ap = qc->ap; | ||
4944 | link = qc->dev->link; | ||
4942 | 4945 | ||
4943 | if (likely(qc->flags & ATA_QCFLAG_DMAMAP)) | 4946 | if (likely(qc->flags & ATA_QCFLAG_DMAMAP)) |
4944 | ata_sg_clean(qc); | 4947 | ata_sg_clean(qc); |
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index d344db42a002..172b57e6543f 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c | |||
@@ -707,34 +707,17 @@ static unsigned int sata_fsl_dev_classify(struct ata_port *ap) | |||
707 | return ata_dev_classify(&tf); | 707 | return ata_dev_classify(&tf); |
708 | } | 708 | } |
709 | 709 | ||
710 | static int sata_fsl_prereset(struct ata_link *link, unsigned long deadline) | 710 | static int sata_fsl_hardreset(struct ata_link *link, unsigned int *class, |
711 | { | ||
712 | /* FIXME: Never skip softreset, sata_fsl_softreset() is | ||
713 | * combination of soft and hard resets. sata_fsl_softreset() | ||
714 | * needs to be splitted into soft and hard resets. | ||
715 | */ | ||
716 | return 0; | ||
717 | } | ||
718 | |||
719 | static int sata_fsl_softreset(struct ata_link *link, unsigned int *class, | ||
720 | unsigned long deadline) | 711 | unsigned long deadline) |
721 | { | 712 | { |
722 | struct ata_port *ap = link->ap; | 713 | struct ata_port *ap = link->ap; |
723 | struct sata_fsl_port_priv *pp = ap->private_data; | ||
724 | struct sata_fsl_host_priv *host_priv = ap->host->private_data; | 714 | struct sata_fsl_host_priv *host_priv = ap->host->private_data; |
725 | void __iomem *hcr_base = host_priv->hcr_base; | 715 | void __iomem *hcr_base = host_priv->hcr_base; |
726 | int pmp = sata_srst_pmp(link); | ||
727 | u32 temp; | 716 | u32 temp; |
728 | struct ata_taskfile tf; | ||
729 | u8 *cfis; | ||
730 | u32 Serror; | ||
731 | int i = 0; | 717 | int i = 0; |
732 | unsigned long start_jiffies; | 718 | unsigned long start_jiffies; |
733 | 719 | ||
734 | DPRINTK("in xx_softreset\n"); | 720 | DPRINTK("in xx_hardreset\n"); |
735 | |||
736 | if (pmp != SATA_PMP_CTRL_PORT) | ||
737 | goto issue_srst; | ||
738 | 721 | ||
739 | try_offline_again: | 722 | try_offline_again: |
740 | /* | 723 | /* |
@@ -749,7 +732,7 @@ try_offline_again: | |||
749 | 732 | ||
750 | if (temp & ONLINE) { | 733 | if (temp & ONLINE) { |
751 | ata_port_printk(ap, KERN_ERR, | 734 | ata_port_printk(ap, KERN_ERR, |
752 | "Softreset failed, not off-lined %d\n", i); | 735 | "Hardreset failed, not off-lined %d\n", i); |
753 | 736 | ||
754 | /* | 737 | /* |
755 | * Try to offline controller atleast twice | 738 | * Try to offline controller atleast twice |
@@ -761,7 +744,7 @@ try_offline_again: | |||
761 | goto try_offline_again; | 744 | goto try_offline_again; |
762 | } | 745 | } |
763 | 746 | ||
764 | DPRINTK("softreset, controller off-lined\n"); | 747 | DPRINTK("hardreset, controller off-lined\n"); |
765 | VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS)); | 748 | VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS)); |
766 | VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL)); | 749 | VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL)); |
767 | 750 | ||
@@ -786,11 +769,11 @@ try_offline_again: | |||
786 | 769 | ||
787 | if (!(temp & ONLINE)) { | 770 | if (!(temp & ONLINE)) { |
788 | ata_port_printk(ap, KERN_ERR, | 771 | ata_port_printk(ap, KERN_ERR, |
789 | "Softreset failed, not on-lined\n"); | 772 | "Hardreset failed, not on-lined\n"); |
790 | goto err; | 773 | goto err; |
791 | } | 774 | } |
792 | 775 | ||
793 | DPRINTK("softreset, controller off-lined & on-lined\n"); | 776 | DPRINTK("hardreset, controller off-lined & on-lined\n"); |
794 | VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS)); | 777 | VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS)); |
795 | VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL)); | 778 | VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL)); |
796 | 779 | ||
@@ -806,7 +789,7 @@ try_offline_again: | |||
806 | "No Device OR PHYRDY change,Hstatus = 0x%x\n", | 789 | "No Device OR PHYRDY change,Hstatus = 0x%x\n", |
807 | ioread32(hcr_base + HSTATUS)); | 790 | ioread32(hcr_base + HSTATUS)); |
808 | *class = ATA_DEV_NONE; | 791 | *class = ATA_DEV_NONE; |
809 | goto out; | 792 | return 0; |
810 | } | 793 | } |
811 | 794 | ||
812 | /* | 795 | /* |
@@ -819,11 +802,44 @@ try_offline_again: | |||
819 | if ((temp & 0xFF) != 0x18) { | 802 | if ((temp & 0xFF) != 0x18) { |
820 | ata_port_printk(ap, KERN_WARNING, "No Signature Update\n"); | 803 | ata_port_printk(ap, KERN_WARNING, "No Signature Update\n"); |
821 | *class = ATA_DEV_NONE; | 804 | *class = ATA_DEV_NONE; |
822 | goto out; | 805 | goto do_followup_srst; |
823 | } else { | 806 | } else { |
824 | ata_port_printk(ap, KERN_INFO, | 807 | ata_port_printk(ap, KERN_INFO, |
825 | "Signature Update detected @ %d msecs\n", | 808 | "Signature Update detected @ %d msecs\n", |
826 | jiffies_to_msecs(jiffies - start_jiffies)); | 809 | jiffies_to_msecs(jiffies - start_jiffies)); |
810 | *class = sata_fsl_dev_classify(ap); | ||
811 | return 0; | ||
812 | } | ||
813 | |||
814 | do_followup_srst: | ||
815 | /* | ||
816 | * request libATA to perform follow-up softreset | ||
817 | */ | ||
818 | return -EAGAIN; | ||
819 | |||
820 | err: | ||
821 | return -EIO; | ||
822 | } | ||
823 | |||
824 | static int sata_fsl_softreset(struct ata_link *link, unsigned int *class, | ||
825 | unsigned long deadline) | ||
826 | { | ||
827 | struct ata_port *ap = link->ap; | ||
828 | struct sata_fsl_port_priv *pp = ap->private_data; | ||
829 | struct sata_fsl_host_priv *host_priv = ap->host->private_data; | ||
830 | void __iomem *hcr_base = host_priv->hcr_base; | ||
831 | int pmp = sata_srst_pmp(link); | ||
832 | u32 temp; | ||
833 | struct ata_taskfile tf; | ||
834 | u8 *cfis; | ||
835 | u32 Serror; | ||
836 | |||
837 | DPRINTK("in xx_softreset\n"); | ||
838 | |||
839 | if (ata_link_offline(link)) { | ||
840 | DPRINTK("PHY reports no device\n"); | ||
841 | *class = ATA_DEV_NONE; | ||
842 | return 0; | ||
827 | } | 843 | } |
828 | 844 | ||
829 | /* | 845 | /* |
@@ -834,7 +850,6 @@ try_offline_again: | |||
834 | * reached here, we can send a command to the target device | 850 | * reached here, we can send a command to the target device |
835 | */ | 851 | */ |
836 | 852 | ||
837 | issue_srst: | ||
838 | DPRINTK("Sending SRST/device reset\n"); | 853 | DPRINTK("Sending SRST/device reset\n"); |
839 | 854 | ||
840 | ata_tf_init(link->device, &tf); | 855 | ata_tf_init(link->device, &tf); |
@@ -860,6 +875,8 @@ issue_srst: | |||
860 | ioread32(CA + hcr_base), ioread32(CC + hcr_base)); | 875 | ioread32(CA + hcr_base), ioread32(CC + hcr_base)); |
861 | 876 | ||
862 | iowrite32(0xFFFF, CC + hcr_base); | 877 | iowrite32(0xFFFF, CC + hcr_base); |
878 | if (pmp != SATA_PMP_CTRL_PORT) | ||
879 | iowrite32(pmp, CQPMP + hcr_base); | ||
863 | iowrite32(1, CQ + hcr_base); | 880 | iowrite32(1, CQ + hcr_base); |
864 | 881 | ||
865 | temp = ata_wait_register(CQ + hcr_base, 0x1, 0x1, 1, 5000); | 882 | temp = ata_wait_register(CQ + hcr_base, 0x1, 0x1, 1, 5000); |
@@ -926,7 +943,6 @@ issue_srst: | |||
926 | VPRINTK("cereg = 0x%x\n", ioread32(hcr_base + CE)); | 943 | VPRINTK("cereg = 0x%x\n", ioread32(hcr_base + CE)); |
927 | } | 944 | } |
928 | 945 | ||
929 | out: | ||
930 | return 0; | 946 | return 0; |
931 | 947 | ||
932 | err: | 948 | err: |
@@ -988,18 +1004,6 @@ static void sata_fsl_error_intr(struct ata_port *ap) | |||
988 | ehi->err_mask |= AC_ERR_ATA_BUS; | 1004 | ehi->err_mask |= AC_ERR_ATA_BUS; |
989 | ehi->action |= ATA_EH_SOFTRESET; | 1005 | ehi->action |= ATA_EH_SOFTRESET; |
990 | 1006 | ||
991 | /* | ||
992 | * Ignore serror in case of fatal errors as we always want | ||
993 | * to do a soft-reset of the FSL SATA controller. Analyzing | ||
994 | * serror may cause libata to schedule a hard-reset action, | ||
995 | * and hard-reset currently does not do controller | ||
996 | * offline/online, causing command timeouts and leads to an | ||
997 | * un-recoverable state, hence make libATA ignore | ||
998 | * autopsy in case of fatal errors. | ||
999 | */ | ||
1000 | |||
1001 | ehi->flags |= ATA_EHI_NO_AUTOPSY; | ||
1002 | |||
1003 | freeze = 1; | 1007 | freeze = 1; |
1004 | } | 1008 | } |
1005 | 1009 | ||
@@ -1267,8 +1271,8 @@ static struct ata_port_operations sata_fsl_ops = { | |||
1267 | 1271 | ||
1268 | .freeze = sata_fsl_freeze, | 1272 | .freeze = sata_fsl_freeze, |
1269 | .thaw = sata_fsl_thaw, | 1273 | .thaw = sata_fsl_thaw, |
1270 | .prereset = sata_fsl_prereset, | ||
1271 | .softreset = sata_fsl_softreset, | 1274 | .softreset = sata_fsl_softreset, |
1275 | .hardreset = sata_fsl_hardreset, | ||
1272 | .pmp_softreset = sata_fsl_softreset, | 1276 | .pmp_softreset = sata_fsl_softreset, |
1273 | .error_handler = sata_fsl_error_handler, | 1277 | .error_handler = sata_fsl_error_handler, |
1274 | .post_internal_cmd = sata_fsl_post_internal_cmd, | 1278 | .post_internal_cmd = sata_fsl_post_internal_cmd, |
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c index bdd43c7f432e..02efd9a83d26 100644 --- a/drivers/ata/sata_via.c +++ b/drivers/ata/sata_via.c | |||
@@ -93,7 +93,6 @@ static const struct pci_device_id svia_pci_tbl[] = { | |||
93 | { PCI_VDEVICE(VIA, 0x7372), vt6420 }, | 93 | { PCI_VDEVICE(VIA, 0x7372), vt6420 }, |
94 | { PCI_VDEVICE(VIA, 0x5287), vt8251 }, /* 2 sata chnls (Master/Slave) */ | 94 | { PCI_VDEVICE(VIA, 0x5287), vt8251 }, /* 2 sata chnls (Master/Slave) */ |
95 | { PCI_VDEVICE(VIA, 0x9000), vt8251 }, | 95 | { PCI_VDEVICE(VIA, 0x9000), vt8251 }, |
96 | { PCI_VDEVICE(VIA, 0x9040), vt8251 }, | ||
97 | 96 | ||
98 | { } /* terminate list */ | 97 | { } /* terminate list */ |
99 | }; | 98 | }; |