diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 16:31:22 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 16:31:22 -0700 |
commit | 64fb98fc40738ae1a98bcea9ca3145b89fb71524 (patch) | |
tree | 24130f9c56b04638e91969d216db199652470a17 /drivers/ide/pci/atiixp.c | |
parent | 5f47c7eac65a45e33d7fe390effe75ec5c74f8bf (diff) | |
parent | 89636af25d75d8672aea05d258be357d0dc4bd70 (diff) | |
download | talos-op-linux-64fb98fc40738ae1a98bcea9ca3145b89fb71524.tar.gz talos-op-linux-64fb98fc40738ae1a98bcea9ca3145b89fb71524.zip |
Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6: (23 commits)
ide: add support for SCSI ioctls to ide-floppy
ide: remove stale changelog from setup-pci.c
ide: remove stale changelog/comments/TODO from ide.c
ide-cris: handle PIO auto-tuning in tune_cris_ide()
ide: add PIO masks
ide: remove ide_find_best_pio_mode()
ide: drop "PIO data" argument from ide_get_best_pio_mode()
ide: ide_find_best_pio_mode() fixes (take 2)
ide: add ide_pio_cycle_time() helper (take 2)
sc1200: remove stale Power Management code
ide: ide_start_power_step() fix WRT disabling DMA
serverworks: fix DMA
serverworks: always tune PIO
ide: add ide_pci_device_t.host_flags (take 2)
ide: add ide_dev_has_iordy() helper (take 4)
ide: make ide_get_best_pio_mode() print info if overriding PIO mode
siimage: PIO mode setup fixes (take 2)
atiixp: PIO mode setup fixes
ide: Stop mapping ROMs
IDE: Remove references to dead ETRAX-related variables.
...
Diffstat (limited to 'drivers/ide/pci/atiixp.c')
-rw-r--r-- | drivers/ide/pci/atiixp.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c index 2761510309b3..1725aa402d98 100644 --- a/drivers/ide/pci/atiixp.c +++ b/drivers/ide/pci/atiixp.c @@ -1,9 +1,8 @@ /* - * linux/drivers/ide/pci/atiixp.c Version 0.01-bart2 Feb. 26, 2004 + * linux/drivers/ide/pci/atiixp.c Version 0.02 Jun 16 2007 * * Copyright (C) 2003 ATI Inc. <hyu@ati.com> - * Copyright (C) 2004 Bartlomiej Zolnierkiewicz - * + * Copyright (C) 2004,2007 Bartlomiej Zolnierkiewicz */ #include <linux/types.h> @@ -123,14 +122,14 @@ static void atiixp_dma_host_off(ide_drive_t *drive) } /** - * atiixp_tune_drive - tune a drive attached to a ATIIXP + * atiixp_tune_pio - tune a drive attached to a ATIIXP * @drive: drive to tune * @pio: desired PIO mode * * Set the interface PIO mode. */ -static void atiixp_tuneproc(ide_drive_t *drive, u8 pio) +static void atiixp_tune_pio(ide_drive_t *drive, u8 pio) { struct pci_dev *dev = drive->hwif->pci_dev; unsigned long flags; @@ -154,6 +153,13 @@ static void atiixp_tuneproc(ide_drive_t *drive, u8 pio) spin_unlock_irqrestore(&atiixp_lock, flags); } +static void atiixp_tuneproc(ide_drive_t *drive, u8 pio) +{ + pio = ide_get_best_pio_mode(drive, pio, 4); + atiixp_tune_pio(drive, pio); + (void)ide_config_drive_speed(drive, XFER_PIO_0 + pio); +} + /** * atiixp_tune_chipset - tune a ATIIXP interface * @drive: IDE drive to tune @@ -175,6 +181,11 @@ static int atiixp_speedproc(ide_drive_t *drive, u8 xferspeed) speed = ide_rate_filter(drive, xferspeed); + if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) { + atiixp_tune_pio(drive, speed - XFER_PIO_0); + return ide_config_drive_speed(drive, speed); + } + spin_lock_irqsave(&atiixp_lock, flags); save_mdma_mode[drive->dn] = 0; @@ -201,7 +212,7 @@ static int atiixp_speedproc(ide_drive_t *drive, u8 xferspeed) else pio = speed - XFER_PIO_0; - atiixp_tuneproc(drive, pio); + atiixp_tune_pio(drive, pio); return ide_config_drive_speed(drive, speed); } @@ -216,18 +227,13 @@ static int atiixp_speedproc(ide_drive_t *drive, u8 xferspeed) static int atiixp_dma_check(ide_drive_t *drive) { - u8 tspeed, speed; - drive->init_speed = 0; if (ide_tune_dma(drive)) return 0; - if (ide_use_fast_pio(drive)) { - tspeed = ide_get_best_pio_mode(drive, 255, 5, NULL); - speed = atiixp_dma_2_pio(XFER_PIO_0 + tspeed) + XFER_PIO_0; - atiixp_speedproc(drive, speed); - } + if (ide_use_fast_pio(drive)) + atiixp_tuneproc(drive, 255); return -1; } @@ -285,17 +291,18 @@ static ide_pci_device_t atiixp_pci_info[] __devinitdata = { { /* 0 */ .name = "ATIIXP", .init_hwif = init_hwif_atiixp, - .channels = 2, .autodma = AUTODMA, .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}}, .bootable = ON_BOARD, + .pio_mask = ATA_PIO4, },{ /* 1 */ .name = "SB600_PATA", .init_hwif = init_hwif_atiixp, - .channels = 1, .autodma = AUTODMA, .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}}, .bootable = ON_BOARD, + .host_flags = IDE_HFLAG_SINGLE, + .pio_mask = ATA_PIO4, }, }; |