diff options
| -rw-r--r-- | drivers/scsi/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/scsi/ahci.c | 30 | ||||
| -rw-r--r-- | drivers/scsi/ata_piix.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/libata-core.c | 38 | ||||
| -rw-r--r-- | drivers/scsi/libata.h | 2 | ||||
| -rw-r--r-- | drivers/scsi/sata_mv.c | 991 | ||||
| -rw-r--r-- | drivers/scsi/sata_promise.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/sata_qstor.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/sata_sil24.c | 21 | ||||
| -rw-r--r-- | drivers/scsi/sata_svw.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/sata_sx4.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/sata_vsc.c | 2 |
12 files changed, 898 insertions, 198 deletions
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 84c42c44e04d..20dd85a77813 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig | |||
| @@ -497,7 +497,7 @@ config SCSI_ATA_PIIX | |||
| 497 | If unsure, say N. | 497 | If unsure, say N. |
| 498 | 498 | ||
| 499 | config SCSI_SATA_MV | 499 | config SCSI_SATA_MV |
| 500 | tristate "Marvell SATA support" | 500 | tristate "Marvell SATA support (HIGHLY EXPERIMENTAL)" |
| 501 | depends on SCSI_SATA && PCI && EXPERIMENTAL | 501 | depends on SCSI_SATA && PCI && EXPERIMENTAL |
| 502 | help | 502 | help |
| 503 | This option enables support for the Marvell Serial ATA family. | 503 | This option enables support for the Marvell Serial ATA family. |
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c index 894e7113e0b3..83467a05dc8e 100644 --- a/drivers/scsi/ahci.c +++ b/drivers/scsi/ahci.c | |||
| @@ -48,7 +48,7 @@ | |||
| 48 | #include <asm/io.h> | 48 | #include <asm/io.h> |
| 49 | 49 | ||
| 50 | #define DRV_NAME "ahci" | 50 | #define DRV_NAME "ahci" |
| 51 | #define DRV_VERSION "1.01" | 51 | #define DRV_VERSION "1.2" |
| 52 | 52 | ||
| 53 | 53 | ||
| 54 | enum { | 54 | enum { |
| @@ -558,23 +558,25 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc) | |||
| 558 | pp->cmd_slot[0].opts |= cpu_to_le32(n_elem << 16); | 558 | pp->cmd_slot[0].opts |= cpu_to_le32(n_elem << 16); |
| 559 | } | 559 | } |
| 560 | 560 | ||
| 561 | static void ahci_intr_error(struct ata_port *ap, u32 irq_stat) | 561 | static void ahci_restart_port(struct ata_port *ap, u32 irq_stat) |
| 562 | { | 562 | { |
| 563 | void __iomem *mmio = ap->host_set->mmio_base; | 563 | void __iomem *mmio = ap->host_set->mmio_base; |
| 564 | void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no); | 564 | void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no); |
| 565 | u32 tmp; | 565 | u32 tmp; |
| 566 | int work; | 566 | int work; |
| 567 | 567 | ||
| 568 | printk(KERN_WARNING "ata%u: port reset, " | 568 | if ((ap->device[0].class != ATA_DEV_ATAPI) || |
| 569 | "p_is %x is %x pis %x cmd %x tf %x ss %x se %x\n", | 569 | ((irq_stat & PORT_IRQ_TF_ERR) == 0)) |
| 570 | ap->id, | 570 | printk(KERN_WARNING "ata%u: port reset, " |
| 571 | irq_stat, | 571 | "p_is %x is %x pis %x cmd %x tf %x ss %x se %x\n", |
| 572 | readl(mmio + HOST_IRQ_STAT), | 572 | ap->id, |
| 573 | readl(port_mmio + PORT_IRQ_STAT), | 573 | irq_stat, |
| 574 | readl(port_mmio + PORT_CMD), | 574 | readl(mmio + HOST_IRQ_STAT), |
| 575 | readl(port_mmio + PORT_TFDATA), | 575 | readl(port_mmio + PORT_IRQ_STAT), |
| 576 | readl(port_mmio + PORT_SCR_STAT), | 576 | readl(port_mmio + PORT_CMD), |
| 577 | readl(port_mmio + PORT_SCR_ERR)); | 577 | readl(port_mmio + PORT_TFDATA), |
| 578 | readl(port_mmio + PORT_SCR_STAT), | ||
| 579 | readl(port_mmio + PORT_SCR_ERR)); | ||
| 578 | 580 | ||
| 579 | /* stop DMA */ | 581 | /* stop DMA */ |
| 580 | tmp = readl(port_mmio + PORT_CMD); | 582 | tmp = readl(port_mmio + PORT_CMD); |
| @@ -632,7 +634,7 @@ static void ahci_eng_timeout(struct ata_port *ap) | |||
| 632 | printk(KERN_ERR "ata%u: BUG: timeout without command\n", | 634 | printk(KERN_ERR "ata%u: BUG: timeout without command\n", |
| 633 | ap->id); | 635 | ap->id); |
| 634 | } else { | 636 | } else { |
| 635 | ahci_intr_error(ap, readl(port_mmio + PORT_IRQ_STAT)); | 637 | ahci_restart_port(ap, readl(port_mmio + PORT_IRQ_STAT)); |
| 636 | 638 | ||
| 637 | /* hack alert! We cannot use the supplied completion | 639 | /* hack alert! We cannot use the supplied completion |
| 638 | * function from inside the ->eh_strategy_handler() thread. | 640 | * function from inside the ->eh_strategy_handler() thread. |
| @@ -677,7 +679,7 @@ static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc) | |||
| 677 | err_mask = AC_ERR_HOST_BUS; | 679 | err_mask = AC_ERR_HOST_BUS; |
| 678 | 680 | ||
| 679 | /* command processing has stopped due to error; restart */ | 681 | /* command processing has stopped due to error; restart */ |
| 680 | ahci_intr_error(ap, status); | 682 | ahci_restart_port(ap, status); |
| 681 | 683 | ||
| 682 | if (qc) | 684 | if (qc) |
| 683 | ata_qc_complete(qc, err_mask); | 685 | ata_qc_complete(qc, err_mask); |
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c index 855428ff37e9..333d69dd84ef 100644 --- a/drivers/scsi/ata_piix.c +++ b/drivers/scsi/ata_piix.c | |||
| @@ -50,7 +50,7 @@ | |||
| 50 | #include <linux/libata.h> | 50 | #include <linux/libata.h> |
| 51 | 51 | ||
| 52 | #define DRV_NAME "ata_piix" | 52 | #define DRV_NAME "ata_piix" |
| 53 | #define DRV_VERSION "1.04" | 53 | #define DRV_VERSION "1.05" |
| 54 | 54 | ||
| 55 | enum { | 55 | enum { |
| 56 | PIIX_IOCFG = 0x54, /* IDE I/O configuration register */ | 56 | PIIX_IOCFG = 0x54, /* IDE I/O configuration register */ |
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index ba1eb8b38e00..665ae79e1fd6 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
| @@ -1046,6 +1046,30 @@ static unsigned int ata_pio_modes(const struct ata_device *adev) | |||
| 1046 | return modes; | 1046 | return modes; |
| 1047 | } | 1047 | } |
| 1048 | 1048 | ||
| 1049 | static int ata_qc_wait_err(struct ata_queued_cmd *qc, | ||
| 1050 | struct completion *wait) | ||
| 1051 | { | ||
| 1052 | int rc = 0; | ||
| 1053 | |||
| 1054 | if (wait_for_completion_timeout(wait, 30 * HZ) < 1) { | ||
| 1055 | /* timeout handling */ | ||
| 1056 | unsigned int err_mask = ac_err_mask(ata_chk_status(qc->ap)); | ||
| 1057 | |||
| 1058 | if (!err_mask) { | ||
| 1059 | printk(KERN_WARNING "ata%u: slow completion (cmd %x)\n", | ||
| 1060 | qc->ap->id, qc->tf.command); | ||
| 1061 | } else { | ||
| 1062 | printk(KERN_WARNING "ata%u: qc timeout (cmd %x)\n", | ||
| 1063 | qc->ap->id, qc->tf.command); | ||
| 1064 | rc = -EIO; | ||
| 1065 | } | ||
| 1066 | |||
| 1067 | ata_qc_complete(qc, err_mask); | ||
| 1068 | } | ||
| 1069 | |||
| 1070 | return rc; | ||
| 1071 | } | ||
| 1072 | |||
| 1049 | /** | 1073 | /** |
| 1050 | * ata_dev_identify - obtain IDENTIFY x DEVICE page | 1074 | * ata_dev_identify - obtain IDENTIFY x DEVICE page |
| 1051 | * @ap: port on which device we wish to probe resides | 1075 | * @ap: port on which device we wish to probe resides |
| @@ -1125,7 +1149,7 @@ retry: | |||
| 1125 | if (rc) | 1149 | if (rc) |
| 1126 | goto err_out; | 1150 | goto err_out; |
| 1127 | else | 1151 | else |
| 1128 | wait_for_completion(&wait); | 1152 | ata_qc_wait_err(qc, &wait); |
| 1129 | 1153 | ||
| 1130 | spin_lock_irqsave(&ap->host_set->lock, flags); | 1154 | spin_lock_irqsave(&ap->host_set->lock, flags); |
| 1131 | ap->ops->tf_read(ap, &qc->tf); | 1155 | ap->ops->tf_read(ap, &qc->tf); |
| @@ -1570,11 +1594,13 @@ int ata_timing_compute(struct ata_device *adev, unsigned short speed, | |||
| 1570 | 1594 | ||
| 1571 | /* | 1595 | /* |
| 1572 | * Find the mode. | 1596 | * Find the mode. |
| 1573 | */ | 1597 | */ |
| 1574 | 1598 | ||
| 1575 | if (!(s = ata_timing_find_mode(speed))) | 1599 | if (!(s = ata_timing_find_mode(speed))) |
| 1576 | return -EINVAL; | 1600 | return -EINVAL; |
| 1577 | 1601 | ||
| 1602 | memcpy(t, s, sizeof(*s)); | ||
| 1603 | |||
| 1578 | /* | 1604 | /* |
| 1579 | * If the drive is an EIDE drive, it can tell us it needs extended | 1605 | * If the drive is an EIDE drive, it can tell us it needs extended |
| 1580 | * PIO/MW_DMA cycle timing. | 1606 | * PIO/MW_DMA cycle timing. |
| @@ -1595,7 +1621,7 @@ int ata_timing_compute(struct ata_device *adev, unsigned short speed, | |||
| 1595 | * Convert the timing to bus clock counts. | 1621 | * Convert the timing to bus clock counts. |
| 1596 | */ | 1622 | */ |
| 1597 | 1623 | ||
| 1598 | ata_timing_quantize(s, t, T, UT); | 1624 | ata_timing_quantize(t, t, T, UT); |
| 1599 | 1625 | ||
| 1600 | /* | 1626 | /* |
| 1601 | * Even in DMA/UDMA modes we still use PIO access for IDENTIFY, S.M.A.R.T | 1627 | * Even in DMA/UDMA modes we still use PIO access for IDENTIFY, S.M.A.R.T |
| @@ -2267,7 +2293,7 @@ static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev) | |||
| 2267 | if (rc) | 2293 | if (rc) |
| 2268 | ata_port_disable(ap); | 2294 | ata_port_disable(ap); |
| 2269 | else | 2295 | else |
| 2270 | wait_for_completion(&wait); | 2296 | |
