Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 9 May 2007 22:41:31 +0000 (15:41 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 9 May 2007 22:41:31 +0000 (15:41 -0700)
* master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6:
  ide: fix PIO setup on resume for ATAPI devices
  ide: legacy PCI bus order probing fixes
  ide: add ide_proc_register_port()
  ide: add "initializing" argument to ide_register_hw()
  ide: cable detection fixes (take 2)
  ide: move IDE settings handling to ide-proc.c
  ide: split off ioctl handling from IDE settings (v2)
  ide: make /proc/ide/ optional
  ide: add ide_tune_dma() helper
  ide: rework the code for selecting the best DMA transfer mode (v3)
  ide: fix UDMA/MWDMA/SWDMA masks (v3)

1  2 
drivers/ide/pci/siimage.c

@@@ -122,45 -122,41 +122,41 @@@ static inline unsigned long siimage_sel
  }
  
  /**
-  *    siimage_ratemask        -       Compute available modes
-  *    @drive: IDE drive
+  *    sil_udma_filter         -       compute UDMA mask
+  *    @drive: IDE device
+  *
+  *    Compute the available UDMA speeds for the device on the interface.
   *
-  *    Compute the available speeds for the devices on the interface.
   *    For the CMD680 this depends on the clocking mode (scsc), for the
-  *    SI3312 SATA controller life is a bit simpler. Enforce UDMA33
-  *    as a limit if there is no 80pin cable present.
+  *    SI3112 SATA controller life is a bit simpler.
   */
-  
- static byte siimage_ratemask (ide_drive_t *drive)
+ static u8 sil_udma_filter(ide_drive_t *drive)
  {
-       ide_hwif_t *hwif        = HWIF(drive);
-       u8 mode = 0, scsc = 0;
+       ide_hwif_t *hwif = drive->hwif;
        unsigned long base = (unsigned long) hwif->hwif_data;
+       u8 mask = 0, scsc = 0;
  
        if (hwif->mmio)
                scsc = hwif->INB(base + 0x4A);
        else
                pci_read_config_byte(hwif->pci_dev, 0x8A, &scsc);
  
-       if(is_sata(hwif))
-       {
-               if(strstr(drive->id->model, "Maxtor"))
-                       return 3;
-               return 4;
+       if (is_sata(hwif)) {
+               mask = strstr(drive->id->model, "Maxtor") ? 0x3f : 0x7f;
+               goto out;
        }
-       
        if ((scsc & 0x30) == 0x10)      /* 133 */
-               mode = 4;
+               mask = 0x7f;
        else if ((scsc & 0x30) == 0x20) /* 2xPCI */
-               mode = 4;
+               mask = 0x7f;
        else if ((scsc & 0x30) == 0x00) /* 100 */
-               mode = 3;
+               mask = 0x3f;
        else    /* Disabled ? */
                BUG();
-       if (!eighty_ninty_three(drive))
-               mode = min(mode, (u8)1);
-       return mode;
+ out:
+       return mask;
  }
  
  /**
@@@ -306,7 -302,7 +302,7 @@@ static int siimage_tune_chipset (ide_dr
        ide_hwif_t *hwif        = HWIF(drive);
        u16 ultra = 0, multi    = 0;
        u8 mode = 0, unit       = drive->select.b.unit;
-       u8 speed                = ide_rate_filter(siimage_ratemask(drive), xferspeed);
+       u8 speed                = ide_rate_filter(drive, xferspeed);
        unsigned long base      = (unsigned long)hwif->hwif_data;
        u8 scsc = 0, addr_mask  = ((hwif->channel) ?
                                    ((hwif->mmio) ? 0xF4 : 0x84) :
   
  static int config_chipset_for_dma (ide_drive_t *drive)
  {
-       u8 speed        = ide_dma_speed(drive, siimage_ratemask(drive));
+       u8 speed = ide_max_dma_mode(drive);
  
        if (!speed)
                return 0;
@@@ -831,7 -827,7 +827,7 @@@ static void __devinit init_mmio_iops_si
  
        /*
         *      Now set up the hw. We have to do this ourselves as
 -       *      the MMIO layout isnt the same as the the standard port
 +       *      the MMIO layout isnt the same as the standard port
         *      based I/O
         */
  
@@@ -989,6 -985,7 +985,7 @@@ static void __devinit init_hwif_siimage
        hwif->tuneproc  = &siimage_tuneproc;
        hwif->reset_poll = &siimage_reset_poll;
        hwif->pre_reset = &siimage_pre_reset;
+       hwif->udma_filter = &sil_udma_filter;
  
        if(is_sata(hwif)) {
                static int first = 1;