Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=90986028c98be10807bb6f48e883f33fa20e5499
Commit:     90986028c98be10807bb6f48e883f33fa20e5499
Parent:     a6fe837ed63aa812bea029a24b7aafc72ba8de88
Author:     Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 11 23:54:01 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Thu Oct 11 23:54:01 2007 +0200

    it8213/piix/slc90e66: don't change DMA settings when programming PIO
    
    Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/it8213.c   |   16 ++++++----------
 drivers/ide/pci/piix.c     |   17 +++++++----------
 drivers/ide/pci/slc90e66.c |   17 +++++++----------
 3 files changed, 20 insertions(+), 30 deletions(-)

diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c
index d07771e..24ef091 100644
--- a/drivers/ide/pci/it8213.c
+++ b/drivers/ide/pci/it8213.c
@@ -132,6 +132,11 @@ static int it8213_tune_chipset(ide_drive_t *drive, const 
u8 speed)
        u16                     reg4042, reg4a;
        u8                      reg48, reg54, reg55;
 
+       if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) {
+               it8213_tune_pio(drive, speed - XFER_PIO_0);
+               return ide_config_drive_speed(drive, speed);
+       }
+
        pci_read_config_word(dev, maslave, &reg4042);
        pci_read_config_byte(dev, 0x48, &reg48);
        pci_read_config_word(dev, 0x4a, &reg4a);
@@ -151,12 +156,6 @@ static int it8213_tune_chipset(ide_drive_t *drive, const 
u8 speed)
                case XFER_MW_DMA_1:
                case XFER_SW_DMA_2:
                        break;
-               case XFER_PIO_4:
-               case XFER_PIO_3:
-               case XFER_PIO_2:
-               case XFER_PIO_1:
-               case XFER_PIO_0:
-                       break;
                default:
                        return -1;
        }
@@ -188,10 +187,7 @@ static int it8213_tune_chipset(ide_drive_t *drive, const 
u8 speed)
                        pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag);
        }
 
-       if (speed > XFER_PIO_4)
-               it8213_tune_pio(drive, it8213_dma_2_pio(speed));
-       else
-               it8213_tune_pio(drive, speed - XFER_PIO_0);
+       it8213_tune_pio(drive, it8213_dma_2_pio(speed));
 
        return ide_config_drive_speed(drive, speed);
 }
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index 07492d7..860b929 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -1,5 +1,5 @@
 /*
- *  linux/drivers/ide/pci/piix.c       Version 0.51    Jul 6, 2007
+ *  linux/drivers/ide/pci/piix.c       Version 0.52    Jul 14, 2007
  *
  *  Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer
  *  Copyright (C) 1998-2000 Andre Hedrick <[EMAIL PROTECTED]>
@@ -242,6 +242,11 @@ static int piix_tune_chipset(ide_drive_t *drive, const u8 
speed)
        u16                     reg4042, reg4a;
        u8                      reg48, reg54, reg55;
 
+       if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) {
+               piix_tune_pio(drive, speed - XFER_PIO_0);
+               return ide_config_drive_speed(drive, speed);
+       }
+
        pci_read_config_word(dev, maslave, &reg4042);
        sitre = (reg4042 & 0x4000) ? 1 : 0;
        pci_read_config_byte(dev, 0x48, &reg48);
@@ -259,11 +264,6 @@ static int piix_tune_chipset(ide_drive_t *drive, const u8 
speed)
                case XFER_MW_DMA_2:
                case XFER_MW_DMA_1:
                case XFER_SW_DMA_2:     break;
-               case XFER_PIO_4:
-               case XFER_PIO_3:
-               case XFER_PIO_2:
-               case XFER_PIO_1:
-               case XFER_PIO_0:        break;
                default:                return -1;
        }
 
@@ -293,10 +293,7 @@ static int piix_tune_chipset(ide_drive_t *drive, const u8 
speed)
                        pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag);
        }
 
-       if (speed > XFER_PIO_4)
-               piix_tune_pio(drive, piix_dma_2_pio(speed));
-       else
-               piix_tune_pio(drive, speed - XFER_PIO_0);
+       piix_tune_pio(drive, piix_dma_2_pio(speed));
 
        return ide_config_drive_speed(drive, speed);
 }
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c
index 214d396..967b939 100644
--- a/drivers/ide/pci/slc90e66.c
+++ b/drivers/ide/pci/slc90e66.c
@@ -1,5 +1,5 @@
 /*
- *  linux/drivers/ide/pci/slc90e66.c   Version 0.15    Jul 6, 2007
+ *  linux/drivers/ide/pci/slc90e66.c   Version 0.16    Jul 14, 2007
  *
  *  Copyright (C) 2000-2002 Andre Hedrick <[EMAIL PROTECTED]>
  *  Copyright (C) 2006-2007 MontaVista Software, Inc. <[EMAIL PROTECTED]>
@@ -110,6 +110,11 @@ static int slc90e66_tune_chipset(ide_drive_t *drive, const 
u8 speed)
        int u_speed = 0, u_flag = 1 << drive->dn;
        u16                     reg4042, reg44, reg48, reg4a;
 
+       if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) {
+               slc90e66_tune_pio(drive, speed - XFER_PIO_0);
+               return ide_config_drive_speed(drive, speed);
+       }
+
        pci_read_config_word(dev, maslave, &reg4042);
        sitre = (reg4042 & 0x4000) ? 1 : 0;
        pci_read_config_word(dev, 0x44, &reg44);
@@ -125,11 +130,6 @@ static int slc90e66_tune_chipset(ide_drive_t *drive, const 
u8 speed)
                case XFER_MW_DMA_2:
                case XFER_MW_DMA_1:
                case XFER_SW_DMA_2:     break;
-               case XFER_PIO_4:
-               case XFER_PIO_3:
-               case XFER_PIO_2:
-               case XFER_PIO_1:
-               case XFER_PIO_0:        break;
                default:                return -1;
        }
 
@@ -149,10 +149,7 @@ static int slc90e66_tune_chipset(ide_drive_t *drive, const 
u8 speed)
                        pci_write_config_word(dev, 0x4a, reg4a & ~a_speed);
        }
 
-       if (speed > XFER_PIO_4)
-               slc90e66_tune_pio(drive, slc90e66_dma_2_pio(speed));
-       else
-               slc90e66_tune_pio(drive, speed - XFER_PIO_0);
+       slc90e66_tune_pio(drive, slc90e66_dma_2_pio(speed));
 
        return ide_config_drive_speed(drive, speed);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to