OSDN Git Service

Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 12 Oct 2007 02:20:44 +0000 (19:20 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 12 Oct 2007 02:20:44 +0000 (19:20 -0700)
* 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)
  ...

1  2 
drivers/ide/pci/alim15x3.c
drivers/ide/pci/via82cxxx.c

@@@ -1,5 -1,5 +1,5 @@@
  /*
-  * linux/drivers/ide/pci/alim15x3.c           Version 0.25    Jun 9 2007
+  * linux/drivers/ide/pci/alim15x3.c           Version 0.26    Jul 14 2007
   *
   *  Copyright (C) 1998-2000 Michel Aubry, Maintainer
   *  Copyright (C) 1998-2000 Andrzej Krzysztofowicz, Maintainer
@@@ -283,17 -283,14 +283,14 @@@ static int ali_get_info (char *buffer, 
  #endif  /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_IDE_PROC_FS) */
  
  /**
-  *    ali15x3_tune_pio        -       set up chipset for PIO mode
-  *    @drive: drive to tune
-  *    @pio: desired mode
-  *
-  *    Select the best PIO mode for the drive in question.
-  *    Then program the controller for this mode.
+  *    ali_tune_pio    -       set host controller for PIO mode
+  *    @drive: drive
+  *    @pio: PIO mode number
   *
-  *    Returns the PIO mode programmed.
+  *    Program the controller for the given PIO mode.
   */
-  
- static u8 ali15x3_tune_pio (ide_drive_t *drive, u8 pio)
+ static void ali_tune_pio(ide_drive_t *drive, const u8 pio)
  {
        ide_hwif_t *hwif = HWIF(drive);
        struct pci_dev *dev = hwif->pci_dev;
        u8 cd_dma_fifo = 0;
        int unit = drive->select.b.unit & 1;
  
-       pio = ide_get_best_pio_mode(drive, pio, 5);
        s_time = ide_pio_timings[pio].setup_time;
        a_time = ide_pio_timings[pio].active_time;
        if ((s_clc = (s_time * bus_speed + 999) / 1000) >= 8)
         * { 25,   70,     25  },   PIO Mode 4 with IORDY  ns
         * { 20,   50,     30  }    PIO Mode 5 with IORDY (nonstandard)
         */
-       return pio;
  }
  
  /**
-  *    ali15x3_tune_drive      -       set up drive for PIO mode
+  *    ali_set_pio_mode        -       set up drive for PIO mode
   *    @drive: drive to tune
   *    @pio: desired mode
   *
-  *    Program the controller with the best PIO timing for the given drive.
+  *    Program the controller with the desired PIO timing for the given drive.
   *    Then set up the drive itself.
   */
  
- static void ali15x3_tune_drive (ide_drive_t *drive, u8 pio)
+ static void ali_set_pio_mode(ide_drive_t *drive, const u8 pio)
  {
-       pio = ali15x3_tune_pio(drive, pio);
+       ali_tune_pio(drive, pio);
        (void) ide_config_drive_speed(drive, XFER_PIO_0 + pio);
  }
  
@@@ -409,22 -403,24 +403,24 @@@ static u8 ali_udma_filter(ide_drive_t *
  /**
   *    ali15x3_tune_chipset    -       set up chipset/drive for new speed
   *    @drive: drive to configure for
-  *    @xferspeed: desired speed
+  *    @speed: desired speed
   *
   *    Configure the hardware for the desired IDE transfer mode.
   *    We also do the needed drive configuration through helpers
   */
-  
- static int ali15x3_tune_chipset (ide_drive_t *drive, u8 xferspeed)
+ static int ali15x3_tune_chipset(ide_drive_t *drive, const u8 speed)
  {
        ide_hwif_t *hwif        = HWIF(drive);
        struct pci_dev *dev     = hwif->pci_dev;
-       u8 speed                = ide_rate_filter(drive, xferspeed);
        u8 speed1               = speed;
        u8 unit                 = (drive->select.b.unit & 0x01);
        u8 tmpbyte              = 0x00;
        int m5229_udma          = (hwif->channel) ? 0x57 : 0x56;
  
+       if (speed < XFER_PIO_0)
+               return 1;
        if (speed == XFER_UDMA_6)
                speed1 = 0x47;
  
                tmpbyte &= ultra_enable;
                pci_write_config_byte(dev, m5229_udma, tmpbyte);
  
-               if (speed < XFER_SW_DMA_0)
-                       (void) ali15x3_tune_pio(drive, speed - XFER_PIO_0);
+               /*
+                * FIXME: Oh, my... DMA timings are never set.
+                */
        } else {
                pci_read_config_byte(dev, m5229_udma, &tmpbyte);
                tmpbyte &= (0x0f << ((1-unit) << 2));
@@@ -471,7 -468,7 +468,7 @@@ static int ali15x3_config_drive_for_dma
        if (ide_tune_dma(drive))
                return 0;
  
-       ali15x3_tune_drive(drive, 255);
+       ide_set_max_pio(drive);
  
        return -1;
  }
@@@ -588,7 -585,7 +585,7 @@@ out
   *    Cable special cases
   */
  
 -static struct dmi_system_id cable_dmi_table[] = {
 +static const struct dmi_system_id cable_dmi_table[] = {
        {
                .ident = "HP Pavilion N5430",
                .matches = {
@@@ -701,7 -698,7 +698,7 @@@ static u8 __devinit ata66_ali15x3(ide_h
  static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif)
  {
        hwif->autodma = 0;
-       hwif->tuneproc = &ali15x3_tune_drive;
+       hwif->set_pio_mode = &ali_set_pio_mode;
        hwif->speedproc = &ali15x3_tune_chipset;
        hwif->udma_filter = &ali_udma_filter;
  
@@@ -1,6 -1,6 +1,6 @@@
  /*
   *
-  * Version 3.47
+  * Version 3.48
   *
   * VIA IDE driver for Linux. Supported southbridges:
   *
@@@ -158,7 -158,7 +158,7 @@@ static void via_set_speed(ide_hwif_t *h
   *    by upper layers.
   */
  
- static int via_set_drive(ide_drive_t *drive, u8 speed)
+ static int via_set_drive(ide_drive_t *drive, const u8 speed)
  {
        ide_drive_t *peer = HWIF(drive)->drives + (~drive->dn & 1);
        struct via82cxxx_dev *vdev = pci_get_drvdata(drive->hwif->pci_dev);
  }
  
  /**
-  *    via82cxxx_tune_drive    -       PIO setup
-  *    @drive: drive to set up
-  *    @pio: mode to use (255 for 'best possible')
+  *    via_set_pio_mode        -       PIO setup
+  *    @drive: drive
+  *    @pio: PIO mode number
   *
   *    A callback from the upper layers for PIO-only tuning.
   */
  
- static void via82cxxx_tune_drive(ide_drive_t *drive, u8 pio)
+ static void via_set_pio_mode(ide_drive_t *drive, const u8 pio)
  {
-       if (pio == 255)
-               pio = ide_get_best_pio_mode(drive, 255, 5);
-       via_set_drive(drive, XFER_PIO_0 + min_t(u8, pio, 5));
+       via_set_drive(drive, XFER_PIO_0 + pio);
  }
  
  /**
   
  static int via82cxxx_ide_dma_check (ide_drive_t *drive)
  {
-       u8 speed = ide_max_dma_mode(drive);
-       if (speed == 0) {
-               via82cxxx_tune_drive(drive, 255);
-               return -1;
-       }
-       via_set_drive(drive, speed);
-       if (drive->autodma)
+       if (ide_tune_dma(drive))
                return 0;
  
+       ide_set_max_pio(drive);
        return -1;
  }
  
@@@ -419,7 -409,7 +409,7 @@@ static unsigned int __devinit init_chip
   *    Cable special cases
   */
  
 -static struct dmi_system_id cable_dmi_table[] = {
 +static const struct dmi_system_id cable_dmi_table[] = {
        {
                .ident = "Acer Ferrari 3400",
                .matches = {
@@@ -465,7 -455,7 +455,7 @@@ static void __devinit init_hwif_via82cx
  
        hwif->autodma = 0;
  
-       hwif->tuneproc = &via82cxxx_tune_drive;
+       hwif->set_pio_mode = &via_set_pio_mode;
        hwif->speedproc = &via_set_drive;