aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-10 17:53:37 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-10 17:53:37 -0500
commitd3ead3a206effab210813eafff4bfaa581295252 (patch)
tree0e2a7ffcb8321e5f1b6f25e5fd05e2891d4a66e2
parent318851b08fb9d426a545f76e56f2cc049831fb40 (diff)
parent9b8e8de7e59b3a2dab3113d620b52dc8ba890fb3 (diff)
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: libata and starting/stopping ATAPI floppy devices sata_sil24: prevent hba lockup when pass-through ATA commands are used Update kernel parameter document for libata DMA mode setting knobs. libata: don't normalize UNKNOWN to NONE after reset libata-pmp: propagate timeout to host link libata-pmp: 4726 hates SRST pata_ixp4xx_cf: fix compilation introduced by ata_port_desc() conversion pata_pdc202xx_old: Further fixups libata-sff: PCI IRQ handling fix sata_qstor: use hardreset instead of softreset
-rw-r--r--Documentation/kernel-parameters.txt8
-rw-r--r--drivers/ata/libata-eh.c24
-rw-r--r--drivers/ata/libata-pmp.c12
-rw-r--r--drivers/ata/libata-scsi.c3
-rw-r--r--drivers/ata/libata-sff.c7
-rw-r--r--drivers/ata/pata_ixp4xx_cf.c3
-rw-r--r--drivers/ata/pata_pdc202xx_old.c15
-rw-r--r--drivers/ata/sata_qstor.c2
-rw-r--r--drivers/ata/sata_sil24.c37
9 files changed, 78 insertions, 33 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index e5b447a0acda..c4178778e7fd 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -883,6 +883,14 @@ and is between 256 and 4096 characters. It is defined in the file
883 lapic_timer_c2_ok [X86-32,x86-64,APIC] trust the local apic timer in 883 lapic_timer_c2_ok [X86-32,x86-64,APIC] trust the local apic timer in
884 C2 power state. 884 C2 power state.
885 885
886 libata.dma= [LIBATA] DMA control
887 libata.dma=0 Disable all PATA and SATA DMA
888 libata.dma=1 PATA and SATA Disk DMA only
889 libata.dma=2 ATAPI (CDROM) DMA only
890 libata.dma=4 Compact Flash DMA only
891 Combinations also work, so libata.dma=3 enables DMA
892 for disks and CDROMs, but not CFs.
893
886 libata.noacpi [LIBATA] Disables use of ACPI in libata suspend/resume 894 libata.noacpi [LIBATA] Disables use of ACPI in libata suspend/resume
887 when set. 895 when set.
888 Format: <int> 896 Format: <int>
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index f0124a8d3134..21a81cd148e4 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1733,11 +1733,15 @@ static void ata_eh_link_autopsy(struct ata_link *link)
1733 ehc->i.action &= ~ATA_EH_PERDEV_MASK; 1733 ehc->i.action &= ~ATA_EH_PERDEV_MASK;
1734 } 1734 }
1735 1735
1736 /* consider speeding down */ 1736 /* propagate timeout to host link */
1737 if ((all_err_mask & AC_ERR_TIMEOUT) && !ata_is_host_link(link))
1738 ap->link.eh_context.i.err_mask |= AC_ERR_TIMEOUT;
1739
1740 /* record error and consider speeding down */
1737 dev = ehc->i.dev; 1741 dev = ehc->i.dev;
1738 if (!dev && ata_link_max_devices(link) == 1 && 1742 if (!dev && ((ata_link_max_devices(link) == 1 &&
1739 ata_dev_enabled(link->device)) 1743 ata_dev_enabled(link->device))))
1740 dev = link->device; 1744 dev = link->device;
1741 1745
1742 if (dev) 1746 if (dev)
1743 ehc->i.action |= ata_eh_speed_down(dev, is_io, all_err_mask); 1747 ehc->i.action |= ata_eh_speed_down(dev, is_io, all_err_mask);
@@ -1759,8 +1763,14 @@ void ata_eh_autopsy(struct ata_port *ap)
1759{ 1763{
1760 struct ata_link *link; 1764 struct ata_link *link;
1761 1765
1762 __ata_port_for_each_link(link, ap) 1766 ata_port_for_each_link(link, ap)
1763 ata_eh_link_autopsy(link); 1767 ata_eh_link_autopsy(link);
1768
1769 /* Autopsy of fanout ports can affect host link autopsy.
1770 * Perform host link autopsy last.
1771 */
1772 if (ap->nr_pmp_links)
1773 ata_eh_link_autopsy(&ap->link);
1764} 1774}
1765 1775
1766/** 1776/**
@@ -2157,13 +2167,11 @@ int ata_eh_reset(struct ata_link *link, int classify,
2157 if (ata_link_offline(link)) 2167 if (ata_link_offline(link))
2158 continue; 2168 continue;
2159 2169
2160 /* apply class override and convert UNKNOWN to NONE */ 2170 /* apply class override */
2161 if (lflags & ATA_LFLAG_ASSUME_ATA) 2171 if (lflags & ATA_LFLAG_ASSUME_ATA)
2162 classes[dev->devno] = ATA_DEV_ATA; 2172 classes[dev->devno] = ATA_DEV_ATA;
2163 else if (lflags & ATA_LFLAG_ASSUME_SEMB) 2173 else if (lflags & ATA_LFLAG_ASSUME_SEMB)
2164 classes[dev->devno] = ATA_DEV_SEMB_UNSUP; /* not yet */ 2174 classes[dev->devno] = ATA_DEV_SEMB_UNSUP; /* not yet */
2165 else if (classes[dev->devno] == ATA_DEV_UNKNOWN)
2166 classes[dev->devno] = ATA_DEV_NONE;
2167 } 2175 }
2168 2176
2169 /* record current link speed */ 2177 /* record current link speed */
diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c
index c0c4dbcde091..caef2bbd4a8a 100644
--- a/drivers/ata/libata-pmp.c
+++ b/drivers/ata/libata-pmp.c
@@ -495,14 +495,12 @@ static void sata_pmp_quirks(struct ata_port *ap)
495 /* SError.N need a kick in the ass to get working */ 495 /* SError.N need a kick in the ass to get working */
496 link->flags |= ATA_LFLAG_HRST_TO_RESUME; 496 link->flags |= ATA_LFLAG_HRST_TO_RESUME;
497 497
498 /* class code report is unreliable */ 498 /* Class code report is unreliable and SRST
499 if (link->pmp < 5) 499 * times out under certain configurations.
500 link->flags |= ATA_LFLAG_ASSUME_ATA; 500 * Config device can be at port 0 or 5 and
501 501 * locks up on SRST.
502 /* The config device, which can be either at
503 * port 0 or 5, locks up on SRST.
504 */ 502 */
505 if (link->pmp == 0 || link->pmp == 5) 503 if (link->pmp <= 5)
506 link->flags |= ATA_LFLAG_NO_SRST | 504 link->flags |= ATA_LFLAG_NO_SRST |
507 ATA_LFLAG_ASSUME_ATA; 505 ATA_LFLAG_ASSUME_ATA;
508 506
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index a883bb03d4c7..264ae60e3fd8 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -872,7 +872,8 @@ int ata_scsi_slave_config(struct scsi_device *sdev)
872 872
873 ata_scsi_sdev_config(sdev); 873 ata_scsi_sdev_config(sdev);
874 874
875 sdev->manage_start_stop = 1; 875 if (dev->class == ATA_DEV_ATA)
876 sdev->manage_start_stop = 1;
876 877
877 if (dev) 878 if (dev)
878 ata_scsi_dev_config(sdev, dev); 879 ata_scsi_dev_config(sdev, dev);
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 48acc09dab96..b7ac80b4b1fb 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -806,7 +806,10 @@ int ata_pci_init_one(struct pci_dev *pdev,
806 if (rc) 806 if (rc)
807 goto err_out; 807 goto err_out;
808 808
809 if (!legacy_mode) { 809 if (!legacy_mode && pdev->irq) {
810 /* We may have no IRQ assigned in which case we can poll. This
811 shouldn't happen on a sane system but robustness is cheap
812 in this case */
810 rc = devm_request_irq(dev, pdev->irq, pi->port_ops->irq_handler, 813 rc = devm_request_irq(dev, pdev->irq, pi->port_ops->irq_handler,
811 IRQF_SHARED, DRV_NAME, host); 814 IRQF_SHARED, DRV_NAME, host);
812 if (rc) 815 if (rc)
@@ -814,7 +817,7 @@ int ata_pci_init_one(struct pci_dev *pdev,
814 817
815 ata_port_desc(host->ports[0], "irq %d", pdev->irq); 818 ata_port_desc(host->ports[0], "irq %d", pdev->irq);
816 ata_port_desc(host->ports[1], "irq %d", pdev->irq); 819 ata_port_desc(host->ports[1], "irq %d", pdev->irq);
817 } else { 820 } else if (legacy_mode) {
818 if (!ata_port_is_dummy(host->ports[0])) { 821 if (!ata_port_is_dummy(host->ports[0])) {
819 rc = devm_request_irq(dev, ATA_PRIMARY_IRQ(pdev), 822 rc = devm_request_irq(dev, ATA_PRIMARY_IRQ(pdev),
820 pi->port_ops->irq_handler, 823 pi->port_ops->irq_handler,
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index fcd532afbf2e..120b5bfa7ce6 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -130,10 +130,11 @@ static struct ata_port_operations ixp4xx_port_ops = {
130 .port_start = ata_port_start, 130 .port_start = ata_port_start,
131}; 131};
132 132
133static void ixp4xx_setup_port(struct ata_ioports *ioaddr, 133static void ixp4xx_setup_port(struct ata_port *ap,
134 struct ixp4xx_pata_data *data, 134 struct ixp4xx_pata_data *data,
135 unsigned long raw_cs0, unsigned long raw_cs1) 135 unsigned long raw_cs0, unsigned long raw_cs1)
136{ 136{
137 struct ata_ioports *ioaddr = &ap->ioaddr;
137 unsigned long raw_cmd = raw_cs0; 138 unsigned long raw_cmd = raw_cs0;
138 unsigned long raw_ctl = raw_cs1 + 0x06; 139 unsigned long raw_ctl = raw_cs1 + 0x06;
139 140
diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c
index bc7c2d5d8d5e..8f2815601791 100644
--- a/drivers/ata/pata_pdc202xx_old.c
+++ b/drivers/ata/pata_pdc202xx_old.c
@@ -215,8 +215,8 @@ static void pdc2026x_bmdma_stop(struct ata_queued_cmd *qc)
215 /* Flip back to 33Mhz for PIO */ 215 /* Flip back to 33Mhz for PIO */
216 if (adev->dma_mode >= XFER_UDMA_2) 216 if (adev->dma_mode >= XFER_UDMA_2)
217 iowrite8(ioread8(clock) & ~sel66, clock); 217 iowrite8(ioread8(clock) & ~sel66, clock);
218
219 ata_bmdma_stop(qc); 218 ata_bmdma_stop(qc);
219 pdc202xx_set_piomode(ap, adev);
220} 220}
221 221
222/** 222/**
@@ -233,6 +233,17 @@ static void pdc2026x_dev_config(struct ata_device *adev)
233 adev->max_sectors = 256; 233 adev->max_sectors = 256;
234} 234}
235 235
236static int pdc2026x_port_start(struct ata_port *ap)
237{
238 void __iomem *bmdma = ap->ioaddr.bmdma_addr;
239 if (bmdma) {
240 /* Enable burst mode */
241 u8 burst = ioread8(bmdma + 0x1f);
242 iowrite8(burst | 0x01, bmdma + 0x1f);
243 }
244 return ata_sff_port_start(ap);
245}
246
236static struct scsi_host_template pdc202xx_sht = { 247static struct scsi_host_template pdc202xx_sht = {
237 .module = THIS_MODULE, 248 .module = THIS_MODULE,
238 .name = DRV_NAME, 249 .name = DRV_NAME,
@@ -313,7 +324,7 @@ static struct ata_port_operations pdc2026x_port_ops = {
313 .irq_clear = ata_bmdma_irq_clear, 324 .irq_clear = ata_bmdma_irq_clear,
314 .irq_on = ata_irq_on, 325 .irq_on = ata_irq_on,
315 326
316 .port_start = ata_sff_port_start, 327 .port_start = pdc2026x_port_start,
317}; 328};
318 329
319static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id) 330static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
diff --git a/drivers/ata/sata_qstor.c b/drivers/ata/sata_qstor.c
index 2f1de6ec044c..c68b241805fd 100644
--- a/drivers/ata/sata_qstor.c
+++ b/drivers/ata/sata_qstor.c
@@ -270,7 +270,7 @@ static int qs_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val)
270static void qs_error_handler(struct ata_port *ap) 270static void qs_error_handler(struct ata_port *ap)
271{ 271{
272 qs_enter_reg_mode(ap); 272 qs_enter_reg_mode(ap);
273 ata_do_eh(ap, qs_prereset, ata_std_softreset, NULL, 273 ata_do_eh(ap, qs_prereset, NULL, sata_std_hardreset,
274 ata_std_postreset); 274 ata_std_postreset);
275} 275}
276 276
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 96fd5260446d..b4c674d83769 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -832,16 +832,31 @@ static int sil24_qc_defer(struct ata_queued_cmd *qc)
832 struct ata_link *link = qc->dev->link; 832 struct ata_link *link = qc->dev->link;
833 struct ata_port *ap = link->ap; 833 struct ata_port *ap = link->ap;
834 u8 prot = qc->tf.protocol; 834 u8 prot = qc->tf.protocol;
835 int is_atapi = (prot == ATA_PROT_ATAPI || 835
836 prot == ATA_PROT_ATAPI_NODATA || 836 /*
837 prot == ATA_PROT_ATAPI_DMA); 837 * There is a bug in the chip:
838 838 * Port LRAM Causes the PRB/SGT Data to be Corrupted
839 /* ATAPI commands completing with CHECK_SENSE cause various 839 * If the host issues a read request for LRAM and SActive registers
840 * weird problems if other commands are active. PMP DMA CS 840 * while active commands are available in the port, PRB/SGT data in
841 * errata doesn't cover all and HSM violation occurs even with 841 * the LRAM can become corrupted. This issue applies only when
842 * only one other device active. Always run an ATAPI command 842 * reading from, but not writing to, the LRAM.
843 * by itself. 843 *
844 */ 844 * Therefore, reading LRAM when there is no particular error [and
845 * other commands may be outstanding] is prohibited.
846 *
847 * To avoid this bug there are two situations where a command must run
848 * exclusive of any other commands on the port:
849 *
850 * - ATAPI commands which check the sense data
851 * - Passthrough ATA commands which always have ATA_QCFLAG_RESULT_TF
852 * set.
853 *
854 */
855 int is_excl = (prot == ATA_PROT_ATAPI ||
856 prot == ATA_PROT_ATAPI_NODATA ||
857 prot == ATA_PROT_ATAPI_DMA ||
858 (qc->flags & ATA_QCFLAG_RESULT_TF));
859
845 if (unlikely(ap->excl_link)) { 860 if (unlikely(ap->excl_link)) {
846 if (link == ap->excl_link) { 861 if (link == ap->excl_link) {
847 if (ap->nr_active_links) 862 if (ap->nr_active_links)
@@ -849,7 +864,7 @@ static int sil24_qc_defer(struct ata_queued_cmd *qc)
849 qc->flags |= ATA_QCFLAG_CLEAR_EXCL; 864 qc->flags |= ATA_QCFLAG_CLEAR_EXCL;
850 } else 865 } else
851 return ATA_DEFER_PORT; 866 return ATA_DEFER_PORT;
852 } else if (unlikely(is_atapi)) { 867 } else if (unlikely(is_excl)) {
853 ap->excl_link = link; 868 ap->excl_link = link;
854 if (ap->nr_active_links) 869 if (ap->nr_active_links)
855 return ATA_DEFER_PORT; 870 return ATA_DEFER_PORT;