diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-25 16:17:10 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-25 16:17:10 -0500 |
commit | a3bbb9d882dc94fe3a1361596ab9ce55d84059ea (patch) | |
tree | b2b7af290b6300be00a2cbd6c5d0dba19905dc65 /drivers/ide/ide-disk.c | |
parent | 868e672ac8db650dde695a5707a6caf5a757e7d9 (diff) |
ide: remove unnecessary writes to HOB taskfile registers
* Set taskfile flags for REQ_TYPE_ATA_TASKFILE requests before
adding the request to the queue.
* Cleanup execute_drive_cmd().
* Remove unnecessary writes to HOB taskfile registers when using
LBA48 disk for the following cases:
- Power Management requests
(WIN_FLUSH_CACHE[_EXT], WIN_STANDBYNOW1, WIN_IDLEIMMEDIATE commands)
- special commands (WIN_SPECIFY, WIN_RESTORE, WIN_SETMULT)
- Host Protected Area support (WIN_READ_NATIVE_MAX, WIN_SET_MAX)
- /proc/ide/ SMART support (WIN_SMART with SMART_ENABLE,
SMART_READ_VALUES and SMART_READ_THRESHOLDS subcommands)
- write cache enabling/disabling in ide-disk
(WIN_SETFEATURES with SETFEATURES_{EN,DIS}_WCACHE)
- write cache flushing in ide-disk (WIN_FLUSH_CACHE[_EXT])
- acoustic management in ide-disk
(WIN_SETFEATURES with SETFEATURES_{EN,DIS}_AAM)
- door (un)locking in ide-disk (WIN_DOORLOCK, WIN_DOORUNLOCK)
- /proc/ide/hd?/identify support (WIN_IDENTIFY)
- ACPI _GTF taskfiles
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-disk.c')
-rw-r--r-- | drivers/ide/ide-disk.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 3e03d0c1a475..fc785e760bd8 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -304,6 +304,9 @@ static u64 idedisk_read_native_max_address(ide_drive_t *drive, int lba48) | |||
304 | else | 304 | else |
305 | tf->command = WIN_READ_NATIVE_MAX; | 305 | tf->command = WIN_READ_NATIVE_MAX; |
306 | tf->device = ATA_LBA; | 306 | tf->device = ATA_LBA; |
307 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | ||
308 | if (lba48) | ||
309 | args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_OUT_HOB); | ||
307 | /* submit command request */ | 310 | /* submit command request */ |
308 | ide_no_data_taskfile(drive, &args); | 311 | ide_no_data_taskfile(drive, &args); |
309 | 312 | ||
@@ -349,6 +352,9 @@ static u64 idedisk_set_max_address(ide_drive_t *drive, u64 addr_req, int lba48) | |||
349 | tf->command = WIN_SET_MAX; | 352 | tf->command = WIN_SET_MAX; |
350 | } | 353 | } |
351 | tf->device |= ATA_LBA; | 354 | tf->device |= ATA_LBA; |
355 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | ||
356 | if (lba48) | ||
357 | args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_OUT_HOB); | ||
352 | /* submit command request */ | 358 | /* submit command request */ |
353 | ide_no_data_taskfile(drive, &args); | 359 | ide_no_data_taskfile(drive, &args); |
354 | /* if OK, compute maximum address value */ | 360 | /* if OK, compute maximum address value */ |
@@ -497,6 +503,7 @@ static int smart_enable(ide_drive_t *drive) | |||
497 | tf->lbam = SMART_LCYL_PASS; | 503 | tf->lbam = SMART_LCYL_PASS; |
498 | tf->lbah = SMART_HCYL_PASS; | 504 | tf->lbah = SMART_HCYL_PASS; |
499 | tf->command = WIN_SMART; | 505 | tf->command = WIN_SMART; |
506 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | ||
500 | return ide_no_data_taskfile(drive, &args); | 507 | return ide_no_data_taskfile(drive, &args); |
501 | } | 508 | } |
502 | 509 | ||
@@ -511,6 +518,7 @@ static int get_smart_data(ide_drive_t *drive, u8 *buf, u8 sub_cmd) | |||
511 | tf->lbam = SMART_LCYL_PASS; | 518 | tf->lbam = SMART_LCYL_PASS; |
512 | tf->lbah = SMART_HCYL_PASS; | 519 | tf->lbah = SMART_HCYL_PASS; |
513 | tf->command = WIN_SMART; | 520 | tf->command = WIN_SMART; |
521 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | ||
514 | args.command_type = IDE_DRIVE_TASK_IN; | 522 | args.command_type = IDE_DRIVE_TASK_IN; |
515 | args.data_phase = TASKFILE_IN; | 523 | args.data_phase = TASKFILE_IN; |
516 | args.handler = &task_in_intr; | 524 | args.handler = &task_in_intr; |
@@ -690,6 +698,7 @@ static int write_cache(ide_drive_t *drive, int arg) | |||
690 | args.tf.feature = arg ? | 698 | args.tf.feature = arg ? |
691 | SETFEATURES_EN_WCACHE : SETFEATURES_DIS_WCACHE; | 699 | SETFEATURES_EN_WCACHE : SETFEATURES_DIS_WCACHE; |
692 | args.tf.command = WIN_SETFEATURES; | 700 | args.tf.command = WIN_SETFEATURES; |
701 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | ||
693 | err = ide_no_data_taskfile(drive, &args); | 702 | err = ide_no_data_taskfile(drive, &args); |
694 | if (err == 0) | 703 | if (err == 0) |
695 | drive->wcache = arg; | 704 | drive->wcache = arg; |
@@ -709,6 +718,7 @@ static int do_idedisk_flushcache (ide_drive_t *drive) | |||
709 | args.tf.command = WIN_FLUSH_CACHE_EXT; | 718 | args.tf.command = WIN_FLUSH_CACHE_EXT; |
710 | else | 719 | else |
711 | args.tf.command = WIN_FLUSH_CACHE; | 720 | args.tf.command = WIN_FLUSH_CACHE; |
721 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | ||
712 | return ide_no_data_taskfile(drive, &args); | 722 | return ide_no_data_taskfile(drive, &args); |
713 | } | 723 | } |
714 | 724 | ||
@@ -723,6 +733,7 @@ static int set_acoustic (ide_drive_t *drive, int arg) | |||
723 | args.tf.feature = arg ? SETFEATURES_EN_AAM : SETFEATURES_DIS_AAM; | 733 | args.tf.feature = arg ? SETFEATURES_EN_AAM : SETFEATURES_DIS_AAM; |
724 | args.tf.nsect = arg; | 734 | args.tf.nsect = arg; |
725 | args.tf.command = WIN_SETFEATURES; | 735 | args.tf.command = WIN_SETFEATURES; |
736 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | ||
726 | ide_no_data_taskfile(drive, &args); | 737 | ide_no_data_taskfile(drive, &args); |
727 | drive->acoustic = arg; | 738 | drive->acoustic = arg; |
728 | return 0; | 739 | return 0; |
@@ -985,6 +996,7 @@ static int idedisk_open(struct inode *inode, struct file *filp) | |||
985 | ide_task_t args; | 996 | ide_task_t args; |
986 | memset(&args, 0, sizeof(ide_task_t)); | 997 | memset(&args, 0, sizeof(ide_task_t)); |
987 | args.tf.command = WIN_DOORLOCK; | 998 | args.tf.command = WIN_DOORLOCK; |
999 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | ||
988 | check_disk_change(inode->i_bdev); | 1000 | check_disk_change(inode->i_bdev); |
989 | /* | 1001 | /* |
990 | * Ignore the return code from door_lock, | 1002 | * Ignore the return code from door_lock, |
@@ -1010,6 +1022,7 @@ static int idedisk_release(struct inode *inode, struct file *filp) | |||
1010 | ide_task_t args; | 1022 | ide_task_t args; |
1011 | memset(&args, 0, sizeof(ide_task_t)); | 1023 | memset(&args, 0, sizeof(ide_task_t)); |
1012 | args.tf.command = WIN_DOORUNLOCK; | 1024 | args.tf.command = WIN_DOORUNLOCK; |
1025 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | ||
1013 | if (drive->doorlocking && ide_no_data_taskfile(drive, &args)) | 1026 | if (drive->doorlocking && ide_no_data_taskfile(drive, &args)) |
1014 | drive->doorlocking = 0; | 1027 | drive->doorlocking = 0; |
1015 | } | 1028 | } |