aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-24 00:40:33 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-24 00:40:33 -0400
commit1a8f46100b657f533ce677e79bc27c6794c91c46 (patch)
tree65788cbbd19034d01f2708f389131a291b07d58a /drivers/ata
parentb1b8aca480a26efb21168e311e8025a22b042591 (diff)
parentb54eebd673861136291b97e409a0f248b96e74ae (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: don't check n_sectors during revalidation if zero pata_via: Add Arima W730-K8 and other rebadgings pata_sis: Add the FSC Amilo and friends pata_pdc2027x: PLL detection fixes libata: fix n_sectors failure handling during revalidation
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c7
-rw-r--r--drivers/ata/pata_pdc2027x.c18
-rw-r--r--drivers/ata/pata_sis.c1
-rw-r--r--drivers/ata/pata_via.c5
4 files changed, 20 insertions, 11 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 99d4fbffb0df..2ad4dda6d4a7 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3700,11 +3700,16 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags)
3700 goto fail; 3700 goto fail;
3701 3701
3702 /* verify n_sectors hasn't changed */ 3702 /* verify n_sectors hasn't changed */
3703 if (dev->class == ATA_DEV_ATA && dev->n_sectors != n_sectors) { 3703 if (dev->class == ATA_DEV_ATA && n_sectors &&
3704 dev->n_sectors != n_sectors) {
3704 ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch " 3705 ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch "
3705 "%llu != %llu\n", 3706 "%llu != %llu\n",
3706 (unsigned long long)n_sectors, 3707 (unsigned long long)n_sectors,
3707 (unsigned long long)dev->n_sectors); 3708 (unsigned long long)dev->n_sectors);
3709
3710 /* restore original n_sectors */
3711 dev->n_sectors = n_sectors;
3712
3708 rc = -ENODEV; 3713 rc = -ENODEV;
3709 goto fail; 3714 goto fail;
3710 } 3715 }
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index 69a5aa4949f5..e3245b36269a 100644
--- a/drivers/ata/pata_pdc2027x.c
+++ b/drivers/ata/pata_pdc2027x.c
@@ -563,13 +563,13 @@ static long pdc_read_counter(struct ata_host *host)
563 u32 bccrl, bccrh, bccrlv, bccrhv; 563 u32 bccrl, bccrh, bccrlv, bccrhv;
564 564
565retry: 565retry:
566 bccrl = readl(mmio_base + PDC_BYTE_COUNT) & 0xffff; 566 bccrl = readl(mmio_base + PDC_BYTE_COUNT) & 0x7fff;
567 bccrh = readl(mmio_base + PDC_BYTE_COUNT + 0x100) & 0xffff; 567 bccrh = readl(mmio_base + PDC_BYTE_COUNT + 0x100) & 0x7fff;
568 rmb(); 568 rmb();
569 569
570 /* Read the counter values again for verification */ 570 /* Read the counter values again for verification */
571 bccrlv = readl(mmio_base + PDC_BYTE_COUNT) & 0xffff; 571 bccrlv = readl(mmio_base + PDC_BYTE_COUNT) & 0x7fff;
572 bccrhv = readl(mmio_base + PDC_BYTE_COUNT + 0x100) & 0xffff; 572 bccrhv = readl(mmio_base + PDC_BYTE_COUNT + 0x100) & 0x7fff;
573 rmb(); 573 rmb();
574 574
575 counter = (bccrh << 15) | bccrl; 575 counter = (bccrh << 15) | bccrl;
@@ -692,16 +692,16 @@ static long pdc_detect_pll_input_clock(struct ata_host *host)
692 struct timeval start_time, end_time; 692 struct timeval start_time, end_time;
693 long pll_clock, usec_elapsed; 693 long pll_clock, usec_elapsed;
694 694
695 /* Read current counter value */
696 start_count = pdc_read_counter(host);
697 do_gettimeofday(&start_time);
698
699 /* Start the test mode */ 695 /* Start the test mode */
700 scr = readl(mmio_base + PDC_SYS_CTL); 696 scr = readl(mmio_base + PDC_SYS_CTL);
701 PDPRINTK("scr[%X]\n", scr); 697 PDPRINTK("scr[%X]\n", scr);
702 writel(scr | (0x01 << 14), mmio_base + PDC_SYS_CTL); 698 writel(scr | (0x01 << 14), mmio_base + PDC_SYS_CTL);
703 readl(mmio_base + PDC_SYS_CTL); /* flush */ 699 readl(mmio_base + PDC_SYS_CTL); /* flush */
704 700
701 /* Read current counter value */
702 start_count = pdc_read_counter(host);
703 do_gettimeofday(&start_time);
704
705 /* Let the counter run for 100 ms. */ 705 /* Let the counter run for 100 ms. */
706 mdelay(100); 706 mdelay(100);
707 707
@@ -719,7 +719,7 @@ static long pdc_detect_pll_input_clock(struct ata_host *host)
719 usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 1000000 + 719 usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 1000000 +
720 (end_time.tv_usec - start_time.tv_usec); 720 (end_time.tv_usec - start_time.tv_usec);
721 721
722 pll_clock = (start_count - end_count) / 100 * 722 pll_clock = ((start_count - end_count) & 0x3fffffff) / 100 *
723 (100000000 / usec_elapsed); 723 (100000000 / usec_elapsed);
724 724
725 PDPRINTK("start[%ld] end[%ld] \n", start_count, end_count); 725 PDPRINTK("start[%ld] end[%ld] \n", start_count, end_count);
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
index 66bd0e83ac07..2bd7645f1a88 100644
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -54,6 +54,7 @@ struct sis_laptop {
54static const struct sis_laptop sis_laptop[] = { 54static const struct sis_laptop sis_laptop[] = {
55 /* devid, subvendor, subdev */ 55 /* devid, subvendor, subdev */
56 { 0x5513, 0x1043, 0x1107 }, /* ASUS A6K */ 56 { 0x5513, 0x1043, 0x1107 }, /* ASUS A6K */
57 { 0x5513, 0x1734, 0x105F }, /* FSC Amilo A1630 */
57 /* end marker */ 58 /* end marker */
58 { 0, } 59 { 0, }
59}; 60};
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index f645fe22cd1e..ea18e33f50ef 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -63,7 +63,7 @@
63#include <linux/dmi.h> 63#include <linux/dmi.h>
64 64
65#define DRV_NAME "pata_via" 65#define DRV_NAME "pata_via"
66#define DRV_VERSION "0.3.1" 66#define DRV_VERSION "0.3.2"
67 67
68/* 68/*
69 * The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx 69 * The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx
@@ -144,6 +144,9 @@ static int via_cable_override(struct pci_dev *pdev)
144 /* Systems by DMI */ 144 /* Systems by DMI */
145 if (dmi_check_system(cable_dmi_table)) 145 if (dmi_check_system(cable_dmi_table))
146 return 1; 146 return 1;
147 /* Arima W730-K8/Targa Visionary 811/... */
148 if (pdev->subsystem_vendor == 0x161F && pdev->subsystem_device == 0x2032)
149 return 1;
147 return 0; 150 return 0;
148} 151}
149 152