diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-28 16:46:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-28 16:46:00 -0400 |
commit | 2ba302c633754520c990a8c1d161ff304eda6002 (patch) | |
tree | 844b0cf730b7412c4c678037d628cf61597d8478 | |
parent | 4db43e677ec2dcfb6129d5e557ed4795f9e4a031 (diff) | |
parent | 7acfaf3037ff19b749117a286f0f24e201ada0ec (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
ata: NCQ is broken on Maxtor 6L250S0
pata_pdc202xx_old: LBA48 bug
libata: IDENTIFY backwards for drive side cable detection
ahci.c: walkaround for SB600 SATA internal error issue
[libata] Disable ACPI by default; fix namespace problems
-rw-r--r-- | drivers/ata/ahci.c | 21 | ||||
-rw-r--r-- | drivers/ata/libata-acpi.c | 8 | ||||
-rw-r--r-- | drivers/ata/libata-core.c | 6 | ||||
-rw-r--r-- | drivers/ata/libata-eh.c | 66 | ||||
-rw-r--r-- | drivers/ata/libata.h | 2 | ||||
-rw-r--r-- | drivers/ata/pata_pdc202xx_old.c | 2 |
6 files changed, 71 insertions, 34 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index dc7b56225923..fd27227771b4 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -80,6 +80,7 @@ enum { | |||
80 | board_ahci_pi = 1, | 80 | board_ahci_pi = 1, |
81 | board_ahci_vt8251 = 2, | 81 | board_ahci_vt8251 = 2, |
82 | board_ahci_ign_iferr = 3, | 82 | board_ahci_ign_iferr = 3, |
83 | board_ahci_sb600 = 4, | ||
83 | 84 | ||
84 | /* global controller registers */ | 85 | /* global controller registers */ |
85 | HOST_CAP = 0x00, /* host capabilities */ | 86 | HOST_CAP = 0x00, /* host capabilities */ |
@@ -168,6 +169,7 @@ enum { | |||
168 | AHCI_FLAG_NO_NCQ = (1 << 24), | 169 | AHCI_FLAG_NO_NCQ = (1 << 24), |
169 | 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 */ |
170 | 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 */ | ||
171 | }; | 173 | }; |
172 | 174 | ||
173 | struct ahci_cmd_hdr { | 175 | struct ahci_cmd_hdr { |
@@ -362,6 +364,18 @@ static const struct ata_port_info ahci_port_info[] = { | |||
362 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ | 364 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
363 | .port_ops = &ahci_ops, | 365 | .port_ops = &ahci_ops, |
364 | }, | 366 | }, |
367 | /* board_ahci_sb600 */ | ||
368 | { | ||
369 | .sht = &ahci_sht, | ||
370 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | ||
371 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | | ||
372 | ATA_FLAG_SKIP_D2H_BSY | | ||
373 | AHCI_FLAG_IGN_SERR_INTERNAL, | ||
374 | .pio_mask = 0x1f, /* pio0-4 */ | ||
375 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ | ||
376 | .port_ops = &ahci_ops, | ||
377 | }, | ||
378 | |||
365 | }; | 379 | }; |
366 | 380 | ||
367 | static const struct pci_device_id ahci_pci_tbl[] = { | 381 | static const struct pci_device_id ahci_pci_tbl[] = { |
@@ -399,7 +413,7 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
399 | PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci_ign_iferr }, | 413 | PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci_ign_iferr }, |
400 | 414 | ||
401 | /* ATI */ | 415 | /* ATI */ |
402 | { PCI_VDEVICE(ATI, 0x4380), board_ahci }, /* ATI SB600 non-raid */ | 416 | { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 non-raid */ |
403 | { PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */ | 417 | { PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */ |
404 | 418 | ||
405 | /* VIA */ | 419 | /* VIA */ |
@@ -1067,8 +1081,11 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat) | |||
1067 | if (ap->flags & AHCI_FLAG_IGN_IRQ_IF_ERR) | 1081 | if (ap->flags & AHCI_FLAG_IGN_IRQ_IF_ERR) |
1068 | irq_stat &= ~PORT_IRQ_IF_ERR; | 1082 | irq_stat &= ~PORT_IRQ_IF_ERR; |
1069 | 1083 | ||
1070 | if (irq_stat & PORT_IRQ_TF_ERR) | 1084 | if (irq_stat & PORT_IRQ_TF_ERR) { |
1071 | err_mask |= AC_ERR_DEV; | 1085 | err_mask |= AC_ERR_DEV; |
1086 | if (ap->flags & AHCI_FLAG_IGN_SERR_INTERNAL) | ||
1087 | serror &= ~SERR_INTERNAL; | ||
1088 | } | ||
1072 | 1089 | ||
1073 | if (irq_stat & (PORT_IRQ_HBUS_ERR | PORT_IRQ_HBUS_DATA_ERR)) { | 1090 | if (irq_stat & (PORT_IRQ_HBUS_ERR | PORT_IRQ_HBUS_DATA_ERR)) { |
1074 | err_mask |= AC_ERR_HOST_BUS; | 1091 | err_mask |= AC_ERR_HOST_BUS; |
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index c428a56e6f31..03a0acff6cfa 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
@@ -305,7 +305,7 @@ static int do_drive_get_GTF(struct ata_port *ap, int ix, | |||
305 | *gtf_address = 0UL; | 305 | *gtf_address = 0UL; |
306 | *obj_loc = 0UL; | 306 | *obj_loc = 0UL; |
307 | 307 | ||
308 | if (noacpi) | 308 | if (libata_noacpi) |
309 | return 0; | 309 | return 0; |
310 | 310 | ||
311 | if (ata_msg_probe(ap)) | 311 | if (ata_msg_probe(ap)) |
@@ -531,7 +531,7 @@ static int do_drive_set_taskfiles(struct ata_port *ap, | |||
531 | ata_dev_printk(atadev, KERN_DEBUG, "%s: ENTER: port#: %d\n", | 531 | ata_dev_printk(atadev, KERN_DEBUG, "%s: ENTER: port#: %d\n", |
532 | __FUNCTION__, ap->port_no); | 532 | __FUNCTION__, ap->port_no); |
533 | 533 | ||
534 | if (noacpi || !(ap->cbl == ATA_CBL_SATA)) | 534 | if (libata_noacpi || !(ap->cbl == ATA_CBL_SATA)) |
535 | return 0; | 535 | return 0; |
536 | 536 | ||
537 | if (!ata_dev_enabled(atadev) || (ap->flags & ATA_FLAG_DISABLED)) | 537 | if (!ata_dev_enabled(atadev) || (ap->flags & ATA_FLAG_DISABLED)) |
@@ -574,7 +574,7 @@ int ata_acpi_exec_tfs(struct ata_port *ap) | |||
574 | unsigned long gtf_address; | 574 | unsigned long gtf_address; |
575 | unsigned long obj_loc; | 575 | unsigned long obj_loc; |
576 | 576 | ||
577 | if (noacpi) | 577 | if (libata_noacpi) |
578 | return 0; | 578 | return 0; |
579 | /* | 579 | /* |
580 | * TBD - implement PATA support. For now, | 580 | * TBD - implement PATA support. For now, |
@@ -636,7 +636,7 @@ int ata_acpi_push_id(struct ata_port *ap, unsigned int ix) | |||
636 | struct acpi_object_list input; | 636 | struct acpi_object_list input; |
637 | union acpi_object in_params[1]; | 637 | union acpi_object in_params[1]; |
638 | 638 | ||
639 | if (noacpi) | 639 | if (libata_noacpi) |
640 | return 0; | 640 | return 0; |
641 | 641 | ||
642 | if (ata_msg_probe(ap)) | 642 | if (ata_msg_probe(ap)) |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index bf327d473ce9..f1f595f53d95 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -93,8 +93,8 @@ static int ata_probe_timeout = ATA_TMOUT_INTERNAL / HZ; | |||
93 | module_param(ata_probe_timeout, int, 0444); | 93 | module_param(ata_probe_timeout, int, 0444); |
94 | MODULE_PARM_DESC(ata_probe_timeout, "Set ATA probing timeout (seconds)"); | 94 | MODULE_PARM_DESC(ata_probe_timeout, "Set ATA probing timeout (seconds)"); |
95 | 95 | ||
96 | int noacpi; | 96 | int libata_noacpi = 1; |
97 | module_param(noacpi, int, 0444); | 97 | module_param_named(noacpi, libata_noacpi, int, 0444); |
98 | MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in suspend/resume when set"); | 98 | MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in suspend/resume when set"); |
99 | 99 | ||
100 | MODULE_AUTHOR("Jeff Garzik"); | 100 | MODULE_AUTHOR("Jeff Garzik"); |
@@ -3359,6 +3359,8 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { | |||
3359 | { "WDC WD740ADFD-00", NULL, ATA_HORKAGE_NONCQ }, | 3359 | { "WDC WD740ADFD-00", NULL, ATA_HORKAGE_NONCQ }, |
3360 | /* http://thread.gmane.org/gmane.linux.ide/14907 */ | 3360 | /* http://thread.gmane.org/gmane.linux.ide/14907 */ |
3361 | { "FUJITSU MHT2060BH", NULL, ATA_HORKAGE_NONCQ }, | 3361 | { "FUJITSU MHT2060BH", NULL, ATA_HORKAGE_NONCQ }, |
3362 | /* NCQ is broken */ | ||
3363 | { "Maxtor 6L250S0", "BANC1G10", ATA_HORKAGE_NONCQ }, | ||
3362 | 3364 | ||
3363 | /* Devices with NCQ limits */ | 3365 | /* Devices with NCQ limits */ |
3364 | 3366 | ||
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 361953a50203..c89664a77a9c 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1743,12 +1743,17 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap, | |||
1743 | { | 1743 | { |
1744 | struct ata_eh_context *ehc = &ap->eh_context; | 1744 | struct ata_eh_context *ehc = &ap->eh_context; |
1745 | struct ata_device *dev; | 1745 | struct ata_device *dev; |
1746 | unsigned int new_mask = 0; | ||
1746 | unsigned long flags; | 1747 | unsigned long flags; |
1747 | int i, rc = 0; | 1748 | int i, rc = 0; |
1748 | 1749 | ||
1749 | DPRINTK("ENTER\n"); | 1750 | DPRINTK("ENTER\n"); |
1750 | 1751 | ||
1751 | for (i = 0; i < ATA_MAX_DEVICES; i++) { | 1752 | /* For PATA drive side cable detection to work, IDENTIFY must |
1753 | * be done backwards such that PDIAG- is released by the slave | ||
1754 | * device before the master device is identified. | ||
1755 | */ | ||
1756 | for (i = ATA_MAX_DEVICES - 1; i >= 0; i--) { | ||
1752 | unsigned int action, readid_flags = 0; | 1757 | unsigned int action, readid_flags = 0; |
1753 | 1758 | ||
1754 | dev = &ap->device[i]; | 1759 | dev = &ap->device[i]; |
@@ -1760,13 +1765,13 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap, | |||
1760 | if (action & ATA_EH_REVALIDATE && ata_dev_ready(dev)) { | 1765 | if (action & ATA_EH_REVALIDATE && ata_dev_ready(dev)) { |
1761 | if (ata_port_offline(ap)) { | 1766 | if (ata_port_offline(ap)) { |
1762 | rc = -EIO; | 1767 | rc = -EIO; |
1763 | break; | 1768 | goto err; |
1764 | } | 1769 | } |
1765 | 1770 | ||
1766 | ata_eh_about_to_do(ap, dev, ATA_EH_REVALIDATE); | 1771 | ata_eh_about_to_do(ap, dev, ATA_EH_REVALIDATE); |
1767 | rc = ata_dev_revalidate(dev, readid_flags); | 1772 | rc = ata_dev_revalidate(dev, readid_flags); |
1768 | if (rc) | 1773 | if (rc) |
1769 | break; | 1774 | goto err; |
1770 | 1775 | ||
1771 | ata_eh_done(ap, dev, ATA_EH_REVALIDATE); | 1776 | ata_eh_done(ap, dev, ATA_EH_REVALIDATE); |
1772 | 1777 | ||
@@ -1784,40 +1789,53 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap, | |||
1784 | 1789 | ||
1785 | rc = ata_dev_read_id(dev, &dev->class, readid_flags, | 1790 | rc = ata_dev_read_id(dev, &dev->class, readid_flags, |
1786 | dev->id); | 1791 | dev->id); |
1787 | if (rc == 0) { | 1792 | switch (rc) { |
1788 | ehc->i.flags |= ATA_EHI_PRINTINFO; | 1793 | case 0: |
1789 | rc = ata_dev_configure(dev); | 1794 | new_mask |= 1 << i; |
1790 | ehc->i.flags &= ~ATA_EHI_PRINTINFO; | 1795 | break; |
1791 | } else if (rc == -ENOENT) { | 1796 | case -ENOENT: |
1792 | /* IDENTIFY was issued to non-existent | 1797 | /* IDENTIFY was issued to non-existent |
1793 | * device. No need to reset. Just | 1798 | * device. No need to reset. Just |
1794 | * thaw and kill the device. | 1799 | * thaw and kill the device. |
1795 | */ | 1800 | */ |
1796 | ata_eh_thaw_port(ap); | 1801 | ata_eh_thaw_port(ap); |
1797 | dev->class = ATA_DEV_UNKNOWN; | 1802 | dev->class = ATA_DEV_UNKNOWN; |
1798 | rc = 0; | ||
1799 | } | ||
1800 | |||
1801 | if (rc) { | ||
1802 | dev->class = ATA_DEV_UNKNOWN; | ||
1803 | break; | 1803 | break; |
1804 | default: | ||
1805 | dev->class = ATA_DEV_UNKNOWN; | ||
1806 | goto err; | ||
1804 | } | 1807 | } |
1808 | } | ||
1809 | } | ||
1805 | 1810 | ||
1806 | if (ata_dev_enabled(dev)) { | 1811 | /* Configure new devices forward such that user doesn't see |
1807 | spin_lock_irqsave(ap->lock, flags); | 1812 | * device detection messages backwards. |
1808 | ap->pflags |= ATA_PFLAG_SCSI_HOTPLUG; | 1813 | */ |
1809 | spin_unlock_irqrestore(ap->lock, flags); | 1814 | for (i = 0; i < ATA_MAX_DEVICES; i++) { |
1815 | dev = &ap->device[i]; | ||
1810 | 1816 | ||
1811 | /* new device discovered, configure xfermode */ | 1817 | if (!(new_mask & (1 << i))) |
1812 | ehc->i.flags |= ATA_EHI_SETMODE; | 1818 | continue; |
1813 | } | 1819 | |
1814 | } | 1820 | ehc->i.flags |= ATA_EHI_PRINTINFO; |
1821 | rc = ata_dev_configure(dev); | ||
1822 | ehc->i.flags &= ~ATA_EHI_PRINTINFO; | ||
1823 | if (rc) | ||
1824 | goto err; | ||
1825 | |||
1826 | spin_lock_irqsave(ap->lock, flags); | ||
1827 | ap->pflags |= ATA_PFLAG_SCSI_HOTPLUG; | ||
1828 | spin_unlock_irqrestore(ap->lock, flags); | ||
1829 | |||
1830 | /* new device discovered, configure xfermode */ | ||
1831 | ehc->i.flags |= ATA_EHI_SETMODE; | ||
1815 | } | 1832 | } |
1816 | 1833 | ||
1817 | if (rc) | 1834 | return 0; |
1818 | *r_failed_dev = dev; | ||
1819 | 1835 | ||
1820 | DPRINTK("EXIT\n"); | 1836 | err: |
1837 | *r_failed_dev = dev; | ||
1838 | DPRINTK("EXIT rc=%d\n", rc); | ||
1821 | return rc; | 1839 | return rc; |
1822 | } | 1840 | } |
1823 | 1841 | ||
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index c42671493e8c..1f1e3a51f859 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h | |||
@@ -56,7 +56,7 @@ extern struct workqueue_struct *ata_aux_wq; | |||
56 | extern int atapi_enabled; | 56 | extern int atapi_enabled; |
57 | extern int atapi_dmadir; | 57 | extern int atapi_dmadir; |
58 | extern int libata_fua; | 58 | extern int libata_fua; |
59 | extern int noacpi; | 59 | extern int libata_noacpi; |
60 | extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev); | 60 | extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev); |
61 | extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, | 61 | extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, |
62 | u64 block, u32 n_block, unsigned int tf_flags, | 62 | u64 block, u32 n_block, unsigned int tf_flags, |
diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c index acdc52cbe38a..0a1493398913 100644 --- a/drivers/ata/pata_pdc202xx_old.c +++ b/drivers/ata/pata_pdc202xx_old.c | |||
@@ -195,7 +195,7 @@ static void pdc2026x_bmdma_start(struct ata_queued_cmd *qc) | |||
195 | /* Cases the state machine will not complete correctly without help */ | 195 | /* Cases the state machine will not complete correctly without help */ |
196 | if ((tf->flags & ATA_TFLAG_LBA48) || tf->protocol == ATA_PROT_ATAPI_DMA) | 196 | if ((tf->flags & ATA_TFLAG_LBA48) || tf->protocol == ATA_PROT_ATAPI_DMA) |
197 | { | 197 | { |
198 | len = qc->nbytes; | 198 | len = qc->nbytes / 2; |
199 | 199 | ||
200 | if (tf->flags & ATA_TFLAG_WRITE) | 200 | if (tf->flags & ATA_TFLAG_WRITE) |
201 | len |= 0x06000000; | 201 | len |= 0x06000000; |