diff options
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-probe.c | 4 | ||||
-rw-r--r-- | drivers/ide/ide-taskfile.c | 12 | ||||
-rw-r--r-- | drivers/ide/pci/amd74xx.c | 8 | ||||
-rw-r--r-- | drivers/ide/pci/hpt366.c | 21 | ||||
-rw-r--r-- | drivers/ide/pci/it821x.c | 3 | ||||
-rw-r--r-- | drivers/ide/pci/pdc202xx_new.c | 10 | ||||
-rw-r--r-- | drivers/ide/setup-pci.c | 10 |
7 files changed, 45 insertions, 23 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 41bfa4d21ab6..f5ce22c38f82 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -574,11 +574,11 @@ static inline u8 probe_for_drive (ide_drive_t *drive) | |||
574 | /* look for ATAPI device */ | 574 | /* look for ATAPI device */ |
575 | (void) do_probe(drive, WIN_PIDENTIFY); | 575 | (void) do_probe(drive, WIN_PIDENTIFY); |
576 | } | 576 | } |
577 | if (strstr(drive->id->model, "E X A B Y T E N E S T")) | ||
578 | enable_nest(drive); | ||
579 | if (!drive->present) | 577 | if (!drive->present) |
580 | /* drive not found */ | 578 | /* drive not found */ |
581 | return 0; | 579 | return 0; |
580 | if (strstr(drive->id->model, "E X A B Y T E N E S T")) | ||
581 | enable_nest(drive); | ||
582 | 582 | ||
583 | /* identification failed? */ | 583 | /* identification failed? */ |
584 | if (!drive->id_read) { | 584 | if (!drive->id_read) { |
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 30175c7688e8..aa06dafb74ac 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -238,7 +238,7 @@ EXPORT_SYMBOL(task_no_data_intr); | |||
238 | static u8 wait_drive_not_busy(ide_drive_t *drive) | 238 | static u8 wait_drive_not_busy(ide_drive_t *drive) |
239 | { | 239 | { |
240 | ide_hwif_t *hwif = HWIF(drive); | 240 | ide_hwif_t *hwif = HWIF(drive); |
241 | int retries = 100; | 241 | int retries; |
242 | u8 stat; | 242 | u8 stat; |
243 | 243 | ||
244 | /* | 244 | /* |
@@ -246,10 +246,14 @@ static u8 wait_drive_not_busy(ide_drive_t *drive) | |||
246 | * This can take up to 10 usec, but we will wait max 1 ms | 246 | * This can take up to 10 usec, but we will wait max 1 ms |
247 | * (drive_cmd_intr() waits that long). | 247 | * (drive_cmd_intr() waits that long). |
248 | */ | 248 | */ |
249 | while (((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) && retries--) | 249 | for (retries = 0; retries < 100; retries++) { |
250 | udelay(10); | 250 | if ((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) |
251 | udelay(10); | ||
252 | else | ||
253 | break; | ||
254 | } | ||
251 | 255 | ||
252 | if (!retries) | 256 | if (stat & BUSY_STAT) |
253 | printk(KERN_ERR "%s: drive still BUSY!\n", drive->name); | 257 | printk(KERN_ERR "%s: drive still BUSY!\n", drive->name); |
254 | 258 | ||
255 | return stat; | 259 | return stat; |
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c index 9db1be826e80..a2be65fcf89c 100644 --- a/drivers/ide/pci/amd74xx.c +++ b/drivers/ide/pci/amd74xx.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Version 2.15 | 2 | * Version 2.16 |
3 | * | 3 | * |
4 | * AMD 755/756/766/8111 and nVidia nForce/2/2s/3/3s/CK804/MCP04 | 4 | * AMD 755/756/766/8111 and nVidia nForce/2/2s/3/3s/CK804/MCP04 |
5 | * IDE driver for Linux. | 5 | * IDE driver for Linux. |
@@ -244,10 +244,8 @@ static int amd_set_drive(ide_drive_t *drive, u8 speed) | |||
244 | struct ide_timing t, p; | 244 | struct ide_timing t, p; |
245 | int T, UT; | 245 | int T, UT; |
246 | 246 | ||
247 | if (speed != XFER_PIO_SLOW && speed != drive->current_speed) | 247 | if (speed != XFER_PIO_SLOW) |
248 | if (ide_config_drive_speed(drive, speed)) | 248 | ide_config_drive_speed(drive, speed); |
249 | printk(KERN_WARNING "ide%d: Drive %d didn't accept speed setting. Oh, well.\n", | ||
250 | drive->dn >> 1, drive->dn & 1); | ||
251 | 249 | ||
252 | T = 1000000000 / amd_clock; | 250 | T = 1000000000 / amd_clock; |
253 | UT = T / min_t(int, max_t(int, amd_config->flags & AMD_UDMA, 1), 2); | 251 | UT = T / min_t(int, max_t(int, amd_config->flags & AMD_UDMA, 1), 2); |
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index ce8a5449a574..c33d0b0f11c9 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/ide/pci/hpt366.c Version 1.04 Jun 4, 2007 | 2 | * linux/drivers/ide/pci/hpt366.c Version 1.06 Jun 27, 2007 |
3 | * | 3 | * |
4 | * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> | 4 | * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> |
5 | * Portions Copyright (C) 2001 Sun Microsystems, Inc. | 5 | * Portions Copyright (C) 2001 Sun Microsystems, Inc. |
@@ -182,6 +182,7 @@ static const char *bad_ata66_4[] = { | |||
182 | "IC35L040AVER07-0", | 182 | "IC35L040AVER07-0", |
183 | "IC35L060AVER07-0", | 183 | "IC35L060AVER07-0", |
184 | "WDC AC310200R", | 184 | "WDC AC310200R", |
185 | "MAXTOR STM3320620A", | ||
185 | NULL | 186 | NULL |
186 | }; | 187 | }; |
187 | 188 | ||
@@ -1513,18 +1514,28 @@ static int __devinit init_setup_hpt366(struct pci_dev *dev, ide_pci_device_t *d) | |||
1513 | goto init_single; | 1514 | goto init_single; |
1514 | 1515 | ||
1515 | /* | 1516 | /* |
1516 | * HPT36x chips are single channel and | 1517 | * HPT36x chips have one channel per function and have |
1517 | * do not seem to have the channel enable bit... | 1518 | * both channel enable bits located differently and visible |
1519 | * to both functions -- really stupid design decision... :-( | ||
1520 | * Bit 4 is for the primary channel, bit 5 for the secondary. | ||
1518 | */ | 1521 | */ |
1519 | d->channels = 1; | 1522 | d->channels = 1; |
1520 | d->enablebits[0].reg = 0; | 1523 | d->enablebits[0].mask = d->enablebits[0].val = 0x10; |
1521 | 1524 | ||
1522 | if ((dev2 = pci_get_slot(dev->bus, dev->devfn + 1)) != NULL) { | 1525 | if ((dev2 = pci_get_slot(dev->bus, dev->devfn + 1)) != NULL) { |
1523 | u8 pin1 = 0, pin2 = 0; | 1526 | u8 mcr1 = 0, pin1 = 0, pin2 = 0; |
1524 | int ret; | 1527 | int ret; |
1525 | 1528 | ||
1526 | pci_set_drvdata(dev2, info[rev]); | 1529 | pci_set_drvdata(dev2, info[rev]); |
1527 | 1530 | ||
1531 | /* | ||
1532 | * Now we'll have to force both channels enabled if | ||
1533 | * at least one of them has been enabled by BIOS... | ||
1534 | */ | ||
1535 | pci_read_config_byte(dev, 0x50, &mcr1); | ||
1536 | if (mcr1 & 0x30) | ||
1537 | pci_write_config_byte(dev, 0x50, mcr1 | 0x30); | ||
1538 | |||
1528 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin1); | 1539 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin1); |
1529 | pci_read_config_byte(dev2, PCI_INTERRUPT_PIN, &pin2); | 1540 | pci_read_config_byte(dev2, PCI_INTERRUPT_PIN, &pin2); |
1530 | if (pin1 != pin2 && dev->irq == dev2->irq) { | 1541 | if (pin1 != pin2 && dev->irq == dev2->irq) { |
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c index 4bd4bf02e917..3aeb7f1b7916 100644 --- a/drivers/ide/pci/it821x.c +++ b/drivers/ide/pci/it821x.c | |||
@@ -1,6 +1,6 @@ | |||
1 | 1 | ||
2 | /* | 2 | /* |
3 | * linux/drivers/ide/pci/it821x.c Version 0.15 Jun 2 2007 | 3 | * linux/drivers/ide/pci/it821x.c Version 0.16 Jul 3 2007 |
4 | * | 4 | * |
5 | * Copyright (C) 2004 Red Hat <alan@redhat.com> | 5 | * Copyright (C) 2004 Red Hat <alan@redhat.com> |
6 | * Copyright (C) 2007 Bartlomiej Zolnierkiewicz | 6 | * Copyright (C) 2007 Bartlomiej Zolnierkiewicz |
@@ -660,7 +660,6 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif) | |||
660 | 660 | ||
661 | hwif->ultra_mask = 0x7f; | 661 | hwif->ultra_mask = 0x7f; |
662 | hwif->mwdma_mask = 0x07; | 662 | hwif->mwdma_mask = 0x07; |
663 | hwif->swdma_mask = 0x07; | ||
664 | 663 | ||
665 | hwif->ide_dma_check = &it821x_config_drive_for_dma; | 664 | hwif->ide_dma_check = &it821x_config_drive_for_dma; |
666 | if (!(hwif->udma_four)) | 665 | if (!(hwif->udma_four)) |
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c index cc0bfdcf1f19..0765dce6948e 100644 --- a/drivers/ide/pci/pdc202xx_new.c +++ b/drivers/ide/pci/pdc202xx_new.c | |||
@@ -306,11 +306,13 @@ static long __devinit read_counter(u32 dma_base) | |||
306 | */ | 306 | */ |
307 | static long __devinit detect_pll_input_clock(unsigned long dma_base) | 307 | static long __devinit detect_pll_input_clock(unsigned long dma_base) |
308 | { | 308 | { |
309 | struct timeval start_time, end_time; | ||
309 | long start_count, end_count; | 310 | long start_count, end_count; |
310 | long pll_input; | 311 | long pll_input, usec_elapsed; |
311 | u8 scr1; | 312 | u8 scr1; |
312 | 313 | ||
313 | start_count = read_counter(dma_base); | 314 | start_count = read_counter(dma_base); |
315 | do_gettimeofday(&start_time); | ||
314 | 316 | ||
315 | /* Start the test mode */ | 317 | /* Start the test mode */ |
316 | outb(0x01, dma_base + 0x01); | 318 | outb(0x01, dma_base + 0x01); |
@@ -322,6 +324,7 @@ static long __devinit detect_pll_input_clock(unsigned long dma_base) | |||
322 | mdelay(10); | 324 | mdelay(10); |
323 | 325 | ||
324 | end_count = read_counter(dma_base); | 326 | end_count = read_counter(dma_base); |
327 | do_gettimeofday(&end_time); | ||
325 | 328 | ||
326 | /* Stop the test mode */ | 329 | /* Stop the test mode */ |
327 | outb(0x01, dma_base + 0x01); | 330 | outb(0x01, dma_base + 0x01); |
@@ -333,7 +336,10 @@ static long __devinit detect_pll_input_clock(unsigned long dma_base) | |||
333 | * Calculate the input clock in Hz | 336 | * Calculate the input clock in Hz |
334 | * (the clock counter is 30 bit wide and counts down) | 337 | * (the clock counter is 30 bit wide and counts down) |
335 | */ | 338 | */ |
336 | pll_input = ((start_count - end_count) & 0x3ffffff) * 100; | 339 | usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 1000000 + |
340 | (end_time.tv_usec - start_time.tv_usec); | ||
341 | pll_input = ((start_count - end_count) & 0x3ffffff) / 10 * | ||
342 | (10000000 / usec_elapsed); | ||
337 | 343 | ||
338 | DBG("start[%ld] end[%ld]\n", start_count, end_count); | 344 | DBG("start[%ld] end[%ld]\n", start_count, end_count); |
339 | 345 | ||
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index 67035ba4bf5e..c88d33225cf9 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c | |||
@@ -872,11 +872,15 @@ void __init ide_scan_pcibus (int scan_direction) | |||
872 | * are post init. | 872 | * are post init. |
873 | */ | 873 | */ |
874 | 874 | ||
875 | list_for_each_safe(l, n, &ide_pci_drivers) | 875 | list_for_each_safe(l, n, &ide_pci_drivers) { |
876 | { | ||
877 | list_del(l); | 876 | list_del(l); |
878 | d = list_entry(l, struct pci_driver, node); | 877 | d = list_entry(l, struct pci_driver, node); |
879 | __pci_register_driver(d, d->driver.owner, d->driver.mod_name); | 878 | if (__pci_register_driver(d, d->driver.owner, |
879 | d->driver.mod_name)) { | ||
880 | printk(KERN_ERR "%s: failed to register driver " | ||
881 | "for %s\n", __FUNCTION__, | ||
882 | d->driver.mod_name); | ||
883 | } | ||
880 | } | 884 | } |
881 | } | 885 | } |
882 | #endif | 886 | #endif |