Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ffe5415c3d6138aff412af7e455b3df4d53c0aa0
Commit:     ffe5415c3d6138aff412af7e455b3df4d53c0aa0
Parent:     326d72f437b0a9216290ad8f10817e1e363fd813
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

    siimage: fix ->set_pio_mode method to select PIO data transfer
    
    * Remember to select PIO data transfer (with IORDY monitored) in 
sil_tune_pio()
      (->set_pio_mode method) so the controller is always programmed correctly 
for
      PIO transfers (this is important if DMA is not going to be used).
    
    * Don't set DMA/UDMA timings for PIO modes in siimage_tune_chipset().
    
    * Bump driver version.
    
    Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/siimage.c |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index e07c991..c526c70 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/siimage.c             Version 1.15    Jun 29 2007
+ * linux/drivers/ide/pci/siimage.c             Version 1.16    Jul 13 2007
  *
  * Copyright (C) 2001-2002     Andre Hedrick <[EMAIL PROTECTED]>
  * Copyright (C) 2003          Red Hat <[EMAIL PROTECTED]>
@@ -185,7 +185,12 @@ static void sil_tune_pio(ide_drive_t *drive, u8 pio)
        u16 speedp              = 0;
        unsigned long addr      = siimage_seldev(drive, 0x04);
        unsigned long tfaddr    = siimage_selreg(hwif, 0x02);
+       unsigned long base      = (unsigned long)hwif->hwif_data;
        u8 tf_pio               = pio;
+       u8 addr_mask            = hwif->channel ? (hwif->mmio ? 0xF4 : 0x84)
+                                               : (hwif->mmio ? 0xB4 : 0x80);
+       u8 mode                 = 0;
+       u8 unit                 = drive->select.b.unit;
 
        /* trim *taskfile* PIO to the slowest of the master/slave */
        if (pair->present) {
@@ -207,6 +212,11 @@ static void sil_tune_pio(ide_drive_t *drive, u8 pio)
                        hwif->OUTW(hwif->INW(tfaddr-2)|0x200, tfaddr-2);
                else
                        hwif->OUTW(hwif->INW(tfaddr-2)&~0x200, tfaddr-2);
+
+               mode = hwif->INB(base + addr_mask);
+               mode &= ~(unit ? 0x30 : 0x03);
+               mode |= (unit ? 0x10 : 0x01);
+               hwif->OUTB(mode, base + addr_mask);
        } else {
                pci_write_config_word(hwif->pci_dev, addr, speedp);
                pci_write_config_word(hwif->pci_dev, tfaddr, speedt);
@@ -216,6 +226,11 @@ static void sil_tune_pio(ide_drive_t *drive, u8 pio)
                if (pio > 2)
                        speedp |= 0x200;
                pci_write_config_word(hwif->pci_dev, tfaddr-2, speedp);
+
+               pci_read_config_byte(hwif->pci_dev, addr_mask, &mode);
+               mode &= ~(unit ? 0x30 : 0x03);
+               mode |= (unit ? 0x10 : 0x01);
+               pci_write_config_byte(hwif->pci_dev, addr_mask, mode);
        }
 }
 
@@ -275,8 +290,7 @@ static int siimage_tune_chipset(ide_drive_t *drive, const 
u8 speed)
                case XFER_PIO_1:
                case XFER_PIO_0:
                        sil_tune_pio(drive, speed - XFER_PIO_0);
-                       mode |= ((unit) ? 0x10 : 0x01);
-                       break;
+                       return ide_config_drive_speed(drive, speed);
                case XFER_MW_DMA_2:
                case XFER_MW_DMA_1:
                case XFER_MW_DMA_0:
-
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