diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-11 22:20:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-11 22:20:44 -0400 |
commit | 19f71153b9be219756c6b2757921433a69b7975c (patch) | |
tree | cc2c5c290a88d61df16848f733aed8708e82c119 /drivers/ide/ide-io.c | |
parent | e6005a85acb9609326512ecc784859831cfb24a3 (diff) | |
parent | 8f4dd2e42637fd61a6366d2cace69091926eaa15 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (24 commits)
ide: use only ->set_pio_mode method for programming PIO modes (take 2)
sis5513: don't change UDMA settings when programming PIO
it8213/piix/slc90e66: don't change DMA settings when programming PIO
alim15x3: PIO mode setup fixes
siimage: fix ->set_pio_mode method to select PIO data transfer
cs5520: don't enable VDMA in ->speedproc
sc1200: remove redundant warning message from sc1200_tune_chipset()
ide-pmac: PIO mode setup fixes (take 3)
icside: fix ->speedproc to return on unsupported modes (take 5)
sgiioc4: use ide_tune_dma()
amd74xx/via82cxxx: use ide_tune_dma()
ide: add ide_set{_max}_pio() (take 4)
ide: Kconfig face-lift
ide: move ide_rate_filter() calls to the upper layer (take 2)
sis5513: add ->udma_filter method for chipset_family >= ATA_133
ide: mode limiting fixes for user requested speed changes
ide: add missing ide_rate_filter() calls to ->speedproc()-s
ide: call udma_filter() before resorting to the UltraDMA mask
ide: make jmicron match vendor and device class
pdc202xx_new: switch to using pci_get_slot() (take 2)
...
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r-- | drivers/ide/ide-io.c | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index aa9f5f0b1e67..9560a8f4a86c 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -201,8 +201,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request * | |||
201 | return do_rw_taskfile(drive, args); | 201 | return do_rw_taskfile(drive, args); |
202 | 202 | ||
203 | case idedisk_pm_restore_pio: /* Resume step 1 (restore PIO) */ | 203 | case idedisk_pm_restore_pio: /* Resume step 1 (restore PIO) */ |
204 | if (drive->hwif->tuneproc != NULL) | 204 | ide_set_max_pio(drive); |
205 | drive->hwif->tuneproc(drive, 255); | ||
206 | /* | 205 | /* |
207 | * skip idedisk_pm_idle for ATAPI devices | 206 | * skip idedisk_pm_idle for ATAPI devices |
208 | */ | 207 | */ |
@@ -788,6 +787,30 @@ static ide_startstop_t ide_disk_special(ide_drive_t *drive) | |||
788 | return ide_started; | 787 | return ide_started; |
789 | } | 788 | } |
790 | 789 | ||
790 | /* | ||
791 | * handle HDIO_SET_PIO_MODE ioctl abusers here, eventually it will go away | ||
792 | */ | ||
793 | static int set_pio_mode_abuse(ide_hwif_t *hwif, u8 req_pio) | ||
794 | { | ||
795 | switch (req_pio) { | ||
796 | case 202: | ||
797 | case 201: | ||
798 | case 200: | ||
799 | case 102: | ||
800 | case 101: | ||
801 | case 100: | ||
802 | return (hwif->host_flags & IDE_HFLAG_ABUSE_DMA_MODES) ? 1 : 0; | ||
803 | case 9: | ||
804 | case 8: | ||
805 | return (hwif->host_flags & IDE_HFLAG_ABUSE_PREFETCH) ? 1 : 0; | ||
806 | case 7: | ||
807 | case 6: | ||
808 | return (hwif->host_flags & IDE_HFLAG_ABUSE_FAST_DEVSEL) ? 1 : 0; | ||
809 | default: | ||
810 | return 0; | ||
811 | } | ||
812 | } | ||
813 | |||
791 | /** | 814 | /** |
792 | * do_special - issue some special commands | 815 | * do_special - issue some special commands |
793 | * @drive: drive the command is for | 816 | * @drive: drive the command is for |
@@ -805,9 +828,17 @@ static ide_startstop_t do_special (ide_drive_t *drive) | |||
805 | printk("%s: do_special: 0x%02x\n", drive->name, s->all); | 828 | printk("%s: do_special: 0x%02x\n", drive->name, s->all); |
806 | #endif | 829 | #endif |
807 | if (s->b.set_tune) { | 830 | if (s->b.set_tune) { |
831 | ide_hwif_t *hwif = drive->hwif; | ||
832 | u8 req_pio = drive->tune_req; | ||
833 | |||
808 | s->b.set_tune = 0; | 834 | s->b.set_tune = 0; |
809 | if (HWIF(drive)->tuneproc != NULL) | 835 | |
810 | HWIF(drive)->tuneproc(drive, drive->tune_req); | 836 | if (set_pio_mode_abuse(drive->hwif, req_pio)) { |
837 | if (hwif->set_pio_mode) | ||
838 | hwif->set_pio_mode(drive, req_pio); | ||
839 | } else | ||
840 | ide_set_pio(drive, req_pio); | ||
841 | |||
811 | return ide_stopped; | 842 | return ide_stopped; |
812 | } else { | 843 | } else { |
813 | if (drive->media == ide_disk) | 844 | if (drive->media == ide_disk) |