diff options
Diffstat (limited to 'drivers/ata')
50 files changed, 319 insertions, 237 deletions
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index ad1f59c1b3fc..b4a8d6030e48 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig | |||
@@ -132,7 +132,7 @@ config SATA_SIS | |||
132 | depends on PCI | 132 | depends on PCI |
133 | select PATA_SIS | 133 | select PATA_SIS |
134 | help | 134 | help |
135 | This option enables support for SiS Serial ATA on | 135 | This option enables support for SiS Serial ATA on |
136 | SiS 964/965/966/180 and Parallel ATA on SiS 180. | 136 | SiS 964/965/966/180 and Parallel ATA on SiS 180. |
137 | The PATA support for SiS 180 requires additionally to | 137 | The PATA support for SiS 180 requires additionally to |
138 | enable the PATA_SIS driver in the config. | 138 | enable the PATA_SIS driver in the config. |
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 1ae443d7ab92..7baeaffefe7a 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #include <linux/libata.h> | 46 | #include <linux/libata.h> |
47 | 47 | ||
48 | #define DRV_NAME "ahci" | 48 | #define DRV_NAME "ahci" |
49 | #define DRV_VERSION "2.1" | 49 | #define DRV_VERSION "2.2" |
50 | 50 | ||
51 | 51 | ||
52 | enum { | 52 | enum { |
@@ -170,10 +170,12 @@ enum { | |||
170 | AHCI_FLAG_IGN_IRQ_IF_ERR = (1 << 25), /* ignore IRQ_IF_ERR */ | 170 | AHCI_FLAG_IGN_IRQ_IF_ERR = (1 << 25), /* ignore IRQ_IF_ERR */ |
171 | AHCI_FLAG_HONOR_PI = (1 << 26), /* honor PORTS_IMPL */ | 171 | AHCI_FLAG_HONOR_PI = (1 << 26), /* honor PORTS_IMPL */ |
172 | AHCI_FLAG_IGN_SERR_INTERNAL = (1 << 27), /* ignore SERR_INTERNAL */ | 172 | AHCI_FLAG_IGN_SERR_INTERNAL = (1 << 27), /* ignore SERR_INTERNAL */ |
173 | AHCI_FLAG_32BIT_ONLY = (1 << 28), /* force 32bit */ | ||
173 | 174 | ||
174 | AHCI_FLAG_COMMON = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | 175 | AHCI_FLAG_COMMON = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
175 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | | 176 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | |
176 | ATA_FLAG_SKIP_D2H_BSY, | 177 | ATA_FLAG_SKIP_D2H_BSY | |
178 | ATA_FLAG_ACPI_SATA, | ||
177 | }; | 179 | }; |
178 | 180 | ||
179 | struct ahci_cmd_hdr { | 181 | struct ahci_cmd_hdr { |
@@ -353,7 +355,8 @@ static const struct ata_port_info ahci_port_info[] = { | |||
353 | /* board_ahci_sb600 */ | 355 | /* board_ahci_sb600 */ |
354 | { | 356 | { |
355 | .flags = AHCI_FLAG_COMMON | | 357 | .flags = AHCI_FLAG_COMMON | |
356 | AHCI_FLAG_IGN_SERR_INTERNAL, | 358 | AHCI_FLAG_IGN_SERR_INTERNAL | |
359 | AHCI_FLAG_32BIT_ONLY, | ||
357 | .pio_mask = 0x1f, /* pio0-4 */ | 360 | .pio_mask = 0x1f, /* pio0-4 */ |
358 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ | 361 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
359 | .port_ops = &ahci_ops, | 362 | .port_ops = &ahci_ops, |
@@ -491,6 +494,13 @@ static void ahci_save_initial_config(struct pci_dev *pdev, | |||
491 | hpriv->saved_cap = cap = readl(mmio + HOST_CAP); | 494 | hpriv->saved_cap = cap = readl(mmio + HOST_CAP); |
492 | hpriv->saved_port_map = port_map = readl(mmio + HOST_PORTS_IMPL); | 495 | hpriv->saved_port_map = port_map = readl(mmio + HOST_PORTS_IMPL); |
493 | 496 | ||
497 | /* some chips lie about 64bit support */ | ||
498 | if ((cap & HOST_CAP_64) && (pi->flags & AHCI_FLAG_32BIT_ONLY)) { | ||
499 | dev_printk(KERN_INFO, &pdev->dev, | ||
500 | "controller can't do 64bit DMA, forcing 32bit\n"); | ||
501 | cap &= ~HOST_CAP_64; | ||
502 | } | ||
503 | |||
494 | /* fixup zero port_map */ | 504 | /* fixup zero port_map */ |
495 | if (!port_map) { | 505 | if (!port_map) { |
496 | port_map = (1 << ahci_nr_ports(hpriv->cap)) - 1; | 506 | port_map = (1 << ahci_nr_ports(hpriv->cap)) - 1; |
diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c index c3d753296bc6..7565f022bd69 100644 --- a/drivers/ata/ata_generic.c +++ b/drivers/ata/ata_generic.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <linux/libata.h> | 26 | #include <linux/libata.h> |
27 | 27 | ||
28 | #define DRV_NAME "ata_generic" | 28 | #define DRV_NAME "ata_generic" |
29 | #define DRV_VERSION "0.2.11" | 29 | #define DRV_VERSION "0.2.12" |
30 | 30 | ||
31 | /* | 31 | /* |
32 | * A generic parallel ATA driver using libata | 32 | * A generic parallel ATA driver using libata |
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index 13b6b1df2ac4..9c07b88631be 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
@@ -155,7 +155,6 @@ struct piix_host_priv { | |||
155 | static int piix_init_one (struct pci_dev *pdev, | 155 | static int piix_init_one (struct pci_dev *pdev, |
156 | const struct pci_device_id *ent); | 156 | const struct pci_device_id *ent); |
157 | static void piix_pata_error_handler(struct ata_port *ap); | 157 | static void piix_pata_error_handler(struct ata_port *ap); |
158 | static void piix_sata_error_handler(struct ata_port *ap); | ||
159 | static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev); | 158 | static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev); |
160 | static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev); | 159 | static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev); |
161 | static void ich_set_dmamode (struct ata_port *ap, struct ata_device *adev); | 160 | static void ich_set_dmamode (struct ata_port *ap, struct ata_device *adev); |
@@ -364,7 +363,7 @@ static const struct ata_port_operations piix_sata_ops = { | |||
364 | 363 | ||
365 | .freeze = ata_bmdma_freeze, | 364 | .freeze = ata_bmdma_freeze, |
366 | .thaw = ata_bmdma_thaw, | 365 | .thaw = ata_bmdma_thaw, |
367 | .error_handler = piix_sata_error_handler, | 366 | .error_handler = ata_bmdma_error_handler, |
368 | .post_internal_cmd = ata_bmdma_post_internal_cmd, | 367 | .post_internal_cmd = ata_bmdma_post_internal_cmd, |
369 | 368 | ||
370 | .irq_handler = ata_interrupt, | 369 | .irq_handler = ata_interrupt, |
@@ -579,6 +578,7 @@ static const struct ich_laptop ich_laptop[] = { | |||
579 | { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */ | 578 | { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */ |
580 | { 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */ | 579 | { 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */ |
581 | { 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */ | 580 | { 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */ |
581 | { 0x24CA, 0x1025, 0x0061 }, /* ICH4 on ACER Aspire 2023WLMi */ | ||
582 | /* end marker */ | 582 | /* end marker */ |
583 | { 0, } | 583 | { 0, } |
584 | }; | 584 | }; |
@@ -641,12 +641,6 @@ static void piix_pata_error_handler(struct ata_port *ap) | |||
641 | ata_std_postreset); | 641 | ata_std_postreset); |
642 | } | 642 | } |
643 | 643 | ||
644 | static void piix_sata_error_handler(struct ata_port *ap) | ||
645 | { | ||
646 | ata_bmdma_drive_eh(ap, ata_std_prereset, ata_std_softreset, NULL, | ||
647 | ata_std_postreset); | ||
648 | } | ||
649 | |||
650 | /** | 644 | /** |
651 | * piix_set_piomode - Initialize host controller PATA PIO timings | 645 | * piix_set_piomode - Initialize host controller PATA PIO timings |
652 | * @ap: Port whose timings we are configuring | 646 | * @ap: Port whose timings we are configuring |
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index ed4138e24b0c..02236739b40f 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
@@ -321,7 +321,7 @@ static int do_drive_get_GTF(struct ata_device *dev, unsigned int *gtf_length, | |||
321 | 321 | ||
322 | /* Don't continue if device has no _ADR method. | 322 | /* Don't continue if device has no _ADR method. |
323 | * _GTF is intended for known motherboard devices. */ | 323 | * _GTF is intended for known motherboard devices. */ |
324 | if (!(ap->cbl == ATA_CBL_SATA)) { | 324 | if (!(ap->flags & ATA_FLAG_ACPI_SATA)) { |
325 | err = pata_get_dev_handle(gdev, &dev_handle, &pcidevfn); | 325 | err = pata_get_dev_handle(gdev, &dev_handle, &pcidevfn); |
326 | if (err < 0) { | 326 | if (err < 0) { |
327 | if (ata_msg_probe(ap)) | 327 | if (ata_msg_probe(ap)) |
@@ -343,7 +343,7 @@ static int do_drive_get_GTF(struct ata_device *dev, unsigned int *gtf_length, | |||
343 | 343 | ||
344 | /* Get this drive's _ADR info. if not already known. */ | 344 | /* Get this drive's _ADR info. if not already known. */ |
345 | if (!dev->obj_handle) { | 345 | if (!dev->obj_handle) { |
346 | if (!(ap->cbl == ATA_CBL_SATA)) { | 346 | if (!(ap->flags & ATA_FLAG_ACPI_SATA)) { |
347 | /* get child objects of dev_handle == channel objects, | 347 | /* get child objects of dev_handle == channel objects, |
348 | * + _their_ children == drive objects */ | 348 | * + _their_ children == drive objects */ |
349 | /* channel is ap->port_no */ | 349 | /* channel is ap->port_no */ |
@@ -528,7 +528,7 @@ static int do_drive_set_taskfiles(struct ata_device *dev, | |||
528 | ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n", | 528 | ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n", |
529 | __FUNCTION__, ap->port_no); | 529 | __FUNCTION__, ap->port_no); |
530 | 530 | ||
531 | if (libata_noacpi || !(ap->cbl == ATA_CBL_SATA)) | 531 | if (libata_noacpi || !(ap->flags & ATA_FLAG_ACPI_SATA)) |
532 | return 0; | 532 | return 0; |
533 | 533 | ||
534 | if (!ata_dev_enabled(dev) || (ap->flags & ATA_FLAG_DISABLED)) | 534 | if (!ata_dev_enabled(dev) || (ap->flags & ATA_FLAG_DISABLED)) |
@@ -578,7 +578,7 @@ int ata_acpi_exec_tfs(struct ata_port *ap) | |||
578 | * we should not run GTF on PATA devices since some | 578 | * we should not run GTF on PATA devices since some |
579 | * PATA require execution of GTM/STM before GTF. | 579 | * PATA require execution of GTM/STM before GTF. |
580 | */ | 580 | */ |
581 | if (!(ap->cbl == ATA_CBL_SATA)) | 581 | if (!(ap->flags & ATA_FLAG_ACPI_SATA)) |
582 | return 0; | 582 | return 0; |
583 | 583 | ||
584 | for (ix = 0; ix < ATA_MAX_DEVICES; ix++) { | 584 | for (ix = 0; ix < ATA_MAX_DEVICES; ix++) { |
@@ -641,7 +641,7 @@ int ata_acpi_push_id(struct ata_device *dev) | |||
641 | __FUNCTION__, dev->devno, ap->port_no); | 641 | __FUNCTION__, dev->devno, ap->port_no); |
642 | 642 | ||
643 | /* Don't continue if not a SATA device. */ | 643 | /* Don't continue if not a SATA device. */ |
644 | if (!(ap->cbl == ATA_CBL_SATA)) { | 644 | if (!(ap->flags & ATA_FLAG_ACPI_SATA)) { |
645 | if (ata_msg_probe(ap)) | 645 | if (ata_msg_probe(ap)) |
646 | ata_dev_printk(dev, KERN_DEBUG, | 646 | ata_dev_printk(dev, KERN_DEBUG, |
647 | "%s: Not a SATA device\n", __FUNCTION__); | 647 | "%s: Not a SATA device\n", __FUNCTION__); |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 4166407eb47c..3ca9c610c110 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -59,7 +59,7 @@ | |||
59 | 59 | ||
60 | #include "libata.h" | 60 | #include "libata.h" |
61 | 61 | ||
62 | #define DRV_VERSION "2.20" /* must be exactly four chars */ | 62 | #define DRV_VERSION "2.21" /* must be exactly four chars */ |
63 | 63 | ||
64 | 64 | ||
65 | /* debounce timing parameters in msecs { interval, duration, timeout } */ | 65 | /* debounce timing parameters in msecs { interval, duration, timeout } */ |
@@ -101,12 +101,6 @@ int libata_noacpi = 1; | |||
101 | module_param_named(noacpi, libata_noacpi, int, 0444); | 101 | module_param_named(noacpi, libata_noacpi, int, 0444); |
102 | MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in suspend/resume when set"); | 102 | MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in suspend/resume when set"); |
103 | 103 | ||
104 | int ata_spindown_compat = 1; | ||
105 | module_param_named(spindown_compat, ata_spindown_compat, int, 0644); | ||
106 | MODULE_PARM_DESC(spindown_compat, "Enable backward compatible spindown " | ||
107 | "behavior. Will be removed. More info can be found in " | ||
108 | "Documentation/feature-removal-schedule.txt\n"); | ||
109 | |||
110 | MODULE_AUTHOR("Jeff Garzik"); | 104 | MODULE_AUTHOR("Jeff Garzik"); |
111 | MODULE_DESCRIPTION("Library module for ATA devices"); | 105 | MODULE_DESCRIPTION("Library module for ATA devices"); |
112 | MODULE_LICENSE("GPL"); | 106 | MODULE_LICENSE("GPL"); |
@@ -983,7 +977,7 @@ static u64 ata_hpa_resize(struct ata_device *dev) | |||
983 | { | 977 | { |
984 | u64 sectors = dev->n_sectors; | 978 | u64 sectors = dev->n_sectors; |
985 | u64 hpa_sectors; | 979 | u64 hpa_sectors; |
986 | 980 | ||
987 | if (ata_id_has_lba48(dev->id)) | 981 | if (ata_id_has_lba48(dev->id)) |
988 | hpa_sectors = ata_read_native_max_address_ext(dev); | 982 | hpa_sectors = ata_read_native_max_address_ext(dev); |
989 | else | 983 | else |
@@ -1594,7 +1588,7 @@ unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd) | |||
1594 | * Check if the current speed of the device requires IORDY. Used | 1588 | * Check if the current speed of the device requires IORDY. Used |
1595 | * by various controllers for chip configuration. | 1589 | * by various controllers for chip configuration. |
1596 | */ | 1590 | */ |
1597 | 1591 | ||
1598 | unsigned int ata_pio_need_iordy(const struct ata_device *adev) | 1592 | unsigned int ata_pio_need_iordy(const struct ata_device *adev) |
1599 | { | 1593 | { |
1600 | /* Controller doesn't support IORDY. Probably a pointless check | 1594 | /* Controller doesn't support IORDY. Probably a pointless check |
@@ -1617,7 +1611,7 @@ unsigned int ata_pio_need_iordy(const struct ata_device *adev) | |||
1617 | * Compute the highest mode possible if we are not using iordy. Return | 1611 | * Compute the highest mode possible if we are not using iordy. Return |
1618 | * -1 if no iordy mode is available. | 1612 | * -1 if no iordy mode is available. |
1619 | */ | 1613 | */ |
1620 | 1614 | ||
1621 | static u32 ata_pio_mask_no_iordy(const struct ata_device *adev) | 1615 | static u32 ata_pio_mask_no_iordy(const struct ata_device *adev) |
1622 | { | 1616 | { |
1623 | /* If we have no drive specific rule, then PIO 2 is non IORDY */ | 1617 | /* If we have no drive specific rule, then PIO 2 is non IORDY */ |
@@ -1919,7 +1913,6 @@ int ata_dev_configure(struct ata_device *dev) | |||
1919 | snprintf(revbuf, 7, "ATA-%d", ata_id_major_version(id)); | 1913 | snprintf(revbuf, 7, "ATA-%d", ata_id_major_version(id)); |
1920 | 1914 | ||
1921 | dev->n_sectors = ata_id_n_sectors(id); | 1915 | dev->n_sectors = ata_id_n_sectors(id); |
1922 | dev->n_sectors_boot = dev->n_sectors; | ||
1923 | 1916 | ||
1924 | /* SCSI only uses 4-char revisions, dump full 8 chars from ATA */ | 1917 | /* SCSI only uses 4-char revisions, dump full 8 chars from ATA */ |
1925 | ata_id_c_string(dev->id, fwrevbuf, ATA_ID_FW_REV, | 1918 | ata_id_c_string(dev->id, fwrevbuf, ATA_ID_FW_REV, |
@@ -2670,7 +2663,7 @@ int ata_timing_compute(struct ata_device *adev, unsigned short speed, | |||
2670 | t->active += (t->cycle - (t->active + t->recover)) / 2; | 2663 | t->active += (t->cycle - (t->active + t->recover)) / 2; |
2671 | t->recover = t->cycle - t->active; | 2664 | t->recover = t->cycle - t->active; |
2672 | } | 2665 | } |
2673 | 2666 | ||
2674 | /* In a few cases quantisation may produce enough errors to | 2667 | /* In a few cases quantisation may produce enough errors to |
2675 | leave t->cycle too low for the sum of active and recovery | 2668 | leave t->cycle too low for the sum of active and recovery |
2676 | if so we must correct this */ | 2669 | if so we must correct this */ |
@@ -2900,9 +2893,6 @@ int ata_do_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev) | |||
2900 | if (used_dma && (ap->host->flags & ATA_HOST_SIMPLEX)) | 2893 | if (used_dma && (ap->host->flags & ATA_HOST_SIMPLEX)) |
2901 | ap->host->simplex_claimed = ap; | 2894 | ap->host->simplex_claimed = ap; |
2902 | 2895 | ||
2903 | /* step5: chip specific finalisation */ | ||
2904 | if (ap->ops->post_set_mode) | ||
2905 | ap->ops->post_set_mode(ap); | ||
2906 | out: | 2896 | out: |
2907 | if (rc) | 2897 | if (rc) |
2908 | *r_failed_dev = dev; | 2898 | *r_failed_dev = dev; |
@@ -3032,7 +3022,7 @@ int ata_wait_ready(struct ata_port *ap, unsigned long deadline) | |||
3032 | 3022 | ||
3033 | if (!(status & ATA_BUSY)) | 3023 | if (!(status & ATA_BUSY)) |
3034 | return 0; | 3024 | return 0; |
3035 | if (status == 0xff) | 3025 | if (!ata_port_online(ap) && status == 0xff) |
3036 | return -ENODEV; | 3026 | return -ENODEV; |
3037 | if (time_after(now, deadline)) | 3027 | if (time_after(now, deadline)) |
3038 | return -EBUSY; | 3028 | return -EBUSY; |
@@ -3378,7 +3368,7 @@ int ata_std_prereset(struct ata_port *ap, unsigned long deadline) | |||
3378 | */ | 3368 | */ |
3379 | if (!(ap->flags & ATA_FLAG_SKIP_D2H_BSY) && !ata_port_offline(ap)) { | 3369 | if (!(ap->flags & ATA_FLAG_SKIP_D2H_BSY) && !ata_port_offline(ap)) { |
3380 | rc = ata_wait_ready(ap, deadline); | 3370 | rc = ata_wait_ready(ap, deadline); |
3381 | if (rc) { | 3371 | if (rc && rc != -ENODEV) { |
3382 | ata_port_printk(ap, KERN_WARNING, "device not ready " | 3372 | ata_port_printk(ap, KERN_WARNING, "device not ready " |
3383 | "(errno=%d), forcing hardreset\n", rc); | 3373 | "(errno=%d), forcing hardreset\n", rc); |
3384 | ehc->i.action |= ATA_EH_HARDRESET; | 3374 | ehc->i.action |= ATA_EH_HARDRESET; |
@@ -3632,7 +3622,6 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class, | |||
3632 | const u16 *old_id = dev->id; | 3622 | const u16 *old_id = dev->id; |
3633 | unsigned char model[2][ATA_ID_PROD_LEN + 1]; | 3623 | unsigned char model[2][ATA_ID_PROD_LEN + 1]; |
3634 | unsigned char serial[2][ATA_ID_SERNO_LEN + 1]; | 3624 | unsigned char serial[2][ATA_ID_SERNO_LEN + 1]; |
3635 | u64 new_n_sectors; | ||
3636 | 3625 | ||
3637 | if (dev->class != new_class) { | 3626 | if (dev->class != new_class) { |
3638 | ata_dev_printk(dev, KERN_INFO, "class mismatch %d != %d\n", | 3627 | ata_dev_printk(dev, KERN_INFO, "class mismatch %d != %d\n", |
@@ -3644,7 +3633,6 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class, | |||
3644 | ata_id_c_string(new_id, model[1], ATA_ID_PROD, sizeof(model[1])); | 3633 | ata_id_c_string(new_id, model[1], ATA_ID_PROD, sizeof(model[1])); |
3645 | ata_id_c_string(old_id, serial[0], ATA_ID_SERNO, sizeof(serial[0])); | 3634 | ata_id_c_string(old_id, serial[0], ATA_ID_SERNO, sizeof(serial[0])); |
3646 | ata_id_c_string(new_id, serial[1], ATA_ID_SERNO, sizeof(serial[1])); | 3635 | ata_id_c_string(new_id, serial[1], ATA_ID_SERNO, sizeof(serial[1])); |
3647 | new_n_sectors = ata_id_n_sectors(new_id); | ||
3648 | 3636 | ||
3649 | if (strcmp(model[0], model[1])) { | 3637 | if (strcmp(model[0], model[1])) { |
3650 | ata_dev_printk(dev, KERN_INFO, "model number mismatch " | 3638 | ata_dev_printk(dev, KERN_INFO, "model number mismatch " |
@@ -3658,25 +3646,12 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class, | |||
3658 | return 0; | 3646 | return 0; |
3659 | } | 3647 | } |
3660 | 3648 | ||
3661 | if (dev->class == ATA_DEV_ATA && dev->n_sectors != new_n_sectors) { | ||
3662 | ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch " | ||
3663 | "%llu != %llu\n", | ||
3664 | (unsigned long long)dev->n_sectors, | ||
3665 | (unsigned long long)new_n_sectors); | ||
3666 | /* Are we the boot time size - if so we appear to be the | ||
3667 | same disk at this point and our HPA got reapplied */ | ||
3668 | if (ata_ignore_hpa && dev->n_sectors_boot == new_n_sectors | ||
3669 | && ata_id_hpa_enabled(new_id)) | ||
3670 | return 1; | ||
3671 | return 0; | ||
3672 | } | ||
3673 | |||
3674 | return 1; | 3649 | return 1; |
3675 | } | 3650 | } |
3676 | 3651 | ||
3677 | /** | 3652 | /** |
3678 | * ata_dev_revalidate - Revalidate ATA device | 3653 | * ata_dev_reread_id - Re-read IDENTIFY data |
3679 | * @dev: device to revalidate | 3654 | * @adev: target ATA device |
3680 | * @readid_flags: read ID flags | 3655 | * @readid_flags: read ID flags |
3681 | * | 3656 | * |
3682 | * Re-read IDENTIFY page and make sure @dev is still attached to | 3657 | * Re-read IDENTIFY page and make sure @dev is still attached to |
@@ -3688,34 +3663,68 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class, | |||
3688 | * RETURNS: | 3663 | * RETURNS: |
3689 | * 0 on success, negative errno otherwise | 3664 | * 0 on success, negative errno otherwise |
3690 | */ | 3665 | */ |
3691 | int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags) | 3666 | int ata_dev_reread_id(struct ata_device *dev, unsigned int readid_flags) |
3692 | { | 3667 | { |
3693 | unsigned int class = dev->class; | 3668 | unsigned int class = dev->class; |
3694 | u16 *id = (void *)dev->ap->sector_buf; | 3669 | u16 *id = (void *)dev->ap->sector_buf; |
3695 | int rc; | 3670 | int rc; |
3696 | 3671 | ||
3697 | if (!ata_dev_enabled(dev)) { | ||
3698 | rc = -ENODEV; | ||
3699 | goto fail; | ||
3700 | } | ||
3701 | |||
3702 | /* read ID data */ | 3672 | /* read ID data */ |
3703 | rc = ata_dev_read_id(dev, &class, readid_flags, id); | 3673 | rc = ata_dev_read_id(dev, &class, readid_flags, id); |
3704 | if (rc) | 3674 | if (rc) |
3705 | goto fail; | 3675 | return rc; |
3706 | 3676 | ||
3707 | /* is the device still there? */ | 3677 | /* is the device still there? */ |
3708 | if (!ata_dev_same_device(dev, class, id)) { | 3678 | if (!ata_dev_same_device(dev, class, id)) |
3709 | rc = -ENODEV; | 3679 | return -ENODEV; |
3710 | goto fail; | ||
3711 | } | ||
3712 | 3680 | ||
3713 | memcpy(dev->id, id, sizeof(id[0]) * ATA_ID_WORDS); | 3681 | memcpy(dev->id, id, sizeof(id[0]) * ATA_ID_WORDS); |
3682 | return 0; | ||
3683 | } | ||
3684 | |||
3685 | /** | ||
3686 | * ata_dev_revalidate - Revalidate ATA device | ||
3687 | * @dev: device to revalidate | ||
3688 | * @readid_flags: read ID flags | ||
3689 | * | ||
3690 | * Re-read IDENTIFY page, make sure @dev is still attached to the | ||
3691 | * port and reconfigure it according to the new IDENTIFY page. | ||
3692 | * | ||
3693 | * LOCKING: | ||
3694 | * Kernel thread context (may sleep) | ||
3695 | * | ||
3696 | * RETURNS: | ||
3697 | * 0 on success, negative errno otherwise | ||
3698 | */ | ||
3699 | int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags) | ||
3700 | { | ||
3701 | u64 n_sectors = dev->n_sectors; | ||
3702 | int rc; | ||
3703 | |||
3704 | if (!ata_dev_enabled(dev)) | ||
3705 | return -ENODEV; | ||
3706 | |||
3707 | /* re-read ID */ | ||
3708 | rc = ata_dev_reread_id(dev, readid_flags); | ||
3709 | if (rc) | ||
3710 | goto fail; | ||
3714 | 3711 | ||
3715 | /* configure device according to the new ID */ | 3712 | /* configure device according to the new ID */ |
3716 | rc = ata_dev_configure(dev); | 3713 | rc = ata_dev_configure(dev); |
3717 | if (rc == 0) | 3714 | if (rc) |
3718 | return 0; | 3715 | goto fail; |
3716 | |||
3717 | /* verify n_sectors hasn't changed */ | ||
3718 | if (dev->class == ATA_DEV_ATA && dev->n_sectors != n_sectors) { | ||
3719 | ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch " | ||
3720 | "%llu != %llu\n", | ||
3721 | (unsigned long long)n_sectors, | ||
3722 | (unsigned long long)dev->n_sectors); | ||
3723 | rc = -ENODEV; | ||
3724 | goto fail; | ||
3725 | } | ||
3726 | |||
3727 | return 0; | ||
3719 | 3728 | ||
3720 | fail: | 3729 | fail: |
3721 | ata_dev_printk(dev, KERN_ERR, "revalidation failed (errno=%d)\n", rc); | 3730 | ata_dev_printk(dev, KERN_ERR, "revalidation failed (errno=%d)\n", rc); |
@@ -3759,6 +3768,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { | |||
3759 | { "ATAPI CD-ROM DRIVE 40X MAXIMUM",NULL,ATA_HORKAGE_NODMA }, | 3768 | { "ATAPI CD-ROM DRIVE 40X MAXIMUM",NULL,ATA_HORKAGE_NODMA }, |
3760 | { "_NEC DV5800A", NULL, ATA_HORKAGE_NODMA }, | 3769 | { "_NEC DV5800A", NULL, ATA_HORKAGE_NODMA }, |
3761 | { "SAMSUNG CD-ROM SN-124","N001", ATA_HORKAGE_NODMA }, | 3770 | { "SAMSUNG CD-ROM SN-124","N001", ATA_HORKAGE_NODMA }, |
3771 | { "Seagate STT20000A", NULL, ATA_HORKAGE_NODMA }, | ||
3762 | 3772 | ||
3763 | /* Weird ATAPI devices */ | 3773 | /* Weird ATAPI devices */ |
3764 | { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 | | 3774 | { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 | |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 5309c312f517..d8070989a39f 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1009,7 +1009,7 @@ static unsigned int atapi_eh_request_sense(struct ata_queued_cmd *qc) | |||
1009 | sense_buf[0] = 0x70; | 1009 | sense_buf[0] = 0x70; |
1010 | sense_buf[2] = qc->result_tf.feature >> 4; | 1010 | sense_buf[2] = qc->result_tf.feature >> 4; |
1011 | 1011 | ||
1012 | /* some devices time out if garbage left in tf */ | 1012 | /* some devices time out if garbage left in tf */ |
1013 | ata_tf_init(dev, &tf); | 1013 | ata_tf_init(dev, &tf); |
1014 | 1014 | ||
1015 | memset(cdb, 0, ATAPI_CDB_LEN); | 1015 | memset(cdb, 0, ATAPI_CDB_LEN); |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index dd81fa78cdcf..b3900cfbd880 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -893,6 +893,23 @@ int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth) | |||
893 | return queue_depth; | 893 | return queue_depth; |
894 | } | 894 | } |
895 | 895 | ||
896 | /* XXX: for spindown warning */ | ||
897 | static void ata_delayed_done_timerfn(unsigned long arg) | ||
898 | { | ||
899 | struct scsi_cmnd *scmd = (void *)arg; | ||
900 | |||
901 | scmd->scsi_done(scmd); | ||
902 | } | ||
903 | |||
904 | /* XXX: for spindown warning */ | ||
905 | static void ata_delayed_done(struct scsi_cmnd *scmd) | ||
906 | { | ||
907 | static struct timer_list timer; | ||
908 | |||
909 | setup_timer(&timer, ata_delayed_done_timerfn, (unsigned long)scmd); | ||
910 | mod_timer(&timer, jiffies + 5 * HZ); | ||
911 | } | ||
912 | |||
896 | /** | 913 | /** |
897 | * ata_scsi_start_stop_xlat - Translate SCSI START STOP UNIT command | 914 | * ata_scsi_start_stop_xlat - Translate SCSI START STOP UNIT command |
898 | * @qc: Storage for translated ATA taskfile | 915 | * @qc: Storage for translated ATA taskfile |
@@ -949,22 +966,24 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc) | |||
949 | * removed. Read Documentation/feature-removal-schedule.txt | 966 | * removed. Read Documentation/feature-removal-schedule.txt |
950 | * for more info. | 967 | * for more info. |
951 | */ | 968 | */ |
952 | if (ata_spindown_compat && | 969 | if ((qc->dev->flags & ATA_DFLAG_SPUNDOWN) && |
953 | (system_state == SYSTEM_HALT || | 970 | (system_state == SYSTEM_HALT || |
954 | system_state == SYSTEM_POWER_OFF)) { | 971 | system_state == SYSTEM_POWER_OFF)) { |
955 | static int warned = 0; | 972 | static unsigned long warned = 0; |
956 | 973 | ||
957 | if (!warned) { | 974 | if (!test_and_set_bit(0, &warned)) { |
958 | spin_unlock_irq(qc->ap->lock); | ||
959 | ata_dev_printk(qc->dev, KERN_WARNING, | 975 | ata_dev_printk(qc->dev, KERN_WARNING, |
960 | "DISK MIGHT NOT BE SPUN DOWN PROPERLY. " | 976 | "DISK MIGHT NOT BE SPUN DOWN PROPERLY. " |
961 | "UPDATE SHUTDOWN UTILITY\n"); | 977 | "UPDATE SHUTDOWN UTILITY\n"); |
962 | ata_dev_printk(qc->dev, KERN_WARNING, | 978 | ata_dev_printk(qc->dev, KERN_WARNING, |
963 | "For more info, visit " | 979 | "For more info, visit " |
964 | "http://linux-ata.org/shutdown.html\n"); | 980 | "http://linux-ata.org/shutdown.html\n"); |
965 | warned = 1; | 981 | |
966 | ssleep(5); | 982 | /* ->scsi_done is not used, use it for |
967 | spin_lock_irq(qc->ap->lock); | 983 | * delayed completion. |
984 | */ | ||
985 | scmd->scsi_done = qc->scsidone; | ||
986 | qc->scsidone = ata_delayed_done; | ||
968 | } | 987 | } |
969 | scmd->result = SAM_STAT_GOOD; | 988 | scmd->result = SAM_STAT_GOOD; |
970 | return 1; | 989 | return 1; |
@@ -1031,14 +1050,15 @@ static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc) | |||
1031 | static void scsi_6_lba_len(const u8 *cdb, u64 *plba, u32 *plen) | 1050 | static void scsi_6_lba_len(const u8 *cdb, u64 *plba, u32 *plen) |
1032 | { | 1051 | { |
1033 | u64 lba = 0; | 1052 | u64 lba = 0; |
1034 | u32 len = 0; | 1053 | u32 len; |
1035 | 1054 | ||
1036 | VPRINTK("six-byte command\n"); | 1055 | VPRINTK("six-byte command\n"); |
1037 | 1056 | ||
1057 | lba |= ((u64)(cdb[1] & 0x1f)) << 16; | ||
1038 | lba |= ((u64)cdb[2]) << 8; | 1058 | lba |= ((u64)cdb[2]) << 8; |
1039 | lba |= ((u64)cdb[3]); | 1059 | lba |= ((u64)cdb[3]); |
1040 | 1060 | ||
1041 | len |= ((u32)cdb[4]); | 1061 | len = cdb[4]; |
1042 | 1062 | ||
1043 | *plba = lba; | 1063 | *plba = lba; |
1044 | *plen = len; | 1064 | *plen = len; |
@@ -1375,6 +1395,14 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) | |||
1375 | } | 1395 | } |
1376 | } | 1396 | } |
1377 | 1397 | ||
1398 | /* XXX: track spindown state for spindown skipping and warning */ | ||
1399 | if (unlikely(qc->tf.command == ATA_CMD_STANDBY || | ||
1400 | qc->tf.command == ATA_CMD_STANDBYNOW1)) | ||
1401 | qc->dev->flags |= ATA_DFLAG_SPUNDOWN; | ||
1402 | else if (likely(system_state != SYSTEM_HALT && | ||
1403 | system_state != SYSTEM_POWER_OFF)) | ||
1404 | qc->dev->flags &= ~ATA_DFLAG_SPUNDOWN; | ||
1405 | |||
1378 | if (need_sense && !ap->ops->error_handler) | 1406 | if (need_sense && !ap->ops->error_handler) |
1379 | ata_dump_status(ap->print_id, &qc->result_tf); | 1407 | ata_dump_status(ap->print_id, &qc->result_tf); |
1380 | 1408 | ||
@@ -1488,14 +1516,14 @@ static int ata_scsi_translate(struct ata_device *dev, struct scsi_cmnd *cmd, | |||
1488 | 1516 | ||
1489 | early_finish: | 1517 | early_finish: |
1490 | ata_qc_free(qc); | 1518 | ata_qc_free(qc); |
1491 | done(cmd); | 1519 | qc->scsidone(cmd); |
1492 | DPRINTK("EXIT - early finish (good or error)\n"); | 1520 | DPRINTK("EXIT - early finish (good or error)\n"); |
1493 | return 0; | 1521 | return 0; |
1494 | 1522 | ||
1495 | err_did: | 1523 | err_did: |
1496 | ata_qc_free(qc); | 1524 | ata_qc_free(qc); |
1497 | cmd->result = (DID_ERROR << 16); | 1525 | cmd->result = (DID_ERROR << 16); |
1498 | done(cmd); | 1526 | qc->scsidone(cmd); |
1499 | err_mem: | 1527 | err_mem: |
1500 | DPRINTK("EXIT - internal\n"); | 1528 | DPRINTK("EXIT - internal\n"); |
1501 | return 0; | 1529 | return 0; |
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index 8b71b73a199c..5e2466658420 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h | |||
@@ -58,7 +58,6 @@ extern int atapi_enabled; | |||
58 | extern int atapi_dmadir; | 58 | extern int atapi_dmadir; |
59 | extern int libata_fua; | 59 | extern int libata_fua; |
60 | extern int libata_noacpi; | 60 | extern int libata_noacpi; |
61 | extern int ata_spindown_compat; | ||
62 | extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev); | 61 | extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev); |
63 | extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, | 62 | extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, |
64 | u64 block, u32 n_block, unsigned int tf_flags, | 63 | u64 block, u32 n_block, unsigned int tf_flags, |
@@ -76,7 +75,8 @@ extern unsigned ata_exec_internal_sg(struct ata_device *dev, | |||
76 | extern unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd); | 75 | extern unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd); |
77 | extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, | 76 | extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, |
78 | unsigned int flags, u16 *id); | 77 | unsigned int flags, u16 *id); |
79 | extern int ata_dev_revalidate(struct ata_device *dev, unsigned int flags); | 78 | extern int ata_dev_reread_id(struct ata_device *dev, unsigned int readid_flags); |
79 | extern int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags); | ||
80 | extern int ata_dev_configure(struct ata_device *dev); | 80 | extern int ata_dev_configure(struct ata_device *dev); |
81 | extern int sata_down_spd_limit(struct ata_port *ap); | 81 | extern int sata_down_spd_limit(struct ata_port *ap); |
82 | extern int sata_set_spd_needed(struct ata_port *ap); | 82 | extern int sata_set_spd_needed(struct ata_port *ap); |
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c index 9861059dd673..03b6ddd2abd2 100644 --- a/drivers/ata/pata_artop.c +++ b/drivers/ata/pata_artop.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/ata.h> | 28 | #include <linux/ata.h> |
29 | 29 | ||
30 | #define DRV_NAME "pata_artop" | 30 | #define DRV_NAME "pata_artop" |
31 | #define DRV_VERSION "0.4.2" | 31 | #define DRV_VERSION "0.4.3" |
32 | 32 | ||
33 | /* | 33 | /* |
34 | * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we | 34 | * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we |
@@ -97,9 +97,9 @@ static int artop6260_pre_reset(struct ata_port *ap, unsigned long deadline) | |||
97 | * artop6260_cable_detect - identify cable type | 97 | * artop6260_cable_detect - identify cable type |
98 | * @ap: Port | 98 | * @ap: Port |
99 | * | 99 | * |
100 | * Identify the cable type for the ARTOp interface in question | 100 | * Identify the cable type for the ARTOP interface in question |
101 | */ | 101 | */ |
102 | 102 | ||
103 | static int artop6260_cable_detect(struct ata_port *ap) | 103 | static int artop6260_cable_detect(struct ata_port *ap) |
104 | { | 104 | { |
105 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 105 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
diff --git a/drivers/ata/pata_cmd640.c b/drivers/ata/pata_cmd640.c index ed00fa9d53be..31cbf8daa299 100644 --- a/drivers/ata/pata_cmd640.c +++ b/drivers/ata/pata_cmd640.c | |||
@@ -107,7 +107,7 @@ static void cmd640_set_piomode(struct ata_port *ap, struct ata_device *adev) | |||
107 | pci_write_config_byte(pdev, arttim + 1, (t.active << 4) | t.recover); | 107 | pci_write_config_byte(pdev, arttim + 1, (t.active << 4) | t.recover); |
108 | } else { | 108 | } else { |
109 | /* Save the shared timings for channel, they will be loaded | 109 | /* Save the shared timings for channel, they will be loaded |
110 | by qc_issue_prot. Reloading the setup time is expensive | 110 | by qc_issue_prot. Reloading the setup time is expensive |
111 | so we keep a merged one loaded */ | 111 | so we keep a merged one loaded */ |
112 | pci_read_config_byte(pdev, ARTIM23, ®); | 112 | pci_read_config_byte(pdev, ARTIM23, ®); |
113 | reg &= 0x3F; | 113 | reg &= 0x3F; |
@@ -231,7 +231,7 @@ static void cmd640_hardware_init(struct pci_dev *pdev) | |||
231 | pci_write_config_byte(pdev, CMDTIM, 0); | 231 | pci_write_config_byte(pdev, CMDTIM, 0); |
232 | /* 512 byte bursts (sector) */ | 232 | /* 512 byte bursts (sector) */ |
233 | pci_write_config_byte(pdev, BRST, 0x40); | 233 | pci_write_config_byte(pdev, BRST, 0x40); |
234 | /* | 234 | /* |
235 | * A reporter a long time ago | 235 | * A reporter a long time ago |
236 | * Had problems with the data fifo | 236 | * Had problems with the data fifo |
237 | * So don't run the risk | 237 | * So don't run the risk |
diff --git a/drivers/ata/pata_cmd64x.c b/drivers/ata/pata_cmd64x.c index 2a79b335cfcc..320a5b10aa98 100644 --- a/drivers/ata/pata_cmd64x.c +++ b/drivers/ata/pata_cmd64x.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <linux/libata.h> | 31 | #include <linux/libata.h> |
32 | 32 | ||
33 | #define DRV_NAME "pata_cmd64x" | 33 | #define DRV_NAME "pata_cmd64x" |
34 | #define DRV_VERSION "0.2.2" | 34 | #define DRV_VERSION "0.2.3" |
35 | 35 | ||
36 | /* | 36 | /* |
37 | * CMD64x specific registers definition. | 37 | * CMD64x specific registers definition. |
diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c index 83bcc5b32597..1aabe15ad9d3 100644 --- a/drivers/ata/pata_cs5520.c +++ b/drivers/ata/pata_cs5520.c | |||
@@ -41,7 +41,7 @@ | |||
41 | #include <linux/libata.h> | 41 | #include <linux/libata.h> |
42 | 42 | ||
43 | #define DRV_NAME "pata_cs5520" | 43 | #define DRV_NAME "pata_cs5520" |
44 | #define DRV_VERSION "0.6.4" | 44 | #define DRV_VERSION "0.6.5" |
45 | 45 | ||
46 | struct pio_clocks | 46 | struct pio_clocks |
47 | { | 47 | { |
diff --git a/drivers/ata/pata_cs5530.c b/drivers/ata/pata_cs5530.c index 1b67923d7a4e..848f0309bf03 100644 --- a/drivers/ata/pata_cs5530.c +++ b/drivers/ata/pata_cs5530.c | |||
@@ -35,7 +35,7 @@ | |||
35 | #include <linux/dmi.h> | 35 | #include <linux/dmi.h> |
36 | 36 | ||
37 | #define DRV_NAME "pata_cs5530" | 37 | #define DRV_NAME "pata_cs5530" |
38 | #define DRV_VERSION "0.7.2" | 38 | #define DRV_VERSION "0.7.3" |
39 | 39 | ||
40 | static void __iomem *cs5530_port_base(struct ata_port *ap) | 40 | static void __iomem *cs5530_port_base(struct ata_port *ap) |
41 | { | 41 | { |
diff --git a/drivers/ata/pata_cs5535.c b/drivers/ata/pata_cs5535.c index f37d4cd812a1..aa3256fb9f7a 100644 --- a/drivers/ata/pata_cs5535.c +++ b/drivers/ata/pata_cs5535.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <asm/msr.h> | 39 | #include <asm/msr.h> |
40 | 40 | ||
41 | #define DRV_NAME "cs5535" | 41 | #define DRV_NAME "cs5535" |
42 | #define DRV_VERSION "0.2.11" | 42 | #define DRV_VERSION "0.2.12" |
43 | 43 | ||
44 | /* | 44 | /* |
45 | * The Geode (Aka Athlon GX now) uses an internal MSR based | 45 | * The Geode (Aka Athlon GX now) uses an internal MSR based |
diff --git a/drivers/ata/pata_cypress.c b/drivers/ata/pata_cypress.c index 27b9f29c01e3..d41a7691dd8e 100644 --- a/drivers/ata/pata_cypress.c +++ b/drivers/ata/pata_cypress.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/libata.h> | 18 | #include <linux/libata.h> |
19 | 19 | ||
20 | #define DRV_NAME "pata_cypress" | 20 | #define DRV_NAME "pata_cypress" |
21 | #define DRV_VERSION "0.1.4" | 21 | #define DRV_VERSION "0.1.5" |
22 | 22 | ||
23 | /* here are the offset definitions for the registers */ | 23 | /* here are the offset definitions for the registers */ |
24 | 24 | ||
diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c index c6c8a8bb06d0..0c9cb6090711 100644 --- a/drivers/ata/pata_hpt366.c +++ b/drivers/ata/pata_hpt366.c | |||
@@ -220,32 +220,6 @@ static int hpt36x_cable_detect(struct ata_port *ap) | |||
220 | return ATA_CBL_PATA80; | 220 | return ATA_CBL_PATA80; |
221 | } | 221 | } |
222 | 222 | ||
223 | static int hpt36x_pre_reset(struct ata_port *ap, unsigned long deadline) | ||
224 | { | ||
225 | static const struct pci_bits hpt36x_enable_bits[] = { | ||
226 | { 0x50, 1, 0x04, 0x04 }, | ||
227 | { 0x54, 1, 0x04, 0x04 } | ||
228 | }; | ||
229 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | ||
230 | |||
231 | if (!pci_test_config_bits(pdev, &hpt36x_enable_bits[ap->port_no])) | ||
232 | return -ENOENT; | ||
233 | |||
234 | return ata_std_prereset(ap, deadline); | ||
235 | } | ||
236 | |||
237 | /** | ||
238 | * hpt36x_error_handler - reset the hpt36x bus | ||
239 | * @ap: ATA port to reset | ||
240 | * | ||
241 | * Perform the reset handling for the 366/368 | ||
242 | */ | ||
243 | |||
244 | static void hpt36x_error_handler(struct ata_port *ap) | ||
245 | { | ||
246 | ata_bmdma_drive_eh(ap, hpt36x_pre_reset, ata_std_softreset, NULL, ata_std_postreset); | ||
247 | } | ||
248 | |||
249 | /** | 223 | /** |
250 | * hpt366_set_piomode - PIO setup | 224 | * hpt366_set_piomode - PIO setup |
251 | * @ap: ATA interface | 225 | * @ap: ATA interface |
@@ -351,7 +325,7 @@ static struct ata_port_operations hpt366_port_ops = { | |||
351 | 325 | ||
352 | .freeze = ata_bmdma_freeze, | 326 | .freeze = ata_bmdma_freeze, |
353 | .thaw = ata_bmdma_thaw, | 327 | .thaw = ata_bmdma_thaw, |
354 | .error_handler = hpt36x_error_handler, | 328 | .error_handler = ata_bmdma_error_handler, |
355 | .post_internal_cmd = ata_bmdma_post_internal_cmd, | 329 | .post_internal_cmd = ata_bmdma_post_internal_cmd, |
356 | .cable_detect = hpt36x_cable_detect, | 330 | .cable_detect = hpt36x_cable_detect, |
357 | 331 | ||
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c index 5a0a410654e2..6446735a46e0 100644 --- a/drivers/ata/pata_hpt37x.c +++ b/drivers/ata/pata_hpt37x.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <linux/libata.h> | 26 | #include <linux/libata.h> |
27 | 27 | ||
28 | #define DRV_NAME "pata_hpt37x" | 28 | #define DRV_NAME "pata_hpt37x" |
29 | #define DRV_VERSION "0.6.5" | 29 | #define DRV_VERSION "0.6.6" |
30 | 30 | ||
31 | struct hpt_clock { | 31 | struct hpt_clock { |
32 | u8 xfer_speed; | 32 | u8 xfer_speed; |
@@ -931,15 +931,6 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
931 | .udma_mask = 0x7f, | 931 | .udma_mask = 0x7f, |
932 | .port_ops = &hpt372_port_ops | 932 | .port_ops = &hpt372_port_ops |
933 | }; | 933 | }; |
934 | /* HPT371, 372 and friends - UDMA100 at 50MHz clock */ | ||
935 | static const struct ata_port_info info_hpt372_50 = { | ||
936 | .sht = &hpt37x_sht, | ||
937 | .flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST, | ||
938 | .pio_mask = 0x1f, | ||
939 | .mwdma_mask = 0x07, | ||
940 | .udma_mask = 0x3f, | ||
941 | .port_ops = &hpt372_port_ops | ||
942 | }; | ||
943 | /* HPT374 - UDMA133 */ | 934 | /* HPT374 - UDMA133 */ |
944 | static const struct ata_port_info info_hpt374 = { | 935 | static const struct ata_port_info info_hpt374 = { |
945 | .sht = &hpt37x_sht, | 936 | .sht = &hpt37x_sht, |
@@ -961,7 +952,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
961 | u8 mcr1; | 952 | u8 mcr1; |
962 | u32 freq; | 953 | u32 freq; |
963 | int prefer_dpll = 1; | 954 | int prefer_dpll = 1; |
964 | 955 | ||
965 | unsigned long iobase = pci_resource_start(dev, 4); | 956 | unsigned long iobase = pci_resource_start(dev, 4); |
966 | 957 | ||
967 | const struct hpt_chip *chip_table; | 958 | const struct hpt_chip *chip_table; |
@@ -1055,7 +1046,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
1055 | */ | 1046 | */ |
1056 | 1047 | ||
1057 | pci_write_config_byte(dev, 0x5b, 0x23); | 1048 | pci_write_config_byte(dev, 0x5b, 0x23); |
1058 | 1049 | ||
1059 | /* | 1050 | /* |
1060 | * HighPoint does this for HPT372A. | 1051 | * HighPoint does this for HPT372A. |
1061 | * NOTE: This register is only writeable via I/O space. | 1052 | * NOTE: This register is only writeable via I/O space. |
@@ -1088,7 +1079,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
1088 | * Turn the frequency check into a band and then find a timing | 1079 | * Turn the frequency check into a band and then find a timing |
1089 | * table to match it. | 1080 | * table to match it. |
1090 | */ | 1081 | */ |
1091 | 1082 | ||
1092 | clock_slot = hpt37x_clock_slot(freq, chip_table->base); | 1083 | clock_slot = hpt37x_clock_slot(freq, chip_table->base); |
1093 | if (chip_table->clocks[clock_slot] == NULL || prefer_dpll) { | 1084 | if (chip_table->clocks[clock_slot] == NULL || prefer_dpll) { |
1094 | /* | 1085 | /* |
@@ -1098,17 +1089,21 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
1098 | * use a 50MHz DPLL by choice | 1089 | * use a 50MHz DPLL by choice |
1099 | */ | 1090 | */ |
1100 | unsigned int f_low, f_high; | 1091 | unsigned int f_low, f_high; |
1101 | int adjust; | 1092 | int dpll, adjust; |
1102 | 1093 | ||
1103 | clock_slot = 2; | 1094 | /* Compute DPLL */ |
1095 | dpll = 2; | ||
1104 | if (port->udma_mask & 0xE0) | 1096 | if (port->udma_mask & 0xE0) |
1105 | clock_slot = 3; | 1097 | dpll = 3; |
1106 | 1098 | ||
1107 | f_low = (MHz[clock_slot] * chip_table->base) / 192; | 1099 | f_low = (MHz[clock_slot] * 48) / MHz[dpll]; |
1108 | f_high = f_low + 2; | 1100 | f_high = f_low + 2; |
1101 | if (clock_slot > 1) | ||
1102 | f_high += 2; | ||
1109 | 1103 | ||
1110 | /* Select the DPLL clock. */ | 1104 | /* Select the DPLL clock. */ |
1111 | pci_write_config_byte(dev, 0x5b, 0x21); | 1105 | pci_write_config_byte(dev, 0x5b, 0x21); |
1106 | pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low); | ||
1112 | 1107 | ||
1113 | for(adjust = 0; adjust < 8; adjust++) { | 1108 | for(adjust = 0; adjust < 8; adjust++) { |
1114 | if (hpt37x_calibrate_dpll(dev)) | 1109 | if (hpt37x_calibrate_dpll(dev)) |
@@ -1124,12 +1119,12 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
1124 | printk(KERN_WARNING "hpt37x: DPLL did not stabilize.\n"); | 1119 | printk(KERN_WARNING "hpt37x: DPLL did not stabilize.\n"); |
1125 | return -ENODEV; | 1120 | return -ENODEV; |
1126 | } | 1121 | } |
1127 | if (clock_slot == 3) | 1122 | if (dpll == 3) |
1128 | private_data = (void *)hpt37x_timings_66; | 1123 | private_data = (void *)hpt37x_timings_66; |
1129 | else | 1124 | else |
1130 | private_data = (void *)hpt37x_timings_50; | 1125 | private_data = (void *)hpt37x_timings_50; |
1131 | 1126 | ||
1132 | printk(KERN_INFO "hpt37x: Bus clock %dMHz, using DPLL.\n", MHz[clock_slot]); | 1127 | printk(KERN_INFO "hpt37x: Bus clock %dMHz, using DPLL.\n", MHz[dpll]); |
1133 | } else { | 1128 | } else { |
1134 | private_data = (void *)chip_table->clocks[clock_slot]; | 1129 | private_data = (void *)chip_table->clocks[clock_slot]; |
1135 | /* | 1130 | /* |
diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c index f25154aed75d..e947433cb37d 100644 --- a/drivers/ata/pata_hpt3x2n.c +++ b/drivers/ata/pata_hpt3x2n.c | |||
@@ -521,8 +521,8 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
521 | /* 371N if rev > 1 */ | 521 | /* 371N if rev > 1 */ |
522 | break; | 522 | break; |
523 | case PCI_DEVICE_ID_TTI_HPT372: | 523 | case PCI_DEVICE_ID_TTI_HPT372: |
524 | /* 372N if rev >= 1*/ | 524 | /* 372N if rev >= 2*/ |
525 | if (class_rev == 0) | 525 | if (class_rev < 2) |
526 | return -ENODEV; | 526 | return -ENODEV; |
527 | break; | 527 | break; |
528 | case PCI_DEVICE_ID_TTI_HPT302: | 528 | case PCI_DEVICE_ID_TTI_HPT302: |
diff --git a/drivers/ata/pata_hpt3x3.c b/drivers/ata/pata_hpt3x3.c index bbabe7902fbb..8ce5e23a5f75 100644 --- a/drivers/ata/pata_hpt3x3.c +++ b/drivers/ata/pata_hpt3x3.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/libata.h> | 23 | #include <linux/libata.h> |
24 | 24 | ||
25 | #define DRV_NAME "pata_hpt3x3" | 25 | #define DRV_NAME "pata_hpt3x3" |
26 | #define DRV_VERSION "0.4.2" | 26 | #define DRV_VERSION "0.4.3" |
27 | 27 | ||
28 | /** | 28 | /** |
29 | * hpt3x3_set_piomode - PIO setup | 29 | * hpt3x3_set_piomode - PIO setup |
diff --git a/drivers/ata/pata_isapnp.c b/drivers/ata/pata_isapnp.c index d042efdfbac4..1f647b648204 100644 --- a/drivers/ata/pata_isapnp.c +++ b/drivers/ata/pata_isapnp.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/libata.h> | 17 | #include <linux/libata.h> |
18 | 18 | ||
19 | #define DRV_NAME "pata_isapnp" | 19 | #define DRV_NAME "pata_isapnp" |
20 | #define DRV_VERSION "0.2.0" | 20 | #define DRV_VERSION "0.2.1" |
21 | 21 | ||
22 | static struct scsi_host_template isapnp_sht = { | 22 | static struct scsi_host_template isapnp_sht = { |
23 | .module = THIS_MODULE, | 23 | .module = THIS_MODULE, |
diff --git a/drivers/ata/pata_it8213.c b/drivers/ata/pata_it8213.c index a769952646e1..95b0bb61788b 100644 --- a/drivers/ata/pata_it8213.c +++ b/drivers/ata/pata_it8213.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/ata.h> | 19 | #include <linux/ata.h> |
20 | 20 | ||
21 | #define DRV_NAME "pata_it8213" | 21 | #define DRV_NAME "pata_it8213" |
22 | #define DRV_VERSION "0.0.2" | 22 | #define DRV_VERSION "0.0.3" |
23 | 23 | ||
24 | /** | 24 | /** |
25 | * it8213_pre_reset - check for 40/80 pin | 25 | * it8213_pre_reset - check for 40/80 pin |
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index ff9a6fd36657..b3456d7a592c 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * ata-it821x.c - IT821x PATA for new ATA layer | 2 | * pata_it821x.c - IT821x PATA for new ATA layer |
3 | * (C) 2005 Red Hat Inc | 3 | * (C) 2005 Red Hat Inc |
4 | * Alan Cox <alan@redhat.com> | 4 | * Alan Cox <alan@redhat.com> |
5 | * | 5 | * |
@@ -65,7 +65,6 @@ | |||
65 | * | 65 | * |
66 | * TODO | 66 | * TODO |
67 | * - ATAPI and other speed filtering | 67 | * - ATAPI and other speed filtering |
68 | * - Command filter in smart mode | ||
69 | * - RAID configuration ioctls | 68 | * - RAID configuration ioctls |
70 | */ | 69 | */ |
71 | 70 | ||
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c index b994351fbcd0..8d2bc1e9e871 100644 --- a/drivers/ata/pata_ixp4xx_cf.c +++ b/drivers/ata/pata_ixp4xx_cf.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <scsi/scsi_host.h> | 23 | #include <scsi/scsi_host.h> |
24 | 24 | ||
25 | #define DRV_NAME "pata_ixp4xx_cf" | 25 | #define DRV_NAME "pata_ixp4xx_cf" |
26 | #define DRV_VERSION "0.1.2" | 26 | #define DRV_VERSION "0.1.3" |
27 | 27 | ||
28 | static int ixp4xx_set_mode(struct ata_port *ap, struct ata_device **error) | 28 | static int ixp4xx_set_mode(struct ata_port *ap, struct ata_device **error) |
29 | { | 29 | { |
diff --git a/drivers/ata/pata_jmicron.c b/drivers/ata/pata_jmicron.c index 8d799e87f752..2af7ff8256ca 100644 --- a/drivers/ata/pata_jmicron.c +++ b/drivers/ata/pata_jmicron.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/ata.h> | 19 | #include <linux/ata.h> |
20 | 20 | ||
21 | #define DRV_NAME "pata_jmicron" | 21 | #define DRV_NAME "pata_jmicron" |
22 | #define DRV_VERSION "0.1.4" | 22 | #define DRV_VERSION "0.1.5" |
23 | 23 | ||
24 | typedef enum { | 24 | typedef enum { |
25 | PORT_PATA0 = 0, | 25 | PORT_PATA0 = 0, |
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c index 707099291e01..edffc25d2d3f 100644 --- a/drivers/ata/pata_legacy.c +++ b/drivers/ata/pata_legacy.c | |||
@@ -64,7 +64,7 @@ | |||
64 | #include <linux/platform_device.h> | 64 | #include <linux/platform_device.h> |
65 | 65 | ||
66 | #define DRV_NAME "pata_legacy" | 66 | #define DRV_NAME "pata_legacy" |
67 | #define DRV_VERSION "0.5.4" | 67 | #define DRV_VERSION "0.5.5" |
68 | 68 | ||
69 | #define NR_HOST 6 | 69 | #define NR_HOST 6 |
70 | 70 | ||
diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c index 1f6384895a4f..cbb7866940d6 100644 --- a/drivers/ata/pata_platform.c +++ b/drivers/ata/pata_platform.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/pata_platform.h> | 22 | #include <linux/pata_platform.h> |
23 | 23 | ||
24 | #define DRV_NAME "pata_platform" | 24 | #define DRV_NAME "pata_platform" |
25 | #define DRV_VERSION "0.1.2" | 25 | #define DRV_VERSION "1.0" |
26 | 26 | ||
27 | static int pio_mask = 1; | 27 | static int pio_mask = 1; |
28 | 28 | ||
diff --git a/drivers/ata/pata_qdi.c b/drivers/ata/pata_qdi.c index fb8c9e14b8d4..1998c19e8743 100644 --- a/drivers/ata/pata_qdi.c +++ b/drivers/ata/pata_qdi.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
27 | 27 | ||
28 | #define DRV_NAME "pata_qdi" | 28 | #define DRV_NAME "pata_qdi" |
29 | #define DRV_VERSION "0.3.0" | 29 | #define DRV_VERSION "0.3.1" |
30 | 30 | ||
31 | #define NR_HOST 4 /* Two 6580s */ | 31 | #define NR_HOST 4 /* Two 6580s */ |
32 | 32 | ||
diff --git a/drivers/ata/pata_rz1000.c b/drivers/ata/pata_rz1000.c index 2bfd7ef42af5..a3488b41ad26 100644 --- a/drivers/ata/pata_rz1000.c +++ b/drivers/ata/pata_rz1000.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/libata.h> | 21 | #include <linux/libata.h> |
22 | 22 | ||
23 | #define DRV_NAME "pata_rz1000" | 23 | #define DRV_NAME "pata_rz1000" |
24 | #define DRV_VERSION "0.2.3" | 24 | #define DRV_VERSION "0.2.4" |
25 | 25 | ||
26 | 26 | ||
27 | /** | 27 | /** |
diff --git a/drivers/ata/pata_sc1200.c b/drivers/ata/pata_sc1200.c index 225013ecf4b6..1233063ab9a8 100644 --- a/drivers/ata/pata_sc1200.c +++ b/drivers/ata/pata_sc1200.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #include <linux/libata.h> | 40 | #include <linux/libata.h> |
41 | 41 | ||
42 | #define DRV_NAME "sc1200" | 42 | #define DRV_NAME "sc1200" |
43 | #define DRV_VERSION "0.2.4" | 43 | #define DRV_VERSION "0.2.5" |
44 | 44 | ||
45 | #define SC1200_REV_A 0x00 | 45 | #define SC1200_REV_A 0x00 |
46 | #define SC1200_REV_B1 0x01 | 46 | #define SC1200_REV_B1 0x01 |
diff --git a/drivers/ata/pata_scc.c b/drivers/ata/pata_scc.c index cca3aa225efe..61502bc7bf1d 100644 --- a/drivers/ata/pata_scc.c +++ b/drivers/ata/pata_scc.c | |||
@@ -43,7 +43,7 @@ | |||
43 | #include <linux/libata.h> | 43 | #include <linux/libata.h> |
44 | 44 | ||
45 | #define DRV_NAME "pata_scc" | 45 | #define DRV_NAME "pata_scc" |
46 | #define DRV_VERSION "0.1" | 46 | #define DRV_VERSION "0.2" |
47 | 47 | ||
48 | #define PCI_DEVICE_ID_TOSHIBA_SCC_ATA 0x01b4 | 48 | #define PCI_DEVICE_ID_TOSHIBA_SCC_ATA 0x01b4 |
49 | 49 | ||
@@ -489,23 +489,26 @@ static unsigned int scc_devchk (struct ata_port *ap, | |||
489 | * Note: Original code is ata_bus_post_reset(). | 489 | * Note: Original code is ata_bus_post_reset(). |
490 | */ | 490 | */ |
491 | 491 | ||
492 | static void scc_bus_post_reset (struct ata_port *ap, unsigned int devmask) | 492 | static int scc_bus_post_reset(struct ata_port *ap, unsigned int devmask, |
493 | unsigned long deadline) | ||
493 | { | 494 | { |
494 | struct ata_ioports *ioaddr = &ap->ioaddr; | 495 | struct ata_ioports *ioaddr = &ap->ioaddr; |
495 | unsigned int dev0 = devmask & (1 << 0); | 496 | unsigned int dev0 = devmask & (1 << 0); |
496 | unsigned int dev1 = devmask & (1 << 1); | 497 | unsigned int dev1 = devmask & (1 << 1); |
497 | unsigned long timeout; | 498 | int rc; |
498 | 499 | ||
499 | /* if device 0 was found in ata_devchk, wait for its | 500 | /* if device 0 was found in ata_devchk, wait for its |
500 | * BSY bit to clear | 501 | * BSY bit to clear |
501 | */ | 502 | */ |
502 | if (dev0) | 503 | if (dev0) { |
503 | ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT); | 504 | rc = ata_wait_ready(ap, deadline); |
505 | if (rc && rc != -ENODEV) | ||
506 | return rc; | ||
507 | } | ||
504 | 508 | ||
505 | /* if device 1 was found in ata_devchk, wait for | 509 | /* if device 1 was found in ata_devchk, wait for |
506 | * register access, then wait for BSY to clear | 510 | * register access, then wait for BSY to clear |
507 | */ | 511 | */ |
508 | timeout = jiffies + ATA_TMOUT_BOOT; | ||
509 | while (dev1) { | 512 | while (dev1) { |
510 | u8 nsect, lbal; | 513 | u8 nsect, lbal; |
511 | 514 | ||
@@ -514,14 +517,15 @@ static void scc_bus_post_reset (struct ata_port *ap, unsigned int devmask) | |||
514 | lbal = in_be32(ioaddr->lbal_addr); | 517 | lbal = in_be32(ioaddr->lbal_addr); |
515 | if ((nsect == 1) && (lbal == 1)) | 518 | if ((nsect == 1) && (lbal == 1)) |
516 | break; | 519 | break; |
517 | if (time_after(jiffies, timeout)) { | 520 | if (time_after(jiffies, deadline)) |
518 | dev1 = 0; | 521 | return -EBUSY; |
519 | break; | ||
520 | } | ||
521 | msleep(50); /* give drive a breather */ | 522 | msleep(50); /* give drive a breather */ |
522 | } | 523 | } |
523 | if (dev1) | 524 | if (dev1) { |
524 | ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT); | 525 | rc = ata_wait_ready(ap, deadline); |
526 | if (rc && rc != -ENODEV) | ||
527 | return rc; | ||
528 | } | ||
525 | 529 | ||
526 | /* is all this really necessary? */ | 530 | /* is all this really necessary? */ |
527 | ap->ops->dev_select(ap, 0); | 531 | ap->ops->dev_select(ap, 0); |
@@ -529,6 +533,8 @@ static void scc_bus_post_reset (struct ata_port *ap, unsigned int devmask) | |||
529 | ap->ops->dev_select(ap, 1); | 533 | ap->ops->dev_select(ap, 1); |
530 | if (dev0) | 534 | if (dev0) |
531 | ap->ops->dev_select(ap, 0); | 535 | ap->ops->dev_select(ap, 0); |
536 | |||
537 | return 0; | ||
532 | } | 538 | } |
533 | 539 | ||
534 | /** | 540 | /** |
@@ -537,8 +543,8 @@ static void scc_bus_post_reset (struct ata_port *ap, unsigned int devmask) | |||
537 | * Note: Original code is ata_bus_softreset(). | 543 | * Note: Original code is ata_bus_softreset(). |
538 | */ | 544 | */ |
539 | 545 | ||
540 | static unsigned int scc_bus_softreset (struct ata_port *ap, | 546 | static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask, |
541 | unsigned int devmask) | 547 | unsigned long deadline) |
542 | { | 548 | { |
543 | struct ata_ioports *ioaddr = &ap->ioaddr; | 549 | struct ata_ioports *ioaddr = &ap->ioaddr; |
544 | 550 | ||
@@ -570,7 +576,7 @@ static unsigned int scc_bus_softreset (struct ata_port *ap, | |||
570 | if (scc_check_status(ap) == 0xFF) | 576 | if (scc_check_status(ap) == 0xFF) |
571 | return 0; | 577 | return 0; |
572 | 578 | ||
573 | scc_bus_post_reset(ap, devmask); | 579 | scc_bus_post_reset(ap, devmask, deadline); |
574 | 580 | ||
575 | return 0; | 581 | return 0; |
576 | } | 582 | } |
@@ -579,11 +585,13 @@ static unsigned int scc_bus_softreset (struct ata_port *ap, | |||
579 | * scc_std_softreset - reset host port via ATA SRST | 585 | * scc_std_softreset - reset host port via ATA SRST |
580 | * @ap: port to reset | 586 | * @ap: port to reset |
581 | * @classes: resulting classes of attached devices | 587 | * @classes: resulting classes of attached devices |
588 | * @deadline: deadline jiffies for the operation | ||
582 | * | 589 | * |
583 | * Note: Original code is ata_std_softreset(). | 590 | * Note: Original code is ata_std_softreset(). |
584 | */ | 591 | */ |
585 | 592 | ||
586 | static int scc_std_softreset (struct ata_port *ap, unsigned int *classes) | 593 | static int scc_std_softreset (struct ata_port *ap, unsigned int *classes, |
594 | unsigned long deadline) | ||
587 | { | 595 | { |
588 | unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS; | 596 | unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS; |
589 | unsigned int devmask = 0, err_mask; | 597 | unsigned int devmask = 0, err_mask; |
@@ -607,7 +615,7 @@ static int scc_std_softreset (struct ata_port *ap, unsigned int *classes) | |||
607 | 615 | ||
608 | /* issue bus reset */ | 616 | /* issue bus reset */ |
609 | DPRINTK("about to softreset, devmask=%x\n", devmask); | 617 | DPRINTK("about to softreset, devmask=%x\n", devmask); |
610 | err_mask = scc_bus_softreset(ap, devmask); | 618 | err_mask = scc_bus_softreset(ap, devmask, deadline); |
611 | if (err_mask) { | 619 | if (err_mask) { |
612 | ata_port_printk(ap, KERN_ERR, "SRST failed (err_mask=0x%x)\n", | 620 | ata_port_printk(ap, KERN_ERR, "SRST failed (err_mask=0x%x)\n", |
613 | err_mask); | 621 | err_mask); |
@@ -676,10 +684,11 @@ static void scc_bmdma_stop (struct ata_queued_cmd *qc) | |||
676 | 684 | ||
677 | if (reg & INTSTS_BMSINT) { | 685 | if (reg & INTSTS_BMSINT) { |
678 | unsigned int classes; | 686 | unsigned int classes; |
687 | unsigned long deadline = jiffies + ATA_TMOUT_BOOT; | ||
679 | printk(KERN_WARNING "%s: Internal Bus Error\n", DRV_NAME); | 688 | printk(KERN_WARNING "%s: Internal Bus Error\n", DRV_NAME); |
680 | out_be32(bmid_base + SCC_DMA_INTST, INTSTS_BMSINT); | 689 | out_be32(bmid_base + SCC_DMA_INTST, INTSTS_BMSINT); |
681 | /* TBD: SW reset */ | 690 | /* TBD: SW reset */ |
682 | scc_std_softreset(ap, &classes); | 691 | scc_std_softreset(ap, &classes, deadline); |
683 | continue; | 692 | continue; |
684 | } | 693 | } |
685 | 694 | ||
@@ -862,12 +871,13 @@ static void scc_bmdma_freeze (struct ata_port *ap) | |||
862 | /** | 871 | /** |
863 | * scc_pata_prereset - prepare for reset | 872 | * scc_pata_prereset - prepare for reset |
864 | * @ap: ATA port to be reset | 873 | * @ap: ATA port to be reset |
874 | * @deadline: deadline jiffies for the operation | ||
865 | */ | 875 | */ |
866 | 876 | ||
867 | static int scc_pata_prereset (struct ata_port *ap) | 877 | static int scc_pata_prereset(struct ata_port *ap, unsigned long deadline) |
868 | { | 878 | { |
869 | ap->cbl = ATA_CBL_PATA80; | 879 | ap->cbl = ATA_CBL_PATA80; |
870 | return ata_std_prereset(ap); | 880 | return ata_std_prereset(ap, deadline); |
871 | } | 881 | } |
872 | 882 | ||
873 | /** | 883 | /** |
diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c index dee6e211949d..1e8f421963c7 100644 --- a/drivers/ata/pata_serverworks.c +++ b/drivers/ata/pata_serverworks.c | |||
@@ -41,7 +41,7 @@ | |||
41 | #include <linux/libata.h> | 41 | #include <linux/libata.h> |
42 | 42 | ||
43 | #define DRV_NAME "pata_serverworks" | 43 | #define DRV_NAME "pata_serverworks" |
44 | #define DRV_VERSION "0.4.0" | 44 | #define DRV_VERSION "0.4.1" |
45 | 45 | ||
46 | #define SVWKS_CSB5_REVISION_NEW 0x92 /* min PCI_REVISION_ID for UDMA5 (A2.0) */ | 46 | #define SVWKS_CSB5_REVISION_NEW 0x92 /* min PCI_REVISION_ID for UDMA5 (A2.0) */ |
47 | #define SVWKS_CSB6_REVISION 0xa0 /* min PCI_REVISION_ID for UDMA4 (A1.0) */ | 47 | #define SVWKS_CSB6_REVISION 0xa0 /* min PCI_REVISION_ID for UDMA4 (A1.0) */ |
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c index f2231267e011..ec3ae9375015 100644 --- a/drivers/ata/pata_sis.c +++ b/drivers/ata/pata_sis.c | |||
@@ -73,14 +73,14 @@ static int sis_short_ata40(struct pci_dev *dev) | |||
73 | } | 73 | } |
74 | 74 | ||
75 | /** | 75 | /** |
76 | * sis_port_base - return PCI configuration base for dev | 76 | * sis_old_port_base - return PCI configuration base for dev |
77 | * @adev: device | 77 | * @adev: device |
78 | * | 78 | * |
79 | * Returns the base of the PCI configuration registers for this port | 79 | * Returns the base of the PCI configuration registers for this port |
80 | * number. | 80 | * number. |
81 | */ | 81 | */ |
82 | 82 | ||
83 | static int sis_port_base(struct ata_device *adev) | 83 | static int sis_old_port_base(struct ata_device *adev) |
84 | { | 84 | { |
85 | return 0x40 + (4 * adev->ap->port_no) + (2 * adev->devno); | 85 | return 0x40 + (4 * adev->ap->port_no) + (2 * adev->devno); |
86 | } | 86 | } |
@@ -211,7 +211,7 @@ static void sis_set_fifo(struct ata_port *ap, struct ata_device *adev) | |||
211 | static void sis_old_set_piomode (struct ata_port *ap, struct ata_device *adev) | 211 | static void sis_old_set_piomode (struct ata_port *ap, struct ata_device *adev) |
212 | { | 212 | { |
213 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 213 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
214 | int port = sis_port_base(adev); | 214 | int port = sis_old_port_base(adev); |
215 | u8 t1, t2; | 215 | u8 t1, t2; |
216 | int speed = adev->pio_mode - XFER_PIO_0; | 216 | int speed = adev->pio_mode - XFER_PIO_0; |
217 | 217 | ||
@@ -248,7 +248,7 @@ static void sis_old_set_piomode (struct ata_port *ap, struct ata_device *adev) | |||
248 | static void sis_100_set_piomode (struct ata_port *ap, struct ata_device *adev) | 248 | static void sis_100_set_piomode (struct ata_port *ap, struct ata_device *adev) |
249 | { | 249 | { |
250 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 250 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
251 | int port = sis_port_base(adev); | 251 | int port = sis_old_port_base(adev); |
252 | int speed = adev->pio_mode - XFER_PIO_0; | 252 | int speed = adev->pio_mode - XFER_PIO_0; |
253 | 253 | ||
254 | const u8 actrec[] = { 0x00, 0x67, 0x44, 0x33, 0x31 }; | 254 | const u8 actrec[] = { 0x00, 0x67, 0x44, 0x33, 0x31 }; |
@@ -328,7 +328,7 @@ static void sis_old_set_dmamode (struct ata_port *ap, struct ata_device *adev) | |||
328 | { | 328 | { |
329 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 329 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
330 | int speed = adev->dma_mode - XFER_MW_DMA_0; | 330 | int speed = adev->dma_mode - XFER_MW_DMA_0; |
331 | int drive_pci = sis_port_base(adev); | 331 | int drive_pci = sis_old_port_base(adev); |
332 | u16 timing; | 332 | u16 timing; |
333 | 333 | ||
334 | const u16 mwdma_bits[] = { 0x707, 0x202, 0x202 }; | 334 | const u16 mwdma_bits[] = { 0x707, 0x202, 0x202 }; |
@@ -367,7 +367,7 @@ static void sis_66_set_dmamode (struct ata_port *ap, struct ata_device *adev) | |||
367 | { | 367 | { |
368 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 368 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
369 | int speed = adev->dma_mode - XFER_MW_DMA_0; | 369 | int speed = adev->dma_mode - XFER_MW_DMA_0; |
370 | int drive_pci = sis_port_base(adev); | 370 | int drive_pci = sis_old_port_base(adev); |
371 | u16 timing; | 371 | u16 timing; |
372 | 372 | ||
373 | const u16 mwdma_bits[] = { 0x707, 0x202, 0x202 }; | 373 | const u16 mwdma_bits[] = { 0x707, 0x202, 0x202 }; |
@@ -378,12 +378,12 @@ static void sis_66_set_dmamode (struct ata_port *ap, struct ata_device *adev) | |||
378 | if (adev->dma_mode < XFER_UDMA_0) { | 378 | if (adev->dma_mode < XFER_UDMA_0) { |
379 | /* bits 3-0 hold recovery timing bits 8-10 active timing and | 379 | /* bits 3-0 hold recovery timing bits 8-10 active timing and |
380 | the higer bits are dependant on the device, bit 15 udma */ | 380 | the higer bits are dependant on the device, bit 15 udma */ |
381 | timing &= ~ 0x870F; | 381 | timing &= ~0x870F; |
382 | timing |= mwdma_bits[speed]; | 382 | timing |= mwdma_bits[speed]; |
383 | } else { | 383 | } else { |
384 | /* Bit 15 is UDMA on/off, bit 12-14 are cycle time */ | 384 | /* Bit 15 is UDMA on/off, bit 12-14 are cycle time */ |
385 | speed = adev->dma_mode - XFER_UDMA_0; | 385 | speed = adev->dma_mode - XFER_UDMA_0; |
386 | timing &= ~0x6000; | 386 | timing &= ~0xF000; |
387 | timing |= udma_bits[speed]; | 387 | timing |= udma_bits[speed]; |
388 | } | 388 | } |
389 | pci_write_config_word(pdev, drive_pci, timing); | 389 | pci_write_config_word(pdev, drive_pci, timing); |
@@ -405,22 +405,22 @@ static void sis_100_set_dmamode (struct ata_port *ap, struct ata_device *adev) | |||
405 | { | 405 | { |
406 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 406 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
407 | int speed = adev->dma_mode - XFER_MW_DMA_0; | 407 | int speed = adev->dma_mode - XFER_MW_DMA_0; |
408 | int drive_pci = sis_port_base(adev); | 408 | int drive_pci = sis_old_port_base(adev); |
409 | u16 timing; | 409 | u8 timing; |
410 | 410 | ||
411 | const u16 udma_bits[] = { 0x8B00, 0x8700, 0x8500, 0x8300, 0x8200, 0x8100}; | 411 | const u8 udma_bits[] = { 0x8B, 0x87, 0x85, 0x83, 0x82, 0x81}; |
412 | 412 | ||
413 | pci_read_config_word(pdev, drive_pci, &timing); | 413 | pci_read_config_byte(pdev, drive_pci + 1, &timing); |
414 | 414 | ||
415 | if (adev->dma_mode < XFER_UDMA_0) { | 415 | if (adev->dma_mode < XFER_UDMA_0) { |
416 | /* NOT SUPPORTED YET: NEED DATA SHEET. DITTO IN OLD DRIVER */ | 416 | /* NOT SUPPORTED YET: NEED DATA SHEET. DITTO IN OLD DRIVER */ |
417 | } else { | 417 | } else { |
418 | /* Bit 15 is UDMA on/off, bit 12-14 are cycle time */ | 418 | /* Bit 7 is UDMA on/off, bit 0-3 are cycle time */ |
419 | speed = adev->dma_mode - XFER_UDMA_0; | 419 | speed = adev->dma_mode - XFER_UDMA_0; |
420 | timing &= ~0x0F00; | 420 | timing &= ~0x8F; |
421 | timing |= udma_bits[speed]; | 421 | timing |= udma_bits[speed]; |
422 | } | 422 | } |
423 | pci_write_config_word(pdev, drive_pci, timing); | 423 | pci_write_config_byte(pdev, drive_pci + 1, timing); |
424 | } | 424 | } |
425 | 425 | ||
426 | /** | 426 | /** |
@@ -440,22 +440,22 @@ static void sis_133_early_set_dmamode (struct ata_port *ap, struct ata_device *a | |||
440 | { | 440 | { |
441 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 441 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
442 | int speed = adev->dma_mode - XFER_MW_DMA_0; | 442 | int speed = adev->dma_mode - XFER_MW_DMA_0; |
443 | int drive_pci = sis_port_base(adev); | 443 | int drive_pci = sis_old_port_base(adev); |
444 | u16 timing; | 444 | u8 timing; |
445 | 445 | /* Low 4 bits are timing */ | |
446 | static const u16 udma_bits[] = { 0x8F00, 0x8A00, 0x8700, 0x8500, 0x8300, 0x8200, 0x8100}; | 446 | static const u8 udma_bits[] = { 0x8F, 0x8A, 0x87, 0x85, 0x83, 0x82, 0x81}; |
447 | 447 | ||
448 | pci_read_config_word(pdev, drive_pci, &timing); | 448 | pci_read_config_byte(pdev, drive_pci + 1, &timing); |
449 | 449 | ||
450 | if (adev->dma_mode < XFER_UDMA_0) { | 450 | if (adev->dma_mode < XFER_UDMA_0) { |
451 | /* NOT SUPPORTED YET: NEED DATA SHEET. DITTO IN OLD DRIVER */ | 451 | /* NOT SUPPORTED YET: NEED DATA SHEET. DITTO IN OLD DRIVER */ |
452 | } else { | 452 | } else { |
453 | /* Bit 15 is UDMA on/off, bit 12-14 are cycle time */ | 453 | /* Bit 7 is UDMA on/off, bit 0-3 are cycle time */ |
454 | speed = adev->dma_mode - XFER_UDMA_0; | 454 | speed = adev->dma_mode - XFER_UDMA_0; |
455 | timing &= ~0x0F00; | 455 | timing &= ~0x8F; |
456 | timing |= udma_bits[speed]; | 456 | timing |= udma_bits[speed]; |
457 | } | 457 | } |
458 | pci_write_config_word(pdev, drive_pci, timing); | 458 | pci_write_config_byte(pdev, drive_pci + 1, timing); |
459 | } | 459 | } |
460 | 460 | ||
461 | /** | 461 | /** |
diff --git a/drivers/ata/pata_sl82c105.c b/drivers/ata/pata_sl82c105.c index f48491ad5f3a..e5aaec43694d 100644 --- a/drivers/ata/pata_sl82c105.c +++ b/drivers/ata/pata_sl82c105.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <linux/libata.h> | 26 | #include <linux/libata.h> |
27 | 27 | ||
28 | #define DRV_NAME "pata_sl82c105" | 28 | #define DRV_NAME "pata_sl82c105" |
29 | #define DRV_VERSION "0.3.0" | 29 | #define DRV_VERSION "0.3.1" |
30 | 30 | ||
31 | enum { | 31 | enum { |
32 | /* | 32 | /* |
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index e4c71f76bd55..a8462f1e890b 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c | |||
@@ -60,6 +60,7 @@ | |||
60 | #include <linux/delay.h> | 60 | #include <linux/delay.h> |
61 | #include <scsi/scsi_host.h> | 61 | #include <scsi/scsi_host.h> |
62 | #include <linux/libata.h> | 62 | #include <linux/libata.h> |
63 | #include <linux/dmi.h> | ||
63 | 64 | ||
64 | #define DRV_NAME "pata_via" | 65 | #define DRV_NAME "pata_via" |
65 | #define DRV_VERSION "0.3.1" | 66 | #define DRV_VERSION "0.3.1" |
@@ -122,6 +123,31 @@ static const struct via_isa_bridge { | |||
122 | { NULL } | 123 | { NULL } |
123 | }; | 124 | }; |
124 | 125 | ||
126 | |||
127 | /* | ||
128 | * Cable special cases | ||
129 | */ | ||
130 | |||
131 | static struct dmi_system_id cable_dmi_table[] = { | ||
132 | { | ||
133 | .ident = "Acer Ferrari 3400", | ||
134 | .matches = { | ||
135 | DMI_MATCH(DMI_BOARD_VENDOR, "Acer,Inc."), | ||
136 | DMI_MATCH(DMI_BOARD_NAME, "Ferrari 3400"), | ||
137 | }, | ||
138 | }, | ||
139 | { } | ||
140 | }; | ||
141 | |||
142 | static int via_cable_override(struct pci_dev *pdev) | ||
143 | { | ||
144 | /* Systems by DMI */ | ||
145 | if (dmi_check_system(cable_dmi_table)) | ||
146 | return 1; | ||
147 | return 0; | ||
148 | } | ||
149 | |||
150 | |||
125 | /** | 151 | /** |
126 | * via_cable_detect - cable detection | 152 | * via_cable_detect - cable detection |
127 | * @ap: ATA port | 153 | * @ap: ATA port |
@@ -139,6 +165,9 @@ static int via_cable_detect(struct ata_port *ap) { | |||
139 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 165 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
140 | u32 ata66; | 166 | u32 ata66; |
141 | 167 | ||
168 | if (via_cable_override(pdev)) | ||
169 | return ATA_CBL_PATA40_SHORT; | ||
170 | |||
142 | /* Early chips are 40 wire */ | 171 | /* Early chips are 40 wire */ |
143 | if ((config->flags & VIA_UDMA) < VIA_UDMA_66) | 172 | if ((config->flags & VIA_UDMA) < VIA_UDMA_66) |
144 | return ATA_CBL_PATA40; | 173 | return ATA_CBL_PATA40; |
@@ -592,10 +621,11 @@ static int via_reinit_one(struct pci_dev *pdev) | |||
592 | #endif | 621 | #endif |
593 | 622 | ||
594 | static const struct pci_device_id via[] = { | 623 | static const struct pci_device_id via[] = { |
595 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C576_1), }, | 624 | { PCI_VDEVICE(VIA, 0x0571), }, |
596 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C586_1), }, | 625 | { PCI_VDEVICE(VIA, 0x0581), }, |
597 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_6410), }, | 626 | { PCI_VDEVICE(VIA, 0x1571), }, |
598 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_SATA_EIDE), }, | 627 | { PCI_VDEVICE(VIA, 0x3164), }, |
628 | { PCI_VDEVICE(VIA, 0x5324), }, | ||
599 | 629 | ||
600 | { }, | 630 | { }, |
601 | }; | 631 | }; |
diff --git a/drivers/ata/pata_winbond.c b/drivers/ata/pata_winbond.c index cc4ad271afb5..83abfeca4057 100644 --- a/drivers/ata/pata_winbond.c +++ b/drivers/ata/pata_winbond.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | 17 | ||
18 | #define DRV_NAME "pata_winbond" | 18 | #define DRV_NAME "pata_winbond" |
19 | #define DRV_VERSION "0.0.2" | 19 | #define DRV_VERSION "0.0.3" |
20 | 20 | ||
21 | #define NR_HOST 4 /* Two winbond controllers, two channels each */ | 21 | #define NR_HOST 4 /* Two winbond controllers, two channels each */ |
22 | 22 | ||
diff --git a/drivers/ata/pdc_adma.c b/drivers/ata/pdc_adma.c index 52b69530ab29..f12c2b6ac08e 100644 --- a/drivers/ata/pdc_adma.c +++ b/drivers/ata/pdc_adma.c | |||
@@ -44,7 +44,7 @@ | |||
44 | #include <linux/libata.h> | 44 | #include <linux/libata.h> |
45 | 45 | ||
46 | #define DRV_NAME "pdc_adma" | 46 | #define DRV_NAME "pdc_adma" |
47 | #define DRV_VERSION "0.05" | 47 | #define DRV_VERSION "0.06" |
48 | 48 | ||
49 | /* macro to calculate base address for ATA regs */ | 49 | /* macro to calculate base address for ATA regs */ |
50 | #define ADMA_ATA_REGS(base,port_no) ((base) + ((port_no) * 0x40)) | 50 | #define ADMA_ATA_REGS(base,port_no) ((base) + ((port_no) * 0x40)) |
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c index bda5e7747c21..2d80c9d95e95 100644 --- a/drivers/ata/sata_inic162x.c +++ b/drivers/ata/sata_inic162x.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <scsi/scsi_device.h> | 28 | #include <scsi/scsi_device.h> |
29 | 29 | ||
30 | #define DRV_NAME "sata_inic162x" | 30 | #define DRV_NAME "sata_inic162x" |
31 | #define DRV_VERSION "0.1" | 31 | #define DRV_VERSION "0.2" |
32 | 32 | ||
33 | enum { | 33 | enum { |
34 | MMIO_BAR = 5, | 34 | MMIO_BAR = 5, |
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index cb9b9ac12b4c..c957e6e54ba1 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -21,6 +21,50 @@ | |||
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | 23 | ||
24 | /* | ||
25 | sata_mv TODO list: | ||
26 | |||
27 | 1) Needs a full errata audit for all chipsets. I implemented most | ||
28 | of the errata workarounds found in the Marvell vendor driver, but | ||
29 | I distinctly remember a couple workarounds (one related to PCI-X) | ||
30 | are still needed. | ||
31 | |||
32 | 2) Convert to LibATA new EH. Required for hotplug, NCQ, and sane | ||
33 | probing/error handling in general. MUST HAVE. | ||
34 | |||
35 | 3) Add hotplug support (easy, once new-EH support appears) | ||
36 | |||
37 | 4) Add NCQ support (easy to intermediate, once new-EH support appears) | ||
38 | |||
39 | 5) Investigate problems with PCI Message Signalled Interrupts (MSI). | ||
40 | |||
41 | 6) Add port multiplier support (intermediate) | ||
42 | |||
43 | 7) Test and verify 3.0 Gbps support | ||
44 | |||
45 | 8) Develop a low-power-consumption strategy, and implement it. | ||
46 | |||
47 | 9) [Experiment, low priority] See if ATAPI can be supported using | ||
48 | "unknown FIS" or "vendor-specific FIS" support, or something creative | ||
49 | like that. | ||
50 | |||
51 | 10) [Experiment, low priority] Investigate interrupt coalescing. | ||
52 | Quite often, especially with PCI Message Signalled Interrupts (MSI), | ||
53 | the overhead reduced by interrupt mitigation is quite often not | ||
54 | worth the latency cost. | ||
55 | |||
56 | 11) [Experiment, Marvell value added] Is it possible to use target | ||
57 | mode to cross-connect two Linux boxes with Marvell cards? If so, | ||
58 | creating LibATA target mode support would be very interesting. | ||
59 | |||
60 | Target mode, for those without docs, is the ability to directly | ||
61 | connect two SATA controllers. | ||
62 | |||
63 | 13) Verify that 7042 is fully supported. I only have a 6042. | ||
64 | |||
65 | */ | ||
66 | |||
67 | |||
24 | #include <linux/kernel.h> | 68 | #include <linux/kernel.h> |
25 | #include <linux/module.h> | 69 | #include <linux/module.h> |
26 | #include <linux/pci.h> | 70 | #include <linux/pci.h> |
@@ -35,7 +79,7 @@ | |||
35 | #include <linux/libata.h> | 79 | #include <linux/libata.h> |
36 | 80 | ||
37 | #define DRV_NAME "sata_mv" | 81 | #define DRV_NAME "sata_mv" |
38 | #define DRV_VERSION "0.8" | 82 | #define DRV_VERSION "0.81" |
39 | 83 | ||
40 | enum { | 84 | enum { |
41 | /* BAR's are enumerated in terms of pci_resource_start() terms */ | 85 | /* BAR's are enumerated in terms of pci_resource_start() terms */ |
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 4cea3ef75226..adfa693db53d 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
@@ -49,7 +49,7 @@ | |||
49 | #include <linux/libata.h> | 49 | #include <linux/libata.h> |
50 | 50 | ||
51 | #define DRV_NAME "sata_nv" | 51 | #define DRV_NAME "sata_nv" |
52 | #define DRV_VERSION "3.3" | 52 | #define DRV_VERSION "3.4" |
53 | 53 | ||
54 | #define NV_ADMA_DMA_BOUNDARY 0xffffffffUL | 54 | #define NV_ADMA_DMA_BOUNDARY 0xffffffffUL |
55 | 55 | ||
@@ -229,7 +229,6 @@ struct nv_host_priv { | |||
229 | #define NV_ADMA_CHECK_INTR(GCTL, PORT) ((GCTL) & ( 1 << (19 + (12 * (PORT))))) | 229 | #define NV_ADMA_CHECK_INTR(GCTL, PORT) ((GCTL) & ( 1 << (19 + (12 * (PORT))))) |
230 | 230 | ||
231 | static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); | 231 | static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); |
232 | static void nv_remove_one (struct pci_dev *pdev); | ||
233 | #ifdef CONFIG_PM | 232 | #ifdef CONFIG_PM |
234 | static int nv_pci_device_resume(struct pci_dev *pdev); | 233 | static int nv_pci_device_resume(struct pci_dev *pdev); |
235 | #endif | 234 | #endif |
@@ -288,12 +287,6 @@ static const struct pci_device_id nv_pci_tbl[] = { | |||
288 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA), GENERIC }, | 287 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA), GENERIC }, |
289 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2), GENERIC }, | 288 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2), GENERIC }, |
290 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3), GENERIC }, | 289 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3), GENERIC }, |
291 | { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, | ||
292 | PCI_ANY_ID, PCI_ANY_ID, | ||
293 | PCI_CLASS_STORAGE_IDE<<8, 0xffff00, GENERIC }, | ||
294 | { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, | ||
295 | PCI_ANY_ID, PCI_ANY_ID, | ||
296 | PCI_CLASS_STORAGE_RAID<<8, 0xffff00, GENERIC }, | ||
297 | 290 | ||
298 | { } /* terminate list */ | 291 | { } /* terminate list */ |
299 | }; | 292 | }; |
@@ -306,7 +299,7 @@ static struct pci_driver nv_pci_driver = { | |||
306 | .suspend = ata_pci_device_suspend, | 299 | .suspend = ata_pci_device_suspend, |
307 | .resume = nv_pci_device_resume, | 300 | .resume = nv_pci_device_resume, |
308 | #endif | 301 | #endif |
309 | .remove = nv_remove_one, | 302 | .remove = ata_pci_remove_one, |
310 | }; | 303 | }; |
311 | 304 | ||
312 | static struct scsi_host_template nv_sht = { | 305 | static struct scsi_host_template nv_sht = { |
@@ -809,7 +802,7 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance) | |||
809 | u16 status; | 802 | u16 status; |
810 | u32 gen_ctl; | 803 | u32 gen_ctl; |
811 | u32 notifier, notifier_error; | 804 | u32 notifier, notifier_error; |
812 | 805 | ||
813 | /* if ADMA is disabled, use standard ata interrupt handler */ | 806 | /* if ADMA is disabled, use standard ata interrupt handler */ |
814 | if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) { | 807 | if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) { |
815 | u8 irq_stat = readb(host->iomap[NV_MMIO_BAR] + NV_INT_STATUS_CK804) | 808 | u8 irq_stat = readb(host->iomap[NV_MMIO_BAR] + NV_INT_STATUS_CK804) |
@@ -970,7 +963,7 @@ static void nv_adma_irq_clear(struct ata_port *ap) | |||
970 | 963 | ||
971 | /* clear ADMA status */ | 964 | /* clear ADMA status */ |
972 | writew(0xffff, mmio + NV_ADMA_STAT); | 965 | writew(0xffff, mmio + NV_ADMA_STAT); |
973 | 966 | ||
974 | /* clear notifiers - note both ports need to be written with | 967 | /* clear notifiers - note both ports need to be written with |
975 | something even though we are only clearing on one */ | 968 | something even though we are only clearing on one */ |
976 | if (ap->port_no == 0) { | 969 | if (ap->port_no == 0) { |
@@ -1613,15 +1606,6 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1613 | IRQF_SHARED, ppi[0]->sht); | 1606 | IRQF_SHARED, ppi[0]->sht); |
1614 | } | 1607 | } |
1615 | 1608 | ||
1616 | static void nv_remove_one (struct pci_dev *pdev) | ||
1617 | { | ||
1618 | struct ata_host *host = dev_get_drvdata(&pdev->dev); | ||
1619 | struct nv_host_priv *hpriv = host->private_data; | ||
1620 | |||
1621 | ata_pci_remove_one(pdev); | ||
1622 | kfree(hpriv); | ||
1623 | } | ||
1624 | |||
1625 | #ifdef CONFIG_PM | 1609 | #ifdef CONFIG_PM |
1626 | static int nv_pci_device_resume(struct pci_dev *pdev) | 1610 | static int nv_pci_device_resume(struct pci_dev *pdev) |
1627 | { | 1611 | { |
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c index 3a7d9b5332af..2b924a69b365 100644 --- a/drivers/ata/sata_promise.c +++ b/drivers/ata/sata_promise.c | |||
@@ -297,7 +297,7 @@ static const struct ata_port_info pdc_port_info[] = { | |||
297 | 297 | ||
298 | /* board_2057x_pata */ | 298 | /* board_2057x_pata */ |
299 | { | 299 | { |
300 | .flags = PDC_COMMON_FLAGS | ATA_FLAG_SLAVE_POSS, | 300 | .flags = PDC_COMMON_FLAGS | ATA_FLAG_SLAVE_POSS | |
301 | PDC_FLAG_GEN_II, | 301 | PDC_FLAG_GEN_II, |
302 | .pio_mask = 0x1f, /* pio0-4 */ | 302 | .pio_mask = 0x1f, /* pio0-4 */ |
303 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 303 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
diff --git a/drivers/ata/sata_qstor.c b/drivers/ata/sata_qstor.c index f5a05de0093d..6688ccb66320 100644 --- a/drivers/ata/sata_qstor.c +++ b/drivers/ata/sata_qstor.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <linux/libata.h> | 39 | #include <linux/libata.h> |
40 | 40 | ||
41 | #define DRV_NAME "sata_qstor" | 41 | #define DRV_NAME "sata_qstor" |
42 | #define DRV_VERSION "0.07" | 42 | #define DRV_VERSION "0.08" |
43 | 43 | ||
44 | enum { | 44 | enum { |
45 | QS_MMIO_BAR = 4, | 45 | QS_MMIO_BAR = 4, |
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c index e8483aadd11b..a3b339bcf3cf 100644 --- a/drivers/ata/sata_sil.c +++ b/drivers/ata/sata_sil.c | |||
@@ -305,7 +305,7 @@ static int sil_set_mode (struct ata_port *ap, struct ata_device **r_failed) | |||
305 | u32 tmp, dev_mode[2]; | 305 | u32 tmp, dev_mode[2]; |
306 | unsigned int i; | 306 | unsigned int i; |
307 | int rc; | 307 | int rc; |
308 | 308 | ||
309 | rc = ata_do_set_mode(ap, r_failed); | 309 | rc = ata_do_set_mode(ap, r_failed); |
310 | if (rc) | 310 | if (rc) |
311 | return rc; | 311 | return rc; |
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index a69d78cd8e9b..0ddfae9911cd 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <linux/libata.h> | 30 | #include <linux/libata.h> |
31 | 31 | ||
32 | #define DRV_NAME "sata_sil24" | 32 | #define DRV_NAME "sata_sil24" |
33 | #define DRV_VERSION "0.8" | 33 | #define DRV_VERSION "0.9" |
34 | 34 | ||
35 | /* | 35 | /* |
36 | * Port request block (PRB) 32 bytes | 36 | * Port request block (PRB) 32 bytes |
@@ -237,7 +237,8 @@ enum { | |||
237 | /* host flags */ | 237 | /* host flags */ |
238 | SIL24_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | 238 | SIL24_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
239 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | | 239 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | |
240 | ATA_FLAG_NCQ | ATA_FLAG_SKIP_D2H_BSY, | 240 | ATA_FLAG_NCQ | ATA_FLAG_SKIP_D2H_BSY | |
241 | ATA_FLAG_ACPI_SATA, | ||
241 | SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ | 242 | SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ |
242 | 243 | ||
243 | IRQ_STAT_4PORTS = 0xf, | 244 | IRQ_STAT_4PORTS = 0xf, |
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c index ee66c5fa7ac8..221099d1d08f 100644 --- a/drivers/ata/sata_sis.c +++ b/drivers/ata/sata_sis.c | |||
@@ -43,7 +43,7 @@ | |||
43 | #include "sis.h" | 43 | #include "sis.h" |
44 | 44 | ||
45 | #define DRV_NAME "sata_sis" | 45 | #define DRV_NAME "sata_sis" |
46 | #define DRV_VERSION "0.7" | 46 | #define DRV_VERSION "0.8" |
47 | 47 | ||
48 | enum { | 48 | enum { |
49 | sis_180 = 0, | 49 | sis_180 = 0, |
@@ -255,7 +255,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
255 | { | 255 | { |
256 | static int printed_version; | 256 | static int printed_version; |
257 | struct ata_port_info pi = sis_port_info; | 257 | struct ata_port_info pi = sis_port_info; |
258 | const struct ata_port_info *ppi[] = { &pi, NULL }; | 258 | const struct ata_port_info *ppi[] = { &pi, &pi }; |
259 | struct ata_host *host; | 259 | struct ata_host *host; |
260 | u32 genctl, val; | 260 | u32 genctl, val; |
261 | u8 pmr; | 261 | u8 pmr; |
diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c index 17246734fe76..bcb2cd8b063d 100644 --- a/drivers/ata/sata_svw.c +++ b/drivers/ata/sata_svw.c | |||
@@ -53,7 +53,7 @@ | |||
53 | #endif /* CONFIG_PPC_OF */ | 53 | #endif /* CONFIG_PPC_OF */ |
54 | 54 | ||
55 | #define DRV_NAME "sata_svw" | 55 | #define DRV_NAME "sata_svw" |
56 | #define DRV_VERSION "2.1" | 56 | #define DRV_VERSION "2.2" |
57 | 57 | ||
58 | enum { | 58 | enum { |
59 | /* ap->flags bits */ | 59 | /* ap->flags bits */ |
diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c index 3a4f44559d0a..2d14f3d56d92 100644 --- a/drivers/ata/sata_sx4.c +++ b/drivers/ata/sata_sx4.c | |||
@@ -44,7 +44,7 @@ | |||
44 | #include "sata_promise.h" | 44 | #include "sata_promise.h" |
45 | 45 | ||
46 | #define DRV_NAME "sata_sx4" | 46 | #define DRV_NAME "sata_sx4" |
47 | #define DRV_VERSION "0.10" | 47 | #define DRV_VERSION "0.11" |
48 | 48 | ||
49 | 49 | ||
50 | enum { | 50 | enum { |
diff --git a/drivers/ata/sata_uli.c b/drivers/ata/sata_uli.c index 006f5e352658..6815de7cca79 100644 --- a/drivers/ata/sata_uli.c +++ b/drivers/ata/sata_uli.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #include <linux/libata.h> | 36 | #include <linux/libata.h> |
37 | 37 | ||
38 | #define DRV_NAME "sata_uli" | 38 | #define DRV_NAME "sata_uli" |
39 | #define DRV_VERSION "1.1" | 39 | #define DRV_VERSION "1.2" |
40 | 40 | ||
41 | enum { | 41 | enum { |
42 | uli_5289 = 0, | 42 | uli_5289 = 0, |
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c index d105d2c189d2..e8b90e7b42dd 100644 --- a/drivers/ata/sata_via.c +++ b/drivers/ata/sata_via.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #include <linux/libata.h> | 46 | #include <linux/libata.h> |
47 | 47 | ||
48 | #define DRV_NAME "sata_via" | 48 | #define DRV_NAME "sata_via" |
49 | #define DRV_VERSION "2.1" | 49 | #define DRV_VERSION "2.2" |
50 | 50 | ||
51 | enum board_ids_enum { | 51 | enum board_ids_enum { |
52 | vt6420, | 52 | vt6420, |
@@ -85,6 +85,9 @@ static const struct pci_device_id svia_pci_tbl[] = { | |||
85 | { PCI_VDEVICE(VIA, 0x0591), vt6420 }, | 85 | { PCI_VDEVICE(VIA, 0x0591), vt6420 }, |
86 | { PCI_VDEVICE(VIA, 0x3149), vt6420 }, | 86 | { PCI_VDEVICE(VIA, 0x3149), vt6420 }, |
87 | { PCI_VDEVICE(VIA, 0x3249), vt6421 }, | 87 | { PCI_VDEVICE(VIA, 0x3249), vt6421 }, |
88 | { PCI_VDEVICE(VIA, 0x5287), vt6420 }, | ||
89 | { PCI_VDEVICE(VIA, 0x5372), vt6420 }, | ||
90 | { PCI_VDEVICE(VIA, 0x7372), vt6420 }, | ||
88 | 91 | ||
89 | { } /* terminate list */ | 92 | { } /* terminate list */ |
90 | }; | 93 | }; |
@@ -441,7 +444,7 @@ static int vt6421_prepare_host(struct pci_dev *pdev, struct ata_host **r_host) | |||
441 | return -ENOMEM; | 444 | return -ENOMEM; |
442 | } | 445 | } |
443 | 446 | ||
444 | rc = pcim_iomap_regions(pdev, 0x1f, DRV_NAME); | 447 | rc = pcim_iomap_regions(pdev, 0x3f, DRV_NAME); |
445 | if (rc) { | 448 | if (rc) { |
446 | dev_printk(KERN_ERR, &pdev->dev, "failed to request/iomap " | 449 | dev_printk(KERN_ERR, &pdev->dev, "failed to request/iomap " |
447 | "PCI BARs (errno=%d)\n", rc); | 450 | "PCI BARs (errno=%d)\n", rc); |
diff --git a/drivers/ata/sata_vsc.c b/drivers/ata/sata_vsc.c index 80126f835d32..81330175fc89 100644 --- a/drivers/ata/sata_vsc.c +++ b/drivers/ata/sata_vsc.c | |||
@@ -47,7 +47,7 @@ | |||
47 | #include <linux/libata.h> | 47 | #include <linux/libata.h> |
48 | 48 | ||
49 | #define DRV_NAME "sata_vsc" | 49 | #define DRV_NAME "sata_vsc" |
50 | #define DRV_VERSION "2.1" | 50 | #define DRV_VERSION "2.2" |
51 | 51 | ||
52 | enum { | 52 | enum { |
53 | VSC_MMIO_BAR = 0, | 53 | VSC_MMIO_BAR = 0, |