diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-11 23:42:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-11 23:42:11 -0500 |
commit | a17b7a398d5c20ccbcb11f98dc2a76a6f07934ad (patch) | |
tree | 8c044501818c13b35bdc45ac5bf3189bfd556deb | |
parent | 271cad6d7e91ff8eea18976311692f99cd667ad3 (diff) | |
parent | fbf14e2f2d674e6a2ff0fb2aa569e7f6687483a3 (diff) |
Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
sata_mv: platform driver allocs dma without create
pata_ninja32: setup changes
pata_legacy: typo fix
pata_amd: Note in the module description it handles Nvidia
sata_mv: fix loop with last port
libata: ignore deverr on SETXFER if mode is configured
pata_via: fix SATA cable detection on cx700
-rw-r--r-- | drivers/ata/libata-core.c | 48 | ||||
-rw-r--r-- | drivers/ata/pata_amd.c | 2 | ||||
-rw-r--r-- | drivers/ata/pata_legacy.c | 2 | ||||
-rw-r--r-- | drivers/ata/pata_ninja32.c | 9 | ||||
-rw-r--r-- | drivers/ata/pata_via.c | 6 | ||||
-rw-r--r-- | drivers/ata/sata_mv.c | 50 |
6 files changed, 75 insertions, 42 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 3011919f3ec8..004dae4ea5bc 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -3048,6 +3048,8 @@ int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel) | |||
3048 | static int ata_dev_set_mode(struct ata_device *dev) | 3048 | static int ata_dev_set_mode(struct ata_device *dev) |
3049 | { | 3049 | { |
3050 | struct ata_eh_context *ehc = &dev->link->eh_context; | 3050 | struct ata_eh_context *ehc = &dev->link->eh_context; |
3051 | const char *dev_err_whine = ""; | ||
3052 | int ign_dev_err = 0; | ||
3051 | unsigned int err_mask; | 3053 | unsigned int err_mask; |
3052 | int rc; | 3054 | int rc; |
3053 | 3055 | ||
@@ -3057,41 +3059,57 @@ static int ata_dev_set_mode(struct ata_device *dev) | |||
3057 | 3059 | ||
3058 | err_mask = ata_dev_set_xfermode(dev); | 3060 | err_mask = ata_dev_set_xfermode(dev); |
3059 | 3061 | ||
3062 | if (err_mask & ~AC_ERR_DEV) | ||
3063 | goto fail; | ||
3064 | |||
3065 | /* revalidate */ | ||
3066 | ehc->i.flags |= ATA_EHI_POST_SETMODE; | ||
3067 | rc = ata_dev_revalidate(dev, ATA_DEV_UNKNOWN, 0); | ||
3068 | ehc->i.flags &= ~ATA_EHI_POST_SETMODE; | ||
3069 | if (rc) | ||
3070 | return rc; | ||
3071 | |||
3060 | /* Old CFA may refuse this command, which is just fine */ | 3072 | /* Old CFA may refuse this command, which is just fine */ |
3061 | if (dev->xfer_shift == ATA_SHIFT_PIO && ata_id_is_cfa(dev->id)) | 3073 | if (dev->xfer_shift == ATA_SHIFT_PIO && ata_id_is_cfa(dev->id)) |
3062 | err_mask &= ~AC_ERR_DEV; | 3074 | ign_dev_err = 1; |
3063 | 3075 | ||
3064 | /* Some very old devices and some bad newer ones fail any kind of | 3076 | /* Some very old devices and some bad newer ones fail any kind of |
3065 | SET_XFERMODE request but support PIO0-2 timings and no IORDY */ | 3077 | SET_XFERMODE request but support PIO0-2 timings and no IORDY */ |
3066 | if (dev->xfer_shift == ATA_SHIFT_PIO && !ata_id_has_iordy(dev->id) && | 3078 | if (dev->xfer_shift == ATA_SHIFT_PIO && !ata_id_has_iordy(dev->id) && |
3067 | dev->pio_mode <= XFER_PIO_2) | 3079 | dev->pio_mode <= XFER_PIO_2) |
3068 | err_mask &= ~AC_ERR_DEV; | 3080 | ign_dev_err = 1; |
3069 | 3081 | ||
3070 | /* Early MWDMA devices do DMA but don't allow DMA mode setting. | 3082 | /* Early MWDMA devices do DMA but don't allow DMA mode setting. |
3071 | Don't fail an MWDMA0 set IFF the device indicates it is in MWDMA0 */ | 3083 | Don't fail an MWDMA0 set IFF the device indicates it is in MWDMA0 */ |
3072 | if (dev->xfer_shift == ATA_SHIFT_MWDMA && | 3084 | if (dev->xfer_shift == ATA_SHIFT_MWDMA && |
3073 | dev->dma_mode == XFER_MW_DMA_0 && | 3085 | dev->dma_mode == XFER_MW_DMA_0 && |
3074 | (dev->id[63] >> 8) & 1) | 3086 | (dev->id[63] >> 8) & 1) |
3075 | err_mask &= ~AC_ERR_DEV; | 3087 | ign_dev_err = 1; |
3076 | 3088 | ||
3077 | if (err_mask) { | 3089 | /* if the device is actually configured correctly, ignore dev err */ |
3078 | ata_dev_printk(dev, KERN_ERR, "failed to set xfermode " | 3090 | if (dev->xfer_mode == ata_xfer_mask2mode(ata_id_xfermask(dev->id))) |
3079 | "(err_mask=0x%x)\n", err_mask); | 3091 | ign_dev_err = 1; |
3080 | return -EIO; | ||
3081 | } | ||
3082 | 3092 | ||
3083 | ehc->i.flags |= ATA_EHI_POST_SETMODE; | 3093 | if (err_mask & AC_ERR_DEV) { |
3084 | rc = ata_dev_revalidate(dev, ATA_DEV_UNKNOWN, 0); | 3094 | if (!ign_dev_err) |
3085 | ehc->i.flags &= ~ATA_EHI_POST_SETMODE; | 3095 | goto fail; |
3086 | if (rc) | 3096 | else |
3087 | return rc; | 3097 | dev_err_whine = " (device error ignored)"; |
3098 | } | ||
3088 | 3099 | ||
3089 | DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n", | 3100 | DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n", |
3090 | dev->xfer_shift, (int)dev->xfer_mode); | 3101 | dev->xfer_shift, (int)dev->xfer_mode); |
3091 | 3102 | ||
3092 | ata_dev_printk(dev, KERN_INFO, "configured for %s\n", | 3103 | ata_dev_printk(dev, KERN_INFO, "configured for %s%s\n", |
3093 | ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode))); | 3104 | ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode)), |
3105 | dev_err_whine); | ||
3106 | |||
3094 | return 0; | 3107 | return 0; |
3108 | |||
3109 | fail: | ||
3110 | ata_dev_printk(dev, KERN_ERR, "failed to set xfermode " | ||
3111 | "(err_mask=0x%x)\n", err_mask); | ||
3112 | return -EIO; | ||
3095 | } | 3113 | } |
3096 | 3114 | ||
3097 | /** | 3115 | /** |
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c index 761a66608d7b..ea567e2b1703 100644 --- a/drivers/ata/pata_amd.c +++ b/drivers/ata/pata_amd.c | |||
@@ -772,7 +772,7 @@ static void __exit amd_exit(void) | |||
772 | } | 772 | } |
773 | 773 | ||
774 | MODULE_AUTHOR("Alan Cox"); | 774 | MODULE_AUTHOR("Alan Cox"); |
775 | MODULE_DESCRIPTION("low-level driver for AMD PATA IDE"); | 775 | MODULE_DESCRIPTION("low-level driver for AMD and Nvidia PATA IDE"); |
776 | MODULE_LICENSE("GPL"); | 776 | MODULE_LICENSE("GPL"); |
777 | MODULE_DEVICE_TABLE(pci, amd); | 777 | MODULE_DEVICE_TABLE(pci, amd); |
778 | MODULE_VERSION(DRV_VERSION); | 778 | MODULE_VERSION(DRV_VERSION); |
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c index 333dc15f8ccf..6c59969fd50b 100644 --- a/drivers/ata/pata_legacy.c +++ b/drivers/ata/pata_legacy.c | |||
@@ -127,7 +127,7 @@ static int opti82c611a; /* Opti82c611A on primary 1, sec 2, both 3 */ | |||
127 | static int opti82c46x; /* Opti 82c465MV present(pri/sec autodetect) */ | 127 | static int opti82c46x; /* Opti 82c465MV present(pri/sec autodetect) */ |
128 | static int qdi; /* Set to probe QDI controllers */ | 128 | static int qdi; /* Set to probe QDI controllers */ |
129 | static int winbond; /* Set to probe Winbond controllers, | 129 | static int winbond; /* Set to probe Winbond controllers, |
130 | give I/O port if non stdanard */ | 130 | give I/O port if non standard */ |
131 | static int autospeed; /* Chip present which snoops speed changes */ | 131 | static int autospeed; /* Chip present which snoops speed changes */ |
132 | static int pio_mask = 0x1F; /* PIO range for autospeed devices */ | 132 | static int pio_mask = 0x1F; /* PIO range for autospeed devices */ |
133 | static int iordy_mask = 0xFFFFFFFF; /* Use iordy if available */ | 133 | static int iordy_mask = 0xFFFFFFFF; /* Use iordy if available */ |
diff --git a/drivers/ata/pata_ninja32.c b/drivers/ata/pata_ninja32.c index 1c1b83541d13..15dd649f89ee 100644 --- a/drivers/ata/pata_ninja32.c +++ b/drivers/ata/pata_ninja32.c | |||
@@ -17,6 +17,7 @@ | |||
17 | * Base + 0x00 IRQ Status | 17 | * Base + 0x00 IRQ Status |
18 | * Base + 0x01 IRQ control | 18 | * Base + 0x01 IRQ control |
19 | * Base + 0x02 Chipset control | 19 | * Base + 0x02 Chipset control |
20 | * Base + 0x03 Unknown | ||
20 | * Base + 0x04 VDMA and reset control + wait bits | 21 | * Base + 0x04 VDMA and reset control + wait bits |
21 | * Base + 0x08 BMIMBA | 22 | * Base + 0x08 BMIMBA |
22 | * Base + 0x0C DMA Length | 23 | * Base + 0x0C DMA Length |
@@ -174,8 +175,12 @@ static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
174 | ata_std_ports(&ap->ioaddr); | 175 | ata_std_ports(&ap->ioaddr); |
175 | 176 | ||
176 | iowrite8(0x05, base + 0x01); /* Enable interrupt lines */ | 177 | iowrite8(0x05, base + 0x01); /* Enable interrupt lines */ |
177 | iowrite8(0xB3, base + 0x02); /* Burst, ?? setup */ | 178 | iowrite8(0xBE, base + 0x02); /* Burst, ?? setup */ |
178 | iowrite8(0x00, base + 0x04); /* WAIT0 ? */ | 179 | iowrite8(0x01, base + 0x03); /* Unknown */ |
180 | iowrite8(0x20, base + 0x04); /* WAIT0 */ | ||
181 | iowrite8(0x8f, base + 0x05); /* Unknown */ | ||
182 | iowrite8(0xa4, base + 0x1c); /* Unknown */ | ||
183 | iowrite8(0x83, base + 0x1d); /* BMDMA control: WAIT0 */ | ||
179 | /* FIXME: Should we disable them at remove ? */ | 184 | /* FIXME: Should we disable them at remove ? */ |
180 | return ata_host_activate(host, dev->irq, ata_interrupt, | 185 | return ata_host_activate(host, dev->irq, ata_interrupt, |
181 | IRQF_SHARED, &ninja32_sht); | 186 | IRQF_SHARED, &ninja32_sht); |
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index 39627ab684bf..d119a68c388f 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c | |||
@@ -84,6 +84,7 @@ enum { | |||
84 | VIA_BAD_ID = 0x100, /* Has wrong vendor ID (0x1107) */ | 84 | VIA_BAD_ID = 0x100, /* Has wrong vendor ID (0x1107) */ |
85 | VIA_BAD_AST = 0x200, /* Don't touch Address Setup Timing */ | 85 | VIA_BAD_AST = 0x200, /* Don't touch Address Setup Timing */ |
86 | VIA_NO_ENABLES = 0x400, /* Has no enablebits */ | 86 | VIA_NO_ENABLES = 0x400, /* Has no enablebits */ |
87 | VIA_SATA_PATA = 0x800, /* SATA/PATA combined configuration */ | ||
87 | }; | 88 | }; |
88 | 89 | ||
89 | /* | 90 | /* |
@@ -100,7 +101,7 @@ static const struct via_isa_bridge { | |||
100 | { "vx800", PCI_DEVICE_ID_VIA_VX800, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | 101 | { "vx800", PCI_DEVICE_ID_VIA_VX800, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, |
101 | { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | 102 | { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, |
102 | { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | 103 | { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, |
103 | { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | 104 | { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA }, |
104 | { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES}, | 105 | { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES}, |
105 | { "vt8237a", PCI_DEVICE_ID_VIA_8237A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | 106 | { "vt8237a", PCI_DEVICE_ID_VIA_8237A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, |
106 | { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | 107 | { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, |
@@ -172,6 +173,9 @@ static int via_cable_detect(struct ata_port *ap) { | |||
172 | if (via_cable_override(pdev)) | 173 | if (via_cable_override(pdev)) |
173 | return ATA_CBL_PATA40_SHORT; | 174 | return ATA_CBL_PATA40_SHORT; |
174 | 175 | ||
176 | if ((config->flags & VIA_SATA_PATA) && ap->port_no == 0) | ||
177 | return ATA_CBL_SATA; | ||
178 | |||
175 | /* Early chips are 40 wire */ | 179 | /* Early chips are 40 wire */ |
176 | if ((config->flags & VIA_UDMA) < VIA_UDMA_66) | 180 | if ((config->flags & VIA_UDMA) < VIA_UDMA_66) |
177 | return ATA_CBL_PATA40; | 181 | return ATA_CBL_PATA40; |
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 080b8362f8d6..04b571764aff 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -1716,14 +1716,16 @@ static void mv_host_intr(struct ata_host *host, u32 relevant, unsigned int hc) | |||
1716 | VPRINTK("ENTER, hc%u relevant=0x%08x HC IRQ cause=0x%08x\n", | 1716 | VPRINTK("ENTER, hc%u relevant=0x%08x HC IRQ cause=0x%08x\n", |
1717 | hc, relevant, hc_irq_cause); | 1717 | hc, relevant, hc_irq_cause); |
1718 | 1718 | ||
1719 | for (port = port0; port < port0 + last_port; port++) { | 1719 | for (port = port0; port < last_port; port++) { |
1720 | struct ata_port *ap = host->ports[port]; | 1720 | struct ata_port *ap = host->ports[port]; |
1721 | struct mv_port_priv *pp = ap->private_data; | 1721 | struct mv_port_priv *pp; |
1722 | int have_err_bits, hard_port, shift; | 1722 | int have_err_bits, hard_port, shift; |
1723 | 1723 | ||
1724 | if ((!ap) || (ap->flags & ATA_FLAG_DISABLED)) | 1724 | if ((!ap) || (ap->flags & ATA_FLAG_DISABLED)) |
1725 | continue; | 1725 | continue; |
1726 | 1726 | ||
1727 | pp = ap->private_data; | ||
1728 | |||
1727 | shift = port << 1; /* (port * 2) */ | 1729 | shift = port << 1; /* (port * 2) */ |
1728 | if (port >= MV_PORTS_PER_HC) { | 1730 | if (port >= MV_PORTS_PER_HC) { |
1729 | shift++; /* skip bit 8 in the HC Main IRQ reg */ | 1731 | shift++; /* skip bit 8 in the HC Main IRQ reg */ |
@@ -2879,6 +2881,26 @@ done: | |||
2879 | return rc; | 2881 | return rc; |
2880 | } | 2882 | } |
2881 | 2883 | ||
2884 | static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev) | ||
2885 | { | ||
2886 | hpriv->crqb_pool = dmam_pool_create("crqb_q", dev, MV_CRQB_Q_SZ, | ||
2887 | MV_CRQB_Q_SZ, 0); | ||
2888 | if (!hpriv->crqb_pool) | ||
2889 | return -ENOMEM; | ||
2890 | |||
2891 | hpriv->crpb_pool = dmam_pool_create("crpb_q", dev, MV_CRPB_Q_SZ, | ||
2892 | MV_CRPB_Q_SZ, 0); | ||
2893 | if (!hpriv->crpb_pool) | ||
2894 | return -ENOMEM; | ||
2895 | |||
2896 | hpriv->sg_tbl_pool = dmam_pool_create("sg_tbl", dev, MV_SG_TBL_SZ, | ||
2897 | MV_SG_TBL_SZ, 0); | ||
2898 | if (!hpriv->sg_tbl_pool) | ||
2899 | return -ENOMEM; | ||
2900 | |||
2901 | return 0; | ||
2902 | } | ||
2903 | |||
2882 | /** | 2904 | /** |
2883 | * mv_platform_probe - handle a positive probe of an soc Marvell | 2905 | * mv_platform_probe - handle a positive probe of an soc Marvell |
2884 | * host | 2906 | * host |
@@ -2932,6 +2954,10 @@ static int mv_platform_probe(struct platform_device *pdev) | |||
2932 | hpriv->base = ioremap(res->start, res->end - res->start + 1); | 2954 | hpriv->base = ioremap(res->start, res->end - res->start + 1); |
2933 | hpriv->base -= MV_SATAHC0_REG_BASE; | 2955 | hpriv->base -= MV_SATAHC0_REG_BASE; |
2934 | 2956 | ||
2957 | rc = mv_create_dma_pools(hpriv, &pdev->dev); | ||
2958 | if (rc) | ||
2959 | return rc; | ||
2960 | |||
2935 | /* initialize adapter */ | 2961 | /* initialize adapter */ |
2936 | rc = mv_init_host(host, chip_soc); | 2962 | rc = mv_init_host(host, chip_soc); |
2937 | if (rc) | 2963 | if (rc) |
@@ -3068,26 +3094,6 @@ static void mv_print_info(struct ata_host *host) | |||
3068 | scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx"); | 3094 | scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx"); |
3069 | } | 3095 | } |
3070 | 3096 | ||
3071 | static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev) | ||
3072 | { | ||
3073 | hpriv->crqb_pool = dmam_pool_create("crqb_q", dev, MV_CRQB_Q_SZ, | ||
3074 | MV_CRQB_Q_SZ, 0); | ||
3075 | if (!hpriv->crqb_pool) | ||
3076 | return -ENOMEM; | ||
3077 | |||
3078 | hpriv->crpb_pool = dmam_pool_create("crpb_q", dev, MV_CRPB_Q_SZ, | ||
3079 | MV_CRPB_Q_SZ, 0); | ||
3080 | if (!hpriv->crpb_pool) | ||
3081 | return -ENOMEM; | ||
3082 | |||
3083 | hpriv->sg_tbl_pool = dmam_pool_create("sg_tbl", dev, MV_SG_TBL_SZ, | ||
3084 | MV_SG_TBL_SZ, 0); | ||
3085 | if (!hpriv->sg_tbl_pool) | ||
3086 | return -ENOMEM; | ||
3087 | |||
3088 | return 0; | ||
3089 | } | ||
3090 | |||
3091 | /** | 3097 | /** |
3092 | * mv_pci_init_one - handle a positive probe of a PCI Marvell host | 3098 | * mv_pci_init_one - handle a positive probe of a PCI Marvell host |
3093 | * @pdev: PCI device found | 3099 | * @pdev: PCI device found |