aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-03 00:01:13 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-03 00:01:13 -0400
commitfffe566b8f735fa71b38c7cc487b471b85894401 (patch)
tree98cb948327f7f8d3be41581c9af0e1dadb30f969 /drivers
parentdcf87a2e357e277d3f3e3661962703b80113d2f8 (diff)
parenta3cabb271ea66739704497102536fb01bb72fe37 (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: libata: PATA-mode fixes for sis_sata libata: add HTS541616J9SA00 to NCQ blacklist sata_nv: allow changing queue depth sata_inic162x: disable LBA48 devices libata: remove reading alt_status from ata_hsm_qc_complete() libata: pata_pdc2027x PLL input clock fix scsi disk help file is not complete
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/Kconfig5
-rw-r--r--drivers/ata/libata-core.c3
-rw-r--r--drivers/ata/pata_pdc2027x.c11
-rw-r--r--drivers/ata/pata_sis.c46
-rw-r--r--drivers/ata/sata_inic162x.c7
-rw-r--r--drivers/ata/sata_nv.c2
-rw-r--r--drivers/ata/sata_sis.c39
-rw-r--r--drivers/ata/sis.h2
-rw-r--r--drivers/scsi/Kconfig1
9 files changed, 89 insertions, 27 deletions
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index b4a8d6030e48..4ad8675f5a16 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -16,6 +16,11 @@ menuconfig ATA
16 that "speaks" the ATA protocol, also called ATA controller), 16 that "speaks" the ATA protocol, also called ATA controller),
17 because you will be asked for it. 17 because you will be asked for it.
18 18
19 NOTE: ATA enables basic SCSI support; *however*,
20 'SCSI disk support', 'SCSI tape support', or
21 'SCSI CDROM support' may also be needed,
22 depending on your hardware configuration.
23
19if ATA 24if ATA
20 25
21config ATA_NONSTANDARD 26config ATA_NONSTANDARD
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index bfc59a104728..2407f8482948 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3798,6 +3798,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
3798 /* Drives which do spurious command completion */ 3798 /* Drives which do spurious command completion */
3799 { "HTS541680J9SA00", "SB2IC7EP", ATA_HORKAGE_NONCQ, }, 3799 { "HTS541680J9SA00", "SB2IC7EP", ATA_HORKAGE_NONCQ, },
3800 { "HTS541612J9SA00", "SBDIC7JP", ATA_HORKAGE_NONCQ, }, 3800 { "HTS541612J9SA00", "SBDIC7JP", ATA_HORKAGE_NONCQ, },
3801 { "Hitachi HTS541616J9SA00", "SB4OC70P", ATA_HORKAGE_NONCQ, },
3801 { "WDC WD740ADFD-00NLR1", NULL, ATA_HORKAGE_NONCQ, }, 3802 { "WDC WD740ADFD-00NLR1", NULL, ATA_HORKAGE_NONCQ, },
3802 3803
3803 /* Devices with NCQ limits */ 3804 /* Devices with NCQ limits */
@@ -4781,8 +4782,6 @@ static void ata_hsm_qc_complete(struct ata_queued_cmd *qc, int in_wq)
4781 } else 4782 } else
4782 ata_qc_complete(qc); 4783 ata_qc_complete(qc);
4783 } 4784 }
4784
4785 ata_altstatus(ap); /* flush */
4786} 4785}
4787 4786
4788/** 4787/**
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index 0d2cc49fde4b..69a5aa4949f5 100644
--- a/drivers/ata/pata_pdc2027x.c
+++ b/drivers/ata/pata_pdc2027x.c
@@ -689,10 +689,12 @@ static long pdc_detect_pll_input_clock(struct ata_host *host)
689 void __iomem *mmio_base = host->iomap[PDC_MMIO_BAR]; 689 void __iomem *mmio_base = host->iomap[PDC_MMIO_BAR];
690 u32 scr; 690 u32 scr;
691 long start_count, end_count; 691 long start_count, end_count;
692 long pll_clock; 692 struct timeval start_time, end_time;
693 long pll_clock, usec_elapsed;
693 694
694 /* Read current counter value */ 695 /* Read current counter value */
695 start_count = pdc_read_counter(host); 696 start_count = pdc_read_counter(host);
697 do_gettimeofday(&start_time);
696 698
697 /* Start the test mode */ 699 /* Start the test mode */
698 scr = readl(mmio_base + PDC_SYS_CTL); 700 scr = readl(mmio_base + PDC_SYS_CTL);
@@ -705,6 +707,7 @@ static long pdc_detect_pll_input_clock(struct ata_host *host)
705 707
706 /* Read the counter values again */ 708 /* Read the counter values again */
707 end_count = pdc_read_counter(host); 709 end_count = pdc_read_counter(host);
710 do_gettimeofday(&end_time);
708 711
709 /* Stop the test mode */ 712 /* Stop the test mode */
710 scr = readl(mmio_base + PDC_SYS_CTL); 713 scr = readl(mmio_base + PDC_SYS_CTL);
@@ -713,7 +716,11 @@ static long pdc_detect_pll_input_clock(struct ata_host *host)
713 readl(mmio_base + PDC_SYS_CTL); /* flush */ 716 readl(mmio_base + PDC_SYS_CTL); /* flush */
714 717
715 /* calculate the input clock in Hz */ 718 /* calculate the input clock in Hz */
716 pll_clock = (start_count - end_count) * 10; 719 usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 1000000 +
720 (end_time.tv_usec - start_time.tv_usec);
721
722 pll_clock = (start_count - end_count) / 100 *
723 (100000000 / usec_elapsed);
717 724
718 PDPRINTK("start[%ld] end[%ld] \n", start_count, end_count); 725 PDPRINTK("start[%ld] end[%ld] \n", start_count, end_count);
719 PDPRINTK("PLL input clock[%ld]Hz\n", pll_clock); 726 PDPRINTK("PLL input clock[%ld]Hz\n", pll_clock);
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
index ec3ae9375015..cfe4ec6eb3d5 100644
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -560,6 +560,40 @@ static const struct ata_port_operations sis_133_ops = {
560 .port_start = ata_port_start, 560 .port_start = ata_port_start,
561}; 561};
562 562
563static const struct ata_port_operations sis_133_for_sata_ops = {
564 .port_disable = ata_port_disable,
565 .set_piomode = sis_133_set_piomode,
566 .set_dmamode = sis_133_set_dmamode,
567 .mode_filter = ata_pci_default_filter,
568
569 .tf_load = ata_tf_load,
570 .tf_read = ata_tf_read,
571 .check_status = ata_check_status,
572 .exec_command = ata_exec_command,
573 .dev_select = ata_std_dev_select,
574
575 .freeze = ata_bmdma_freeze,
576 .thaw = ata_bmdma_thaw,
577 .error_handler = ata_bmdma_error_handler,
578 .post_internal_cmd = ata_bmdma_post_internal_cmd,
579 .cable_detect = sis_133_cable_detect,
580
581 .bmdma_setup = ata_bmdma_setup,
582 .bmdma_start = ata_bmdma_start,
583 .bmdma_stop = ata_bmdma_stop,
584 .bmdma_status = ata_bmdma_status,
585 .qc_prep = ata_qc_prep,
586 .qc_issue = ata_qc_issue_prot,
587 .data_xfer = ata_data_xfer,
588
589 .irq_handler = ata_interrupt,
590 .irq_clear = ata_bmdma_irq_clear,
591 .irq_on = ata_irq_on,
592 .irq_ack = ata_irq_ack,
593
594 .port_start = ata_port_start,
595};
596
563static const struct ata_port_operations sis_133_early_ops = { 597static const struct ata_port_operations sis_133_early_ops = {
564 .port_disable = ata_port_disable, 598 .port_disable = ata_port_disable,
565 .set_piomode = sis_100_set_piomode, 599 .set_piomode = sis_100_set_piomode,
@@ -733,13 +767,20 @@ static const struct ata_port_info sis_info100_early = {
733 .pio_mask = 0x1f, /* pio0-4 */ 767 .pio_mask = 0x1f, /* pio0-4 */
734 .port_ops = &sis_66_ops, 768 .port_ops = &sis_66_ops,
735}; 769};
736const struct ata_port_info sis_info133 = { 770static const struct ata_port_info sis_info133 = {
737 .sht = &sis_sht, 771 .sht = &sis_sht,
738 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, 772 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
739 .pio_mask = 0x1f, /* pio0-4 */ 773 .pio_mask = 0x1f, /* pio0-4 */
740 .udma_mask = ATA_UDMA6, 774 .udma_mask = ATA_UDMA6,
741 .port_ops = &sis_133_ops, 775 .port_ops = &sis_133_ops,
742}; 776};
777const struct ata_port_info sis_info133_for_sata = {
778 .sht = &sis_sht,
779 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
780 .pio_mask = 0x1f, /* pio0-4 */
781 .udma_mask = ATA_UDMA6,
782 .port_ops = &sis_133_for_sata_ops,
783};
743static const struct ata_port_info sis_info133_early = { 784static const struct ata_port_info sis_info133_early = {
744 .sht = &sis_sht, 785 .sht = &sis_sht,
745 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, 786 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
@@ -749,7 +790,7 @@ static const struct ata_port_info sis_info133_early = {
749}; 790};
750 791
751/* Privately shared with the SiS180 SATA driver, not for use elsewhere */ 792/* Privately shared with the SiS180 SATA driver, not for use elsewhere */
752EXPORT_SYMBOL_GPL(sis_info133); 793EXPORT_SYMBOL_GPL(sis_info133_for_sata);
753 794
754static void sis_fixup(struct pci_dev *pdev, struct sis_chipset *sis) 795static void sis_fixup(struct pci_dev *pdev, struct sis_chipset *sis)
755{ 796{
@@ -975,6 +1016,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
975static const struct pci_device_id sis_pci_tbl[] = { 1016static const struct pci_device_id sis_pci_tbl[] = {
976 { PCI_VDEVICE(SI, 0x5513), }, /* SiS 5513 */ 1017 { PCI_VDEVICE(SI, 0x5513), }, /* SiS 5513 */
977 { PCI_VDEVICE(SI, 0x5518), }, /* SiS 5518 */ 1018 { PCI_VDEVICE(SI, 0x5518), }, /* SiS 5518 */
1019 { PCI_VDEVICE(SI, 0x1180), }, /* SiS 1180 */
978 1020
979 { } 1021 { }
980}; 1022};
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
index 2d80c9d95e95..dc3bbce04676 100644
--- a/drivers/ata/sata_inic162x.c
+++ b/drivers/ata/sata_inic162x.c
@@ -496,6 +496,13 @@ static void inic_dev_config(struct ata_device *dev)
496 /* inic can only handle upto LBA28 max sectors */ 496 /* inic can only handle upto LBA28 max sectors */
497 if (dev->max_sectors > ATA_MAX_SECTORS) 497 if (dev->max_sectors > ATA_MAX_SECTORS)
498 dev->max_sectors = ATA_MAX_SECTORS; 498 dev->max_sectors = ATA_MAX_SECTORS;
499
500 if (dev->n_sectors >= 1 << 28) {
501 ata_dev_printk(dev, KERN_ERR,
502 "ERROR: This driver doesn't support LBA48 yet and may cause\n"
503 " data corruption on such devices. Disabling.\n");
504 ata_dev_disable(dev);
505 }
499} 506}
500 507
501static void init_port(struct ata_port *ap) 508static void init_port(struct ata_port *ap)
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index adfa693db53d..d53cb8c47f39 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -307,6 +307,7 @@ static struct scsi_host_template nv_sht = {
307 .name = DRV_NAME, 307 .name = DRV_NAME,
308 .ioctl = ata_scsi_ioctl, 308 .ioctl = ata_scsi_ioctl,
309 .queuecommand = ata_scsi_queuecmd, 309 .queuecommand = ata_scsi_queuecmd,
310 .change_queue_depth = ata_scsi_change_queue_depth,
310 .can_queue = ATA_DEF_QUEUE, 311 .can_queue = ATA_DEF_QUEUE,
311 .this_id = ATA_SHT_THIS_ID, 312 .this_id = ATA_SHT_THIS_ID,
312 .sg_tablesize = LIBATA_MAX_PRD, 313 .sg_tablesize = LIBATA_MAX_PRD,
@@ -325,6 +326,7 @@ static struct scsi_host_template nv_adma_sht = {
325 .name = DRV_NAME, 326 .name = DRV_NAME,
326 .ioctl = ata_scsi_ioctl, 327 .ioctl = ata_scsi_ioctl,
327 .queuecommand = ata_scsi_queuecmd, 328 .queuecommand = ata_scsi_queuecmd,
329 .change_queue_depth = ata_scsi_change_queue_depth,
328 .can_queue = NV_ADMA_MAX_CPBS, 330 .can_queue = NV_ADMA_MAX_CPBS,
329 .this_id = ATA_SHT_THIS_ID, 331 .this_id = ATA_SHT_THIS_ID,
330 .sg_tablesize = NV_ADMA_SGTBL_TOTAL_LEN, 332 .sg_tablesize = NV_ADMA_SGTBL_TOTAL_LEN,
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c
index 221099d1d08f..f111c984a359 100644
--- a/drivers/ata/sata_sis.c
+++ b/drivers/ata/sata_sis.c
@@ -72,8 +72,8 @@ static const struct pci_device_id sis_pci_tbl[] = {
72 { PCI_VDEVICE(SI, 0x0181), sis_180 }, /* SiS 964/180 */ 72 { PCI_VDEVICE(SI, 0x0181), sis_180 }, /* SiS 964/180 */
73 { PCI_VDEVICE(SI, 0x0182), sis_180 }, /* SiS 965/965L */ 73 { PCI_VDEVICE(SI, 0x0182), sis_180 }, /* SiS 965/965L */
74 { PCI_VDEVICE(SI, 0x0183), sis_180 }, /* SiS 965/965L */ 74 { PCI_VDEVICE(SI, 0x0183), sis_180 }, /* SiS 965/965L */
75 { PCI_VDEVICE(SI, 0x1182), sis_180 }, /* SiS 966/966L */ 75 { PCI_VDEVICE(SI, 0x1182), sis_180 }, /* SiS 966/680 */
76 { PCI_VDEVICE(SI, 0x1183), sis_180 }, /* SiS 966/966L */ 76 { PCI_VDEVICE(SI, 0x1183), sis_180 }, /* SiS 966/966L/968/680 */
77 77
78 { } /* terminate list */ 78 { } /* terminate list */
79}; 79};
@@ -161,7 +161,6 @@ static unsigned int get_scr_cfg_addr(struct ata_port *ap, unsigned int sc_reg)
161 case 0x0182: 161 case 0x0182:
162 case 0x0183: 162 case 0x0183:
163 case 0x1182: 163 case 0x1182:
164 case 0x1183:
165 addr += SIS182_SATA1_OFS; 164 addr += SIS182_SATA1_OFS;
166 break; 165 break;
167 } 166 }
@@ -183,8 +182,8 @@ static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg)
183 182
184 pci_read_config_dword(pdev, cfg_addr, &val); 183 pci_read_config_dword(pdev, cfg_addr, &val);
185 184
186 if ((pdev->device == 0x0182) || (pdev->device == 0x0183) || (pdev->device == 0x1182) || 185 if ((pdev->device == 0x0182) || (pdev->device == 0x0183) ||
187 (pdev->device == 0x1183) || (pmr & SIS_PMR_COMBINED)) 186 (pdev->device == 0x1182) || (pmr & SIS_PMR_COMBINED))
188 pci_read_config_dword(pdev, cfg_addr+0x10, &val2); 187 pci_read_config_dword(pdev, cfg_addr+0x10, &val2);
189 188
190 return (val|val2) & 0xfffffffb; /* avoid problems with powerdowned ports */ 189 return (val|val2) & 0xfffffffb; /* avoid problems with powerdowned ports */
@@ -203,8 +202,8 @@ static void sis_scr_cfg_write (struct ata_port *ap, unsigned int sc_reg, u32 val
203 202
204 pci_write_config_dword(pdev, cfg_addr, val); 203 pci_write_config_dword(pdev, cfg_addr, val);
205 204
206 if ((pdev->device == 0x0182) || (pdev->device == 0x0183) || (pdev->device == 0x1182) || 205 if ((pdev->device == 0x0182) || (pdev->device == 0x0183) ||
207 (pdev->device == 0x1183) || (pmr & SIS_PMR_COMBINED)) 206 (pdev->device == 0x1182) || (pmr & SIS_PMR_COMBINED))
208 pci_write_config_dword(pdev, cfg_addr+0x10, val); 207 pci_write_config_dword(pdev, cfg_addr+0x10, val);
209} 208}
210 209
@@ -224,8 +223,8 @@ static u32 sis_scr_read (struct ata_port *ap, unsigned int sc_reg)
224 223
225 val = ioread32(ap->ioaddr.scr_addr + (sc_reg * 4)); 224 val = ioread32(ap->ioaddr.scr_addr + (sc_reg * 4));
226 225
227 if ((pdev->device == 0x0182) || (pdev->device == 0x0183) || (pdev->device == 0x1182) || 226 if ((pdev->device == 0x0182) || (pdev->device == 0x0183) ||
228 (pdev->device == 0x1183) || (pmr & SIS_PMR_COMBINED)) 227 (pdev->device == 0x1182) || (pmr & SIS_PMR_COMBINED))
229 val2 = ioread32(ap->ioaddr.scr_addr + (sc_reg * 4) + 0x10); 228 val2 = ioread32(ap->ioaddr.scr_addr + (sc_reg * 4) + 0x10);
230 229
231 return (val | val2) & 0xfffffffb; 230 return (val | val2) & 0xfffffffb;
@@ -245,8 +244,8 @@ static void sis_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
245 sis_scr_cfg_write(ap, sc_reg, val); 244 sis_scr_cfg_write(ap, sc_reg, val);
246 else { 245 else {
247 iowrite32(val, ap->ioaddr.scr_addr + (sc_reg * 4)); 246 iowrite32(val, ap->ioaddr.scr_addr + (sc_reg * 4));
248 if ((pdev->device == 0x0182) || (pdev->device == 0x0183) || (pdev->device == 0x1182) || 247 if ((pdev->device == 0x0182) || (pdev->device == 0x0183) ||
249 (pdev->device == 0x1183) || (pmr & SIS_PMR_COMBINED)) 248 (pdev->device == 0x1182) || (pmr & SIS_PMR_COMBINED))
250 iowrite32(val, ap->ioaddr.scr_addr + (sc_reg * 4)+0x10); 249 iowrite32(val, ap->ioaddr.scr_addr + (sc_reg * 4)+0x10);
251 } 250 }
252} 251}
@@ -293,11 +292,11 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
293 /* The PATA-handling is provided by pata_sis */ 292 /* The PATA-handling is provided by pata_sis */
294 switch (pmr & 0x30) { 293 switch (pmr & 0x30) {
295 case 0x10: 294 case 0x10:
296 ppi[1] = &sis_info133; 295 ppi[1] = &sis_info133_for_sata;
297 break; 296 break;
298 297
299 case 0x30: 298 case 0x30:
300 ppi[0] = &sis_info133; 299 ppi[0] = &sis_info133_for_sata;
301 break; 300 break;
302 } 301 }
303 if ((pmr & SIS_PMR_COMBINED) == 0) { 302 if ((pmr & SIS_PMR_COMBINED) == 0) {
@@ -324,14 +323,14 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
324 break; 323 break;
325 324
326 case 0x1182: 325 case 0x1182:
326 dev_printk(KERN_INFO, &pdev->dev, "Detected SiS 1182/966/680 SATA controller\n");
327 pi.flags |= ATA_FLAG_SLAVE_POSS;
328 break;
329
327 case 0x1183: 330 case 0x1183:
328 pci_read_config_dword(pdev, 0x64, &val); 331 dev_printk(KERN_INFO, &pdev->dev, "Detected SiS 1183/966/966L/968/680 controller in PATA mode\n");
329 if (val & 0x10000000) { 332 ppi[0] = &sis_info133_for_sata;
330 dev_printk(KERN_INFO, &pdev->dev, "Detected SiS 1182/1183/966L SATA controller\n"); 333 ppi[1] = &sis_info133_for_sata;
331 } else {
332 dev_printk(KERN_INFO, &pdev->dev, "Detected SiS 1182/1183/966 SATA controller\n");
333 pi.flags |= ATA_FLAG_SLAVE_POSS;
334 }
335 break; 334 break;
336 } 335 }
337 336
diff --git a/drivers/ata/sis.h b/drivers/ata/sis.h
index 0f2208d8d5ef..f7f3eebe666c 100644
--- a/drivers/ata/sis.h
+++ b/drivers/ata/sis.h
@@ -2,4 +2,4 @@
2struct ata_port_info; 2struct ata_port_info;
3 3
4/* pata_sis.c */ 4/* pata_sis.c */
5extern const struct ata_port_info sis_info133; 5extern const struct ata_port_info sis_info133_for_sata;
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 2b2f5c12019b..eb46cb0e3cb7 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -60,6 +60,7 @@ config BLK_DEV_SD
60 depends on SCSI 60 depends on SCSI
61 ---help--- 61 ---help---
62 If you want to use SCSI hard disks, Fibre Channel disks, 62 If you want to use SCSI hard disks, Fibre Channel disks,
63 Serial ATA (SATA) or Parallel ATA (PATA) hard disks,
63 USB storage or the SCSI or parallel port version of 64 USB storage or the SCSI or parallel port version of
64 the IOMEGA ZIP drive, say Y and read the SCSI-HOWTO, 65 the IOMEGA ZIP drive, say Y and read the SCSI-HOWTO,
65 the Disk-HOWTO and the Multi-Disk-HOWTO, available from 66 the Disk-HOWTO and the Multi-Disk-HOWTO, available from