Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=254bb5503611da57240ed6df1cfe6d7f0f185027
Commit:     254bb5503611da57240ed6df1cfe6d7f0f185027
Parent:     aedea5910ce44fea79e2c517bb22e0006372156f
Author:     Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 13 17:47:50 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Oct 13 17:47:50 2007 +0200

    ide-pmac: use ide_tune_dma() (take 2)
    
    * Add missing initialization of hwif->autodma and drive->autodma to
      pmac_ide_setup_dma().
    
    * Use ide_tune_dma() in pmac_ide_dma_check().
    
    While at it:
    
    * Fix pmac_ide_dma_check() return value if DMA mode is not programmed
      (should be "-1" otherwise ide_set_dma() will try to enable DMA).
    
    * Remove unnecessary drive->using_dma fiddling (->dma_off_quietly is always
      called before ide_set_dma() call and ide_set_dma() calls ->ide_dma_on if
      ->ide_dma_check returns "0").
    
    v2:
    * No reason to blacklist all ide_floppy devices and the old code was always
      enabling DMA anyway (without even programming controller/device if the
      device was ide_floppy).
    
    Cc: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ppc/pmac.c |   25 +++++++------------------
 1 files changed, 7 insertions(+), 18 deletions(-)

diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index 24f7329..a1d24cd 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1593,24 +1593,10 @@ pmac_ide_destroy_dmatable (ide_drive_t *drive)
 static int
 pmac_ide_dma_check(ide_drive_t *drive)
 {
-       int enable = 1;
+       if (ide_tune_dma(drive))
+               return 0;
 
-       drive->using_dma = 0;
-       
-       if (drive->media == ide_floppy)
-               enable = 0;
-       if ((drive->id->capability & 1) == 0 && !__ide_dma_good_drive(drive))
-               enable = 0;
-       if (__ide_dma_bad_drive(drive))
-               enable = 0;
-
-       if (enable) {
-               u8 mode = ide_max_dma_mode(drive);
-
-               if (mode && pmac_ide_tune_chipset(drive, mode) == 0)
-                       drive->using_dma = 1;
-       }
-       return 0;
+       return -1;
 }
 
 /*
@@ -1844,7 +1830,10 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t 
*hwif)
                        hwif->mwdma_mask = 0x07;
                        hwif->swdma_mask = 0x00;
                        break;
-       }       
+       }
+
+       hwif->autodma = 1;
+       hwif->drives[1].autodma = hwif->drives[0].autodma = hwif->autodma;
 }
 
 #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
-
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