diff options
| -rw-r--r-- | drivers/ide/Kconfig | 6 | ||||
| -rw-r--r-- | drivers/ide/ide-io.c | 32 | ||||
| -rw-r--r-- | drivers/ide/ide-iops.c | 11 | ||||
| -rw-r--r-- | drivers/ide/ide.c | 37 | ||||
| -rw-r--r-- | drivers/ide/pci/pdc202xx_new.c | 3 | ||||
| -rw-r--r-- | include/linux/ide.h | 1 | ||||
| -rw-r--r-- | kernel/time/clockevents.c | 69 |
7 files changed, 67 insertions, 92 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 8f1fd017679b..ca2e4f830c39 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
| @@ -103,8 +103,10 @@ config BLK_DEV_IDE_SATA | |||
| 103 | ---help--- | 103 | ---help--- |
| 104 | There are two drivers for Serial ATA controllers. | 104 | There are two drivers for Serial ATA controllers. |
| 105 | 105 | ||
| 106 | The main driver, "libata", exists inside the SCSI subsystem | 106 | The main driver, "libata", uses the SCSI subsystem |
| 107 | and supports most modern SATA controllers. | 107 | and supports most modern SATA controllers. In order to use it |
| 108 | you may take a look at "Serial ATA (prod) and Parallel ATA | ||
| 109 | (experimental) drivers". | ||
| 108 | 110 | ||
| 109 | The IDE driver (which you are currently configuring) supports | 111 | The IDE driver (which you are currently configuring) supports |
| 110 | a few first-generation SATA controllers. | 112 | a few first-generation SATA controllers. |
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index c193553f6fe7..0e0280076fcd 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
| @@ -519,21 +519,24 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8 | |||
| 519 | if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ && hwif->err_stops_fifo == 0) | 519 | if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ && hwif->err_stops_fifo == 0) |
| 520 | try_to_flush_leftover_data(drive); | 520 | try_to_flush_leftover_data(drive); |
| 521 | 521 | ||
| 522 | if (rq->errors >= ERROR_MAX || blk_noretry_request(rq)) { | ||
| 523 | ide_kill_rq(drive, rq); | ||
| 524 | return ide_stopped; | ||
| 525 | } | ||
| 526 | |||
| 522 | if (hwif->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT)) | 527 | if (hwif->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT)) |
| 523 | /* force an abort */ | 528 | rq->errors |= ERROR_RESET; |
| 524 | hwif->OUTB(WIN_IDLEIMMEDIATE, IDE_COMMAND_REG); | ||
| 525 | 529 | ||
| 526 | if (rq->errors >= ERROR_MAX || blk_noretry_request(rq)) | 530 | if ((rq->errors & ERROR_RESET) == ERROR_RESET) { |
| 527 | ide_kill_rq(drive, rq); | ||
| 528 | else { | ||
| 529 | if ((rq->errors & ERROR_RESET) == ERROR_RESET) { | ||
| 530 | ++rq->errors; | ||
| 531 | return ide_do_reset(drive); | ||
| 532 | } | ||
| 533 | if ((rq->errors & ERROR_RECAL) == ERROR_RECAL) | ||
| 534 | drive->special.b.recalibrate = 1; | ||
| 535 | ++rq->errors; | 531 | ++rq->errors; |
| 532 | return ide_do_reset(drive); | ||
| 536 | } | 533 | } |
| 534 | |||
| 535 | if ((rq->errors & ERROR_RECAL) == ERROR_RECAL) | ||
| 536 | drive->special.b.recalibrate = 1; | ||
| 537 | |||
| 538 | ++rq->errors; | ||
| 539 | |||
| 537 | return ide_stopped; | 540 | return ide_stopped; |
| 538 | } | 541 | } |
| 539 | 542 | ||
| @@ -1025,6 +1028,13 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) | |||
| 1025 | if (!drive->special.all) { | 1028 | if (!drive->special.all) { |
| 1026 | ide_driver_t *drv; | 1029 | ide_driver_t *drv; |
| 1027 | 1030 | ||
| 1031 | /* | ||
| 1032 | * We reset the drive so we need to issue a SETFEATURES. | ||
| 1033 | * Do it _after_ do_special() restored device parameters. | ||
| 1034 | */ | ||
| 1035 | if (drive->current_speed == 0xff) | ||
| 1036 | ide_config_drive_speed(drive, drive->desired_speed); | ||
| 1037 | |||
| 1028 | if (rq->cmd_type == REQ_TYPE_ATA_CMD || | 1038 | if (rq->cmd_type == REQ_TYPE_ATA_CMD || |
| 1029 | rq->cmd_type == REQ_TYPE_ATA_TASK || | 1039 | rq->cmd_type == REQ_TYPE_ATA_TASK || |
| 1030 | rq->cmd_type == REQ_TYPE_ATA_TASKFILE) | 1040 | rq->cmd_type == REQ_TYPE_ATA_TASKFILE) |
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index bd513f5a2323..1ee53a551c3a 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
| @@ -583,8 +583,12 @@ u8 eighty_ninty_three (ide_drive_t *drive) | |||
| 583 | if(!(drive->id->hw_config & 0x4000)) | 583 | if(!(drive->id->hw_config & 0x4000)) |
| 584 | return 0; | 584 | return 0; |
| 585 | #endif /* CONFIG_IDEDMA_IVB */ | 585 | #endif /* CONFIG_IDEDMA_IVB */ |
| 586 | if (!(drive->id->hw_config & 0x2000)) | 586 | /* |
| 587 | return 0; | 587 | * FIXME: |
| 588 | * - change master/slave IDENTIFY order | ||
| 589 | * - force bit13 (80c cable present) check | ||
| 590 | * (unless the slave device is pre-ATA3) | ||
| 591 | */ | ||
| 588 | return 1; | 592 | return 1; |
| 589 | } | 593 | } |
| 590 | 594 | ||
| @@ -1090,6 +1094,9 @@ static void pre_reset(ide_drive_t *drive) | |||
| 1090 | if (HWIF(drive)->pre_reset != NULL) | 1094 | if (HWIF(drive)->pre_reset != NULL) |
| 1091 | HWIF(drive)->pre_reset(drive); | 1095 | HWIF(drive)->pre_reset(drive); |
| 1092 | 1096 | ||
| 1097 | if (drive->current_speed != 0xff) | ||
| 1098 | drive->desired_speed = drive->current_speed; | ||
| 1099 | drive->current_speed = 0xff; | ||
| 1093 | } | 1100 | } |
| 1094 | 1101 | ||
| 1095 | /* | 1102 | /* |
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 695610f0e3e4..a6f098fda884 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
| @@ -1124,17 +1124,40 @@ static int set_io_32bit(ide_drive_t *drive, int arg) | |||
| 1124 | static int set_using_dma (ide_drive_t *drive, int arg) | 1124 | static int set_using_dma (ide_drive_t *drive, int arg) |
| 1125 | { | 1125 | { |
| 1126 | #ifdef CONFIG_BLK_DEV_IDEDMA | 1126 | #ifdef CONFIG_BLK_DEV_IDEDMA |
| 1127 | ide_hwif_t *hwif = drive->hwif; | ||
| 1128 | int err = -EPERM; | ||
| 1129 | |||
| 1127 | if (!drive->id || !(drive->id->capability & 1)) | 1130 | if (!drive->id || !(drive->id->capability & 1)) |
| 1128 | return -EPERM; | 1131 | goto out; |
| 1129 | if (HWIF(drive)->ide_dma_check == NULL) | 1132 | |
| 1130 | return -EPERM; | 1133 | if (hwif->ide_dma_check == NULL) |
| 1134 | goto out; | ||
| 1135 | |||
| 1136 | err = -EBUSY; | ||
| 1137 | if (ide_spin_wait_hwgroup(drive)) | ||
| 1138 | goto out; | ||
| 1139 | /* | ||
| 1140 | * set ->busy flag, unlock and let it ride | ||
| 1141 | */ | ||
| 1142 | hwif->hwgroup->busy = 1; | ||
| 1143 | spin_unlock_irq(&ide_lock); | ||
| 1144 | |||
| 1145 | err = 0; | ||
| 1146 | |||
| 1131 | if (arg) { | 1147 | if (arg) { |
| 1132 | if (ide_set_dma(drive)) | 1148 | if (ide_set_dma(drive) || hwif->ide_dma_on(drive)) |
| 1133 | return -EIO; | 1149 | err = -EIO; |
| 1134 | if (HWIF(drive)->ide_dma_on(drive)) return -EIO; | ||
| 1135 | } else | 1150 | } else |
| 1136 | ide_dma_off(drive); | 1151 | ide_dma_off(drive); |
| 1137 | return 0; | 1152 | |
| 1153 | /* | ||
| 1154 | * lock, clear ->busy flag and unlock before leaving | ||
| 1155 | */ | ||
| 1156 | spin_lock_irq(&ide_lock); | ||
| 1157 | hwif->hwgroup->busy = 0; | ||
| 1158 | spin_unlock_irq(&ide_lock); | ||
| 1159 | out: | ||
| 1160 | return err; | ||
| 1138 | #else | 1161 | #else |
| 1139 | return -EPERM; | 1162 | return -EPERM; |
| 1140 | #endif | 1163 | #endif |
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c index 6ceb25bc5a7b..ace98929cc3d 100644 --- a/drivers/ide/pci/pdc202xx_new.c +++ b/drivers/ide/pci/pdc202xx_new.c | |||
| @@ -255,7 +255,7 @@ static int config_chipset_for_dma(ide_drive_t *drive) | |||
| 255 | printk(KERN_WARNING "%s reduced to Ultra33 mode.\n", drive->name); | 255 | printk(KERN_WARNING "%s reduced to Ultra33 mode.\n", drive->name); |
| 256 | } | 256 | } |
| 257 | 257 | ||
| 258 | if (drive->media != ide_disk) | 258 | if (drive->media != ide_disk && drive->media != ide_cdrom) |
| 259 | return 0; | 259 | return 0; |
| 260 | 260 | ||
| 261 | if (id->capability & 4) { | 261 | if (id->capability & 4) { |
| @@ -545,6 +545,7 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif) | |||
| 545 | 545 | ||
| 546 | hwif->drives[0].autotune = hwif->drives[1].autotune = 1; | 546 | hwif->drives[0].autotune = hwif->drives[1].autotune = 1; |
| 547 | 547 | ||
| 548 | hwif->atapi_dma = 1; | ||
| 548 | hwif->ultra_mask = 0x7f; | 549 | hwif->ultra_mask = 0x7f; |
| 549 | hwif->mwdma_mask = 0x07; | 550 | hwif->mwdma_mask = 0x07; |
| 550 | 551 | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index 34f2676b3c62..58564a199862 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
| @@ -615,6 +615,7 @@ typedef struct ide_drive_s { | |||
| 615 | u8 init_speed; /* transfer rate set at boot */ | 615 | u8 init_speed; /* transfer rate set at boot */ |
| 616 | u8 pio_speed; /* unused by core, used by some drivers for fallback from DMA */ | 616 | u8 pio_speed; /* unused by core, used by some drivers for fallback from DMA */ |
| 617 | u8 current_speed; /* current transfer rate set */ | 617 | u8 current_speed; /* current transfer rate set */ |
| 618 | u8 desired_speed; /* desired transfer rate set */ | ||
| 618 | u8 dn; /* now wide spread use */ | 619 | u8 dn; /* now wide spread use */ |
| 619 | u8 wcache; /* status of write cache */ | 620 | u8 wcache; /* status of write cache */ |
| 620 | u8 acoustic; /* acoustic management */ | 621 | u8 acoustic; /* acoustic management */ |
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 67932ea78c17..76212b2a99de 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c | |||
| @@ -274,72 +274,3 @@ void clockevents_notify(unsigned long reason, void *arg) | |||
| 274 | } | 274 | } |
| 275 | EXPORT_SYMBOL_GPL(clockevents_notify); | 275 | EXPORT_SYMBOL_GPL(clockevents_notify); |
| 276 | 276 | ||
| 277 | #ifdef CONFIG_SYSFS | ||
| 278 | |||
| 279 | /** | ||
| 280 | * clockevents_show_registered - sysfs interface for listing clockevents | ||
| 281 | * @dev: unused | ||
| 282 | * @buf: char buffer to be filled with clock events list | ||
| 283 | * | ||
| 284 | * Provides sysfs interface for listing registered clock event devices | ||
| 285 | */ | ||
| 286 | static ssize_t clockevents_show_registered(struct sys_device *dev, char *buf) | ||
| 287 | { | ||
| 288 | struct list_head *tmp; | ||
| 289 | char *p = buf; | ||
| 290 | int cpu; | ||
| 291 | |||
| 292 | spin_lock(&clockevents_lock); | ||
| 293 | |||
| 294 | list_for_each(tmp, &clockevent_devices) { | ||
| 295 | struct clock_event_device *ce; | ||
| 296 | |||
| 297 | ce = list_entry(tmp, struct clock_event_device, list); | ||
| 298 | p += sprintf(p, "%-20s F:%04x M:%d", ce->name, | ||
| 299 | ce->features, ce->mode); | ||
| 300 | p += sprintf(p, " C:"); | ||
| 301 | if (!cpus_equal(ce->cpumask, cpu_possible_map)) { | ||
| 302 | for_each_cpu_mask(cpu, ce->cpumask) | ||
| 303 | p += sprintf(p, " %d", cpu); | ||
| 304 | } else { | ||
| 305 | /* | ||
| 306 | * FIXME: Add the cpu which is handling this sucker | ||
| 307 | */ | ||
| 308 | } | ||
| 309 | p += sprintf(p, "\n"); | ||
| 310 | } | ||
| 311 | |||
| 312 | spin_unlock(&clockevents_lock); | ||
| 313 | |||
| 314 | return p - buf; | ||
| 315 | } | ||
| 316 | |||
| 317 | /* | ||
| 318 | * Sysfs setup bits: | ||
| 319 | */ | ||
| 320 | static SYSDEV_ATTR(registered, 0600, | ||
| 321 | clockevents_show_registered, NULL); | ||
| 322 | |||
| 323 | static struct sysdev_class clockevents_sysclass = { | ||
| 324 | set_kset_name("clockevents"), | ||
| 325 | }; | ||
| 326 | |||
| 327 | static struct sys_device clockevents_sys_device = { | ||
| 328 | .id = 0, | ||
| 329 | .cls = &clockevents_sysclass, | ||
| 330 | }; | ||
| 331 | |||
| 332 | static int __init clockevents_sysfs_init(void) | ||
| 333 | { | ||
| 334 | int error = sysdev_class_register(&clockevents_sysclass); | ||
| 335 | |||
| 336 | if (!error) | ||
| 337 | error = sysdev_register(&clockevents_sys_device); | ||
| 338 | if (!error) | ||
| 339 | error = sysdev_create_file( | ||
| 340 | &clockevents_sys_device, | ||
| 341 | &attr_registered); | ||
| 342 | return error; | ||
| 343 | } | ||
| 344 | device_initcall(clockevents_sysfs_init); | ||
| 345 | #endif | ||
