diff options
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/ahci.c | 1 | ||||
-rw-r--r-- | drivers/ata/libata-core.c | 11 | ||||
-rw-r--r-- | drivers/ata/pata_legacy.c | 11 | ||||
-rw-r--r-- | drivers/ata/pata_mpc52xx.c | 6 | ||||
-rw-r--r-- | drivers/ata/pata_mpiix.c | 2 | ||||
-rw-r--r-- | drivers/ata/pata_pcmcia.c | 2 | ||||
-rw-r--r-- | drivers/ata/pata_pdc2027x.c | 2 | ||||
-rw-r--r-- | drivers/ata/pata_qdi.c | 4 | ||||
-rw-r--r-- | drivers/ata/pata_sl82c105.c | 3 | ||||
-rw-r--r-- | drivers/ata/pdc_adma.c | 1 | ||||
-rw-r--r-- | drivers/ata/sata_inic162x.c | 2 | ||||
-rw-r--r-- | drivers/ata/sata_mv.c | 1 | ||||
-rw-r--r-- | drivers/ata/sata_nv.c | 6 | ||||
-rw-r--r-- | drivers/ata/sata_promise.c | 65 | ||||
-rw-r--r-- | drivers/ata/sata_qstor.c | 1 | ||||
-rw-r--r-- | drivers/ata/sata_sx4.c | 1 | ||||
-rw-r--r-- | drivers/ata/sata_vsc.c | 8 |
17 files changed, 54 insertions, 73 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 92cdb0c5171f..6a3543e06241 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <linux/blkdev.h> | 39 | #include <linux/blkdev.h> |
40 | #include <linux/delay.h> | 40 | #include <linux/delay.h> |
41 | #include <linux/interrupt.h> | 41 | #include <linux/interrupt.h> |
42 | #include <linux/sched.h> | ||
43 | #include <linux/dma-mapping.h> | 42 | #include <linux/dma-mapping.h> |
44 | #include <linux/device.h> | 43 | #include <linux/device.h> |
45 | #include <scsi/scsi_host.h> | 44 | #include <scsi/scsi_host.h> |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 25d8d3f778a1..2cf8251728d2 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -1410,7 +1410,16 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, | |||
1410 | } | 1410 | } |
1411 | 1411 | ||
1412 | tf.protocol = ATA_PROT_PIO; | 1412 | tf.protocol = ATA_PROT_PIO; |
1413 | tf.flags |= ATA_TFLAG_POLLING; /* for polling presence detection */ | 1413 | |
1414 | /* Some devices choke if TF registers contain garbage. Make | ||
1415 | * sure those are properly initialized. | ||
1416 | */ | ||
1417 | tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; | ||
1418 | |||
1419 | /* Device presence detection is unreliable on some | ||
1420 | * controllers. Always poll IDENTIFY if available. | ||
1421 | */ | ||
1422 | tf.flags |= ATA_TFLAG_POLLING; | ||
1414 | 1423 | ||
1415 | err_mask = ata_exec_internal(dev, &tf, NULL, DMA_FROM_DEVICE, | 1424 | err_mask = ata_exec_internal(dev, &tf, NULL, DMA_FROM_DEVICE, |
1416 | id, sizeof(id[0]) * ATA_ID_WORDS); | 1425 | id, sizeof(id[0]) * ATA_ID_WORDS); |
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c index 4223e10de6a0..98c1fee4b305 100644 --- a/drivers/ata/pata_legacy.c +++ b/drivers/ata/pata_legacy.c | |||
@@ -89,9 +89,10 @@ static int probe_all; /* Set to check all ISA port ranges */ | |||
89 | static int ht6560a; /* HT 6560A on primary 1, secondary 2, both 3 */ | 89 | static int ht6560a; /* HT 6560A on primary 1, secondary 2, both 3 */ |
90 | static int ht6560b; /* HT 6560A on primary 1, secondary 2, both 3 */ | 90 | static int ht6560b; /* HT 6560A on primary 1, secondary 2, both 3 */ |
91 | static int opti82c611a; /* Opti82c611A on primary 1, secondary 2, both 3 */ | 91 | static int opti82c611a; /* Opti82c611A on primary 1, secondary 2, both 3 */ |
92 | static int opti82c46x; /* Opti 82c465MV present (pri/sec autodetect) */ | 92 | static int opti82c46x; /* Opti 82c465MV present (pri/sec autodetect) */ |
93 | static int autospeed; /* Chip present which snoops speed changes */ | 93 | static int autospeed; /* Chip present which snoops speed changes */ |
94 | static int pio_mask = 0x1F; /* PIO range for autospeed devices */ | 94 | static int pio_mask = 0x1F; /* PIO range for autospeed devices */ |
95 | static int iordy_mask = 0xFFFFFFFF; /* Use iordy if available */ | ||
95 | 96 | ||
96 | /** | 97 | /** |
97 | * legacy_set_mode - mode setting | 98 | * legacy_set_mode - mode setting |
@@ -113,6 +114,7 @@ static int legacy_set_mode(struct ata_port *ap, struct ata_device **unused) | |||
113 | for (i = 0; i < ATA_MAX_DEVICES; i++) { | 114 | for (i = 0; i < ATA_MAX_DEVICES; i++) { |
114 | struct ata_device *dev = &ap->device[i]; | 115 | struct ata_device *dev = &ap->device[i]; |
115 | if (ata_dev_enabled(dev)) { | 116 | if (ata_dev_enabled(dev)) { |
117 | ata_dev_printk(dev, KERN_INFO, "configured for PIO\n"); | ||
116 | dev->pio_mode = XFER_PIO_0; | 118 | dev->pio_mode = XFER_PIO_0; |
117 | dev->xfer_mode = XFER_PIO_0; | 119 | dev->xfer_mode = XFER_PIO_0; |
118 | dev->xfer_shift = ATA_SHIFT_PIO; | 120 | dev->xfer_shift = ATA_SHIFT_PIO; |
@@ -695,6 +697,7 @@ static __init int legacy_init_one(int port, unsigned long io, unsigned long ctrl | |||
695 | void __iomem *io_addr, *ctrl_addr; | 697 | void __iomem *io_addr, *ctrl_addr; |
696 | int pio_modes = pio_mask; | 698 | int pio_modes = pio_mask; |
697 | u32 mask = (1 << port); | 699 | u32 mask = (1 << port); |
700 | u32 iordy = (iordy_mask & mask) ? 0: ATA_FLAG_NO_IORDY; | ||
698 | int ret; | 701 | int ret; |
699 | 702 | ||
700 | pdev = platform_device_register_simple(DRV_NAME, nr_legacy_host, NULL, 0); | 703 | pdev = platform_device_register_simple(DRV_NAME, nr_legacy_host, NULL, 0); |
@@ -715,6 +718,7 @@ static __init int legacy_init_one(int port, unsigned long io, unsigned long ctrl | |||
715 | if (ht6560a & mask) { | 718 | if (ht6560a & mask) { |
716 | ops = &ht6560a_port_ops; | 719 | ops = &ht6560a_port_ops; |
717 | pio_modes = 0x07; | 720 | pio_modes = 0x07; |
721 | iordy = ATA_FLAG_NO_IORDY; | ||
718 | } | 722 | } |
719 | if (ht6560b & mask) { | 723 | if (ht6560b & mask) { |
720 | ops = &ht6560b_port_ops; | 724 | ops = &ht6560b_port_ops; |
@@ -750,6 +754,7 @@ static __init int legacy_init_one(int port, unsigned long io, unsigned long ctrl | |||
750 | printk(KERN_INFO "PDC20230-C/20630 VLB ATA controller detected.\n"); | 754 | printk(KERN_INFO "PDC20230-C/20630 VLB ATA controller detected.\n"); |
751 | pio_modes = 0x07; | 755 | pio_modes = 0x07; |
752 | ops = &pdc20230_port_ops; | 756 | ops = &pdc20230_port_ops; |
757 | iordy = ATA_FLAG_NO_IORDY; | ||
753 | udelay(100); | 758 | udelay(100); |
754 | inb(0x1F5); | 759 | inb(0x1F5); |
755 | } else { | 760 | } else { |
@@ -767,6 +772,7 @@ static __init int legacy_init_one(int port, unsigned long io, unsigned long ctrl | |||
767 | /* Chip does mode setting by command snooping */ | 772 | /* Chip does mode setting by command snooping */ |
768 | if (ops == &legacy_port_ops && (autospeed & mask)) | 773 | if (ops == &legacy_port_ops && (autospeed & mask)) |
769 | ops = &simple_port_ops; | 774 | ops = &simple_port_ops; |
775 | |||
770 | memset(&ae, 0, sizeof(struct ata_probe_ent)); | 776 | memset(&ae, 0, sizeof(struct ata_probe_ent)); |
771 | INIT_LIST_HEAD(&ae.node); | 777 | INIT_LIST_HEAD(&ae.node); |
772 | ae.dev = &pdev->dev; | 778 | ae.dev = &pdev->dev; |
@@ -776,7 +782,7 @@ static __init int legacy_init_one(int port, unsigned long io, unsigned long ctrl | |||
776 | ae.pio_mask = pio_modes; | 782 | ae.pio_mask = pio_modes; |
777 | ae.irq = irq; | 783 | ae.irq = irq; |
778 | ae.irq_flags = 0; | 784 | ae.irq_flags = 0; |
779 | ae.port_flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST; | 785 | ae.port_flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST|iordy; |
780 | ae.port[0].cmd_addr = io_addr; | 786 | ae.port[0].cmd_addr = io_addr; |
781 | ae.port[0].altstatus_addr = ctrl_addr; | 787 | ae.port[0].altstatus_addr = ctrl_addr; |
782 | ae.port[0].ctl_addr = ctrl_addr; | 788 | ae.port[0].ctl_addr = ctrl_addr; |
@@ -945,6 +951,7 @@ module_param(ht6560b, int, 0); | |||
945 | module_param(opti82c611a, int, 0); | 951 | module_param(opti82c611a, int, 0); |
946 | module_param(opti82c46x, int, 0); | 952 | module_param(opti82c46x, int, 0); |
947 | module_param(pio_mask, int, 0); | 953 | module_param(pio_mask, int, 0); |
954 | module_param(iordy_mask, int, 0); | ||
948 | 955 | ||
949 | module_init(legacy_init); | 956 | module_init(legacy_init); |
950 | module_exit(legacy_exit); | 957 | module_exit(legacy_exit); |
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c index d7378df44970..29e1809e5ecf 100644 --- a/drivers/ata/pata_mpc52xx.c +++ b/drivers/ata/pata_mpc52xx.c | |||
@@ -484,10 +484,8 @@ mpc52xx_ata_resume(struct of_device *op) | |||
484 | 484 | ||
485 | static struct of_device_id mpc52xx_ata_of_match[] = { | 485 | static struct of_device_id mpc52xx_ata_of_match[] = { |
486 | { | 486 | { |
487 | .compatible = "mpc5200-ata", | 487 | .type = "ata", |
488 | }, | 488 | .compatible = "mpc5200-ata", |
489 | { | ||
490 | .compatible = "mpc52xx-ata", | ||
491 | }, | 489 | }, |
492 | {}, | 490 | {}, |
493 | }; | 491 | }; |
diff --git a/drivers/ata/pata_mpiix.c b/drivers/ata/pata_mpiix.c index ca8c965179b1..f2e7115f7ab9 100644 --- a/drivers/ata/pata_mpiix.c +++ b/drivers/ata/pata_mpiix.c | |||
@@ -241,7 +241,7 @@ static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
241 | probe.port_ops = &mpiix_port_ops; | 241 | probe.port_ops = &mpiix_port_ops; |
242 | probe.sht = &mpiix_sht; | 242 | probe.sht = &mpiix_sht; |
243 | probe.pio_mask = 0x1F; | 243 | probe.pio_mask = 0x1F; |
244 | probe.irq_flags = SA_SHIRQ; | 244 | probe.irq_flags = IRQF_SHARED; |
245 | probe.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST; | 245 | probe.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST; |
246 | probe.n_ports = 1; | 246 | probe.n_ports = 1; |
247 | 247 | ||
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c index acfc09f9abd9..36468ec6454c 100644 --- a/drivers/ata/pata_pcmcia.c +++ b/drivers/ata/pata_pcmcia.c | |||
@@ -264,7 +264,7 @@ next_entry: | |||
264 | ae.n_ports = 1; | 264 | ae.n_ports = 1; |
265 | ae.pio_mask = 1; /* ISA so PIO 0 cycles */ | 265 | ae.pio_mask = 1; /* ISA so PIO 0 cycles */ |
266 | ae.irq = pdev->irq.AssignedIRQ; | 266 | ae.irq = pdev->irq.AssignedIRQ; |
267 | ae.irq_flags = SA_SHIRQ; | 267 | ae.irq_flags = IRQF_SHARED; |
268 | ae.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST; | 268 | ae.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST; |
269 | ae.port[0].cmd_addr = io_addr; | 269 | ae.port[0].cmd_addr = io_addr; |
270 | ae.port[0].altstatus_addr = ctl_addr; | 270 | ae.port[0].altstatus_addr = ctl_addr; |
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c index ffa7f47fbb20..61537873d28e 100644 --- a/drivers/ata/pata_pdc2027x.c +++ b/drivers/ata/pata_pdc2027x.c | |||
@@ -796,7 +796,7 @@ static int __devinit pdc2027x_init_one(struct pci_dev *pdev, const struct pci_de | |||
796 | probe_ent->port_ops = pdc2027x_port_info[board_idx].port_ops; | 796 | probe_ent->port_ops = pdc2027x_port_info[board_idx].port_ops; |
797 | 797 | ||
798 | probe_ent->irq = pdev->irq; | 798 | probe_ent->irq = pdev->irq; |
799 | probe_ent->irq_flags = SA_SHIRQ; | 799 | probe_ent->irq_flags = IRQF_SHARED; |
800 | probe_ent->iomap = pcim_iomap_table(pdev); | 800 | probe_ent->iomap = pcim_iomap_table(pdev); |
801 | 801 | ||
802 | mmio_base = probe_ent->iomap[PDC_MMIO_BAR]; | 802 | mmio_base = probe_ent->iomap[PDC_MMIO_BAR]; |
diff --git a/drivers/ata/pata_qdi.c b/drivers/ata/pata_qdi.c index 1b3b4ed8eb19..4362141976ad 100644 --- a/drivers/ata/pata_qdi.c +++ b/drivers/ata/pata_qdi.c | |||
@@ -264,16 +264,18 @@ static __init int qdi_init_one(unsigned long port, int type, unsigned long io, i | |||
264 | if (type == 6580) { | 264 | if (type == 6580) { |
265 | ae.port_ops = &qdi6580_port_ops; | 265 | ae.port_ops = &qdi6580_port_ops; |
266 | ae.pio_mask = 0x1F; | 266 | ae.pio_mask = 0x1F; |
267 | ae.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST; | ||
267 | } else { | 268 | } else { |
268 | ae.port_ops = &qdi6500_port_ops; | 269 | ae.port_ops = &qdi6500_port_ops; |
269 | ae.pio_mask = 0x07; /* Actually PIO3 !IORDY is possible */ | 270 | ae.pio_mask = 0x07; /* Actually PIO3 !IORDY is possible */ |
271 | ae.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST | | ||
272 | ATA_FLAG_NO_IORDY; | ||
270 | } | 273 | } |
271 | 274 | ||
272 | ae.sht = &qdi_sht; | 275 | ae.sht = &qdi_sht; |
273 | ae.n_ports = 1; | 276 | ae.n_ports = 1; |
274 | ae.irq = irq; | 277 | ae.irq = irq; |
275 | ae.irq_flags = 0; | 278 | ae.irq_flags = 0; |
276 | ae.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST; | ||
277 | ae.port[0].cmd_addr = io_addr; | 279 | ae.port[0].cmd_addr = io_addr; |
278 | ae.port[0].altstatus_addr = ctl_addr; | 280 | ae.port[0].altstatus_addr = ctl_addr; |
279 | ae.port[0].ctl_addr = ctl_addr; | 281 | ae.port[0].ctl_addr = ctl_addr; |
diff --git a/drivers/ata/pata_sl82c105.c b/drivers/ata/pata_sl82c105.c index f2fa158d07ca..96e890fd645b 100644 --- a/drivers/ata/pata_sl82c105.c +++ b/drivers/ata/pata_sl82c105.c | |||
@@ -187,7 +187,9 @@ static void sl82c105_bmdma_start(struct ata_queued_cmd *qc) | |||
187 | { | 187 | { |
188 | struct ata_port *ap = qc->ap; | 188 | struct ata_port *ap = qc->ap; |
189 | 189 | ||
190 | udelay(100); | ||
190 | sl82c105_reset_engine(ap); | 191 | sl82c105_reset_engine(ap); |
192 | udelay(100); | ||
191 | 193 | ||
192 | /* Set the clocks for DMA */ | 194 | /* Set the clocks for DMA */ |
193 | sl82c105_configure_dmamode(ap, qc->dev); | 195 | sl82c105_configure_dmamode(ap, qc->dev); |
@@ -216,6 +218,7 @@ static void sl82c105_bmdma_stop(struct ata_queued_cmd *qc) | |||
216 | 218 | ||
217 | ata_bmdma_stop(qc); | 219 | ata_bmdma_stop(qc); |
218 | sl82c105_reset_engine(ap); | 220 | sl82c105_reset_engine(ap); |
221 | udelay(100); | ||
219 | 222 | ||
220 | /* This will redo the initial setup of the DMA device to matching | 223 | /* This will redo the initial setup of the DMA device to matching |
221 | PIO timings */ | 224 | PIO timings */ |
diff --git a/drivers/ata/pdc_adma.c b/drivers/ata/pdc_adma.c index b4ed8ce553e6..857ac23217ab 100644 --- a/drivers/ata/pdc_adma.c +++ b/drivers/ata/pdc_adma.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <linux/blkdev.h> | 39 | #include <linux/blkdev.h> |
40 | #include <linux/delay.h> | 40 | #include <linux/delay.h> |
41 | #include <linux/interrupt.h> | 41 | #include <linux/interrupt.h> |
42 | #include <linux/sched.h> | ||
43 | #include <linux/device.h> | 42 | #include <linux/device.h> |
44 | #include <scsi/scsi_host.h> | 43 | #include <scsi/scsi_host.h> |
45 | #include <linux/libata.h> | 44 | #include <linux/libata.h> |
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c index c5335f422801..31b636fac98e 100644 --- a/drivers/ata/sata_inic162x.c +++ b/drivers/ata/sata_inic162x.c | |||
@@ -710,7 +710,7 @@ static int inic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
710 | probe_ent->n_ports = NR_PORTS; | 710 | probe_ent->n_ports = NR_PORTS; |
711 | 711 | ||
712 | probe_ent->irq = pdev->irq; | 712 | probe_ent->irq = pdev->irq; |
713 | probe_ent->irq_flags = SA_SHIRQ; | 713 | probe_ent->irq_flags = IRQF_SHARED; |
714 | 714 | ||
715 | probe_ent->iomap = iomap; | 715 | probe_ent->iomap = iomap; |
716 | 716 | ||
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 769eca52442c..d689df52eae3 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/blkdev.h> | 28 | #include <linux/blkdev.h> |
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
31 | #include <linux/sched.h> | ||
32 | #include <linux/dma-mapping.h> | 31 | #include <linux/dma-mapping.h> |
33 | #include <linux/device.h> | 32 | #include <linux/device.h> |
34 | #include <scsi/scsi_host.h> | 33 | #include <scsi/scsi_host.h> |
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 095ef1b2cd0e..ab92f208dae2 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
@@ -827,7 +827,8 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance) | |||
827 | /* freeze if hotplugged or controller error */ | 827 | /* freeze if hotplugged or controller error */ |
828 | if (unlikely(status & (NV_ADMA_STAT_HOTPLUG | | 828 | if (unlikely(status & (NV_ADMA_STAT_HOTPLUG | |
829 | NV_ADMA_STAT_HOTUNPLUG | | 829 | NV_ADMA_STAT_HOTUNPLUG | |
830 | NV_ADMA_STAT_TIMEOUT))) { | 830 | NV_ADMA_STAT_TIMEOUT | |
831 | NV_ADMA_STAT_SERROR))) { | ||
831 | struct ata_eh_info *ehi = &ap->eh_info; | 832 | struct ata_eh_info *ehi = &ap->eh_info; |
832 | 833 | ||
833 | ata_ehi_clear_desc(ehi); | 834 | ata_ehi_clear_desc(ehi); |
@@ -841,6 +842,9 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance) | |||
841 | } else if (status & NV_ADMA_STAT_HOTUNPLUG) { | 842 | } else if (status & NV_ADMA_STAT_HOTUNPLUG) { |
842 | ata_ehi_hotplugged(ehi); | 843 | ata_ehi_hotplugged(ehi); |
843 | ata_ehi_push_desc(ehi, ": hot unplug"); | 844 | ata_ehi_push_desc(ehi, ": hot unplug"); |
845 | } else if (status & NV_ADMA_STAT_SERROR) { | ||
846 | /* let libata analyze SError and figure out the cause */ | ||
847 | ata_ehi_push_desc(ehi, ": SError"); | ||
844 | } | 848 | } |
845 | ata_port_freeze(ap); | 849 | ata_port_freeze(ap); |
846 | continue; | 850 | continue; |
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c index 3be4cc338d7b..cf9ed8c39301 100644 --- a/drivers/ata/sata_promise.c +++ b/drivers/ata/sata_promise.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <linux/blkdev.h> | 37 | #include <linux/blkdev.h> |
38 | #include <linux/delay.h> | 38 | #include <linux/delay.h> |
39 | #include <linux/interrupt.h> | 39 | #include <linux/interrupt.h> |
40 | #include <linux/sched.h> | ||
41 | #include <linux/device.h> | 40 | #include <linux/device.h> |
42 | #include <scsi/scsi.h> | 41 | #include <scsi/scsi.h> |
43 | #include <scsi/scsi_host.h> | 42 | #include <scsi/scsi_host.h> |
@@ -120,9 +119,7 @@ static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg); | |||
120 | static void pdc_sata_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); | 119 | static void pdc_sata_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); |
121 | static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); | 120 | static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); |
122 | static irqreturn_t pdc_interrupt (int irq, void *dev_instance); | 121 | static irqreturn_t pdc_interrupt (int irq, void *dev_instance); |
123 | static void pdc_eng_timeout(struct ata_port *ap); | ||
124 | static int pdc_port_start(struct ata_port *ap); | 122 | static int pdc_port_start(struct ata_port *ap); |
125 | static void pdc_pata_phy_reset(struct ata_port *ap); | ||
126 | static void pdc_qc_prep(struct ata_queued_cmd *qc); | 123 | static void pdc_qc_prep(struct ata_queued_cmd *qc); |
127 | static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf); | 124 | static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf); |
128 | static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf); | 125 | static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf); |
@@ -216,12 +213,12 @@ static const struct ata_port_operations pdc_pata_ops = { | |||
216 | .dev_select = ata_std_dev_select, | 213 | .dev_select = ata_std_dev_select, |
217 | .check_atapi_dma = pdc_check_atapi_dma, | 214 | .check_atapi_dma = pdc_check_atapi_dma, |
218 | 215 | ||
219 | .phy_reset = pdc_pata_phy_reset, | ||
220 | |||
221 | .qc_prep = pdc_qc_prep, | 216 | .qc_prep = pdc_qc_prep, |
222 | .qc_issue = pdc_qc_issue_prot, | 217 | .qc_issue = pdc_qc_issue_prot, |
218 | .freeze = pdc_freeze, | ||
219 | .thaw = pdc_thaw, | ||
220 | .error_handler = pdc_error_handler, | ||
223 | .data_xfer = ata_data_xfer, | 221 | .data_xfer = ata_data_xfer, |
224 | .eng_timeout = pdc_eng_timeout, | ||
225 | .irq_handler = pdc_interrupt, | 222 | .irq_handler = pdc_interrupt, |
226 | .irq_clear = pdc_irq_clear, | 223 | .irq_clear = pdc_irq_clear, |
227 | .irq_on = ata_irq_on, | 224 | .irq_on = ata_irq_on, |
@@ -254,7 +251,7 @@ static const struct ata_port_info pdc_port_info[] = { | |||
254 | /* board_20619 */ | 251 | /* board_20619 */ |
255 | { | 252 | { |
256 | .sht = &pdc_ata_sht, | 253 | .sht = &pdc_ata_sht, |
257 | .flags = PDC_COMMON_FLAGS | ATA_FLAG_SRST | ATA_FLAG_SLAVE_POSS, | 254 | .flags = PDC_COMMON_FLAGS | ATA_FLAG_SLAVE_POSS, |
258 | .pio_mask = 0x1f, /* pio0-4 */ | 255 | .pio_mask = 0x1f, /* pio0-4 */ |
259 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 256 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
260 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ | 257 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
@@ -390,14 +387,6 @@ static void pdc_pata_cbl_detect(struct ata_port *ap) | |||
390 | ap->cbl = ATA_CBL_PATA80; | 387 | ap->cbl = ATA_CBL_PATA80; |
391 | } | 388 | } |
392 | 389 | ||
393 | static void pdc_pata_phy_reset(struct ata_port *ap) | ||
394 | { | ||
395 | pdc_pata_cbl_detect(ap); | ||
396 | pdc_reset_port(ap); | ||
397 | ata_port_probe(ap); | ||
398 | ata_bus_reset(ap); | ||
399 | } | ||
400 | |||
401 | static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) | 390 | static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) |
402 | { | 391 | { |
403 | if (sc_reg > SCR_CONTROL || ap->cbl != ATA_CBL_SATA) | 392 | if (sc_reg > SCR_CONTROL || ap->cbl != ATA_CBL_SATA) |
@@ -565,6 +554,13 @@ static void pdc_thaw(struct ata_port *ap) | |||
565 | readl(mmio + PDC_CTLSTAT); /* flush */ | 554 | readl(mmio + PDC_CTLSTAT); /* flush */ |
566 | } | 555 | } |
567 | 556 | ||
557 | static int pdc_pre_reset(struct ata_port *ap) | ||
558 | { | ||
559 | if (!sata_scr_valid(ap)) | ||
560 | pdc_pata_cbl_detect(ap); | ||
561 | return ata_std_prereset(ap); | ||
562 | } | ||
563 | |||
568 | static void pdc_error_handler(struct ata_port *ap) | 564 | static void pdc_error_handler(struct ata_port *ap) |
569 | { | 565 | { |
570 | ata_reset_fn_t hardreset; | 566 | ata_reset_fn_t hardreset; |
@@ -577,7 +573,7 @@ static void pdc_error_handler(struct ata_port *ap) | |||
577 | hardreset = sata_std_hardreset; | 573 | hardreset = sata_std_hardreset; |
578 | 574 | ||
579 | /* perform recovery */ | 575 | /* perform recovery */ |
580 | ata_do_eh(ap, ata_std_prereset, ata_std_softreset, hardreset, | 576 | ata_do_eh(ap, pdc_pre_reset, ata_std_softreset, hardreset, |
581 | ata_std_postreset); | 577 | ata_std_postreset); |
582 | } | 578 | } |
583 | 579 | ||
@@ -593,43 +589,6 @@ static void pdc_post_internal_cmd(struct ata_queued_cmd *qc) | |||
593 | pdc_reset_port(ap); | 589 | pdc_reset_port(ap); |
594 | } | 590 | } |
595 | 591 | ||
596 | static void pdc_eng_timeout(struct ata_port *ap) | ||
597 | { | ||
598 | struct ata_host *host = ap->host; | ||
599 | u8 drv_stat; | ||
600 | struct ata_queued_cmd *qc; | ||
601 | unsigned long flags; | ||
602 | |||
603 | DPRINTK("ENTER\n"); | ||
604 | |||
605 | spin_lock_irqsave(&host->lock, flags); | ||
606 | |||
607 | qc = ata_qc_from_tag(ap, ap->active_tag); | ||
608 | |||
609 | switch (qc->tf.protocol) { | ||
610 | case ATA_PROT_DMA: | ||
611 | case ATA_PROT_NODATA: | ||
612 | ata_port_printk(ap, KERN_ERR, "command timeout\n"); | ||
613 | drv_stat = ata_wait_idle(ap); | ||
614 | qc->err_mask |= __ac_err_mask(drv_stat); | ||
615 | break; | ||
616 | |||
617 | default: | ||
618 | drv_stat = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); | ||
619 | |||
620 | ata_port_printk(ap, KERN_ERR, | ||
621 | "unknown timeout, cmd 0x%x stat 0x%x\n", | ||
622 | qc->tf.command, drv_stat); | ||
623 | |||
624 | qc->err_mask |= ac_err_mask(drv_stat); | ||
625 | break; | ||
626 | } | ||
627 | |||
628 | spin_unlock_irqrestore(&host->lock, flags); | ||
629 | ata_eh_qc_complete(qc); | ||
630 | DPRINTK("EXIT\n"); | ||
631 | } | ||
632 | |||
633 | static inline unsigned int pdc_host_intr( struct ata_port *ap, | 592 | static inline unsigned int pdc_host_intr( struct ata_port *ap, |
634 | struct ata_queued_cmd *qc) | 593 | struct ata_queued_cmd *qc) |
635 | { | 594 | { |
diff --git a/drivers/ata/sata_qstor.c b/drivers/ata/sata_qstor.c index bfa35ede6551..6097d8f2a0c0 100644 --- a/drivers/ata/sata_qstor.c +++ b/drivers/ata/sata_qstor.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <linux/blkdev.h> | 34 | #include <linux/blkdev.h> |
35 | #include <linux/delay.h> | 35 | #include <linux/delay.h> |
36 | #include <linux/interrupt.h> | 36 | #include <linux/interrupt.h> |
37 | #include <linux/sched.h> | ||
38 | #include <linux/device.h> | 37 | #include <linux/device.h> |
39 | #include <scsi/scsi_host.h> | 38 | #include <scsi/scsi_host.h> |
40 | #include <linux/libata.h> | 39 | #include <linux/libata.h> |
diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c index 06e87a377382..0ebd77b080d6 100644 --- a/drivers/ata/sata_sx4.c +++ b/drivers/ata/sata_sx4.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <linux/blkdev.h> | 37 | #include <linux/blkdev.h> |
38 | #include <linux/delay.h> | 38 | #include <linux/delay.h> |
39 | #include <linux/interrupt.h> | 39 | #include <linux/interrupt.h> |
40 | #include <linux/sched.h> | ||
41 | #include <linux/device.h> | 40 | #include <linux/device.h> |
42 | #include <scsi/scsi_host.h> | 41 | #include <scsi/scsi_host.h> |
43 | #include <scsi/scsi_cmnd.h> | 42 | #include <scsi/scsi_cmnd.h> |
diff --git a/drivers/ata/sata_vsc.c b/drivers/ata/sata_vsc.c index 3d9daf231115..2fd037bde090 100644 --- a/drivers/ata/sata_vsc.c +++ b/drivers/ata/sata_vsc.c | |||
@@ -346,6 +346,7 @@ static int __devinit vsc_sata_init_one (struct pci_dev *pdev, const struct pci_d | |||
346 | struct ata_probe_ent *probe_ent; | 346 | struct ata_probe_ent *probe_ent; |
347 | void __iomem *mmio_base; | 347 | void __iomem *mmio_base; |
348 | int rc; | 348 | int rc; |
349 | u8 cls; | ||
349 | 350 | ||
350 | if (!printed_version++) | 351 | if (!printed_version++) |
351 | dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); | 352 | dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); |
@@ -383,9 +384,12 @@ static int __devinit vsc_sata_init_one (struct pci_dev *pdev, const struct pci_d | |||
383 | INIT_LIST_HEAD(&probe_ent->node); | 384 | INIT_LIST_HEAD(&probe_ent->node); |
384 | 385 | ||
385 | /* | 386 | /* |
386 | * Due to a bug in the chip, the default cache line size can't be used | 387 | * Due to a bug in the chip, the default cache line size can't be |
388 | * used (unless the default is non-zero). | ||
387 | */ | 389 | */ |
388 | pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, 0x80); | 390 | pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &cls); |
391 | if (cls == 0x00) | ||
392 | pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, 0x80); | ||
389 | 393 | ||
390 | if (pci_enable_msi(pdev) == 0) | 394 | if (pci_enable_msi(pdev) == 0) |
391 | pci_intx(pdev, 0); | 395 | pci_intx(pdev, 0); |