Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8446f65988b48d19cf419aa4def9a9ccfed17b76
Commit:     8446f65988b48d19cf419aa4def9a9ccfed17b76
Parent:     8c91abf86280a1b900619ee0d8ae1840e943110e
Author:     Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 22:29:54 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 22:29:54 2007 +0200

    au1xxx-ide: use ide_tune_dma()
    
    * Remove needless setting of drive->using_dma from auide_dma_check().
    
    * Split off auide_mdma_filter() from auide_dma_check().
    
    * Use ide_tune_dma() in auide_dma_check(), this fixes following issues:
      - device's DMA capability bit not being checked
      - device not being checked against generic DMA blacklist
      - transfer mode not being set on device/host
    
    * Add PIO autotune fallback to auide_dma_check().
    
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/mips/au1xxx-ide.c |   36 ++++++++++++++++++++++--------------
 1 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index 892d08f..1c47329 100644
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -351,11 +351,18 @@ static int auide_dma_setup(ide_drive_t *drive)
        return 0;
 }
 
-static int auide_dma_check(ide_drive_t *drive)
+static u8 auide_mdma_filter(ide_drive_t *drive)
 {
-       u8 speed = ide_max_dma_mode(drive);
+       /*
+        * FIXME: ->white_list and ->black_list are based on completely bogus
+        * ->ide_dma_check implementation which didn't set neither the host
+        * controller timings nor the device for the desired transfer mode.
+        *
+        * They should be either removed or 0x00 MWDMA mask should be
+        * returned for devices on the ->black_list.
+        */
 
-       if( dbdma_init_done == 0 ){
+       if (dbdma_init_done == 0) {
                auide_hwif.white_list = ide_in_drive_list(drive->id,
                                                          dma_white_list);
                auide_hwif.black_list = ide_in_drive_list(drive->id,
@@ -366,21 +373,20 @@ static int auide_dma_check(ide_drive_t *drive)
        }
 
        /* Is the drive in our DMA black list? */
-
-       if ( auide_hwif.black_list ) {
-               drive->using_dma = 0;
-
-               /* Borrowed the warning message from ide-dma.c */
-
+       if (auide_hwif.black_list)
                printk(KERN_WARNING "%s: Disabling DMA for %s (blacklisted)\n",
-                      drive->name, drive->id->model);         
-       }
-       else
-               drive->using_dma = 1;
+                                   drive->name, drive->id->model);
 
-       if (drive->autodma && (speed & XFER_MODE) != XFER_PIO)
+       return drive->hwif->mwdma_mask;
+}
+
+static int auide_dma_check(ide_drive_t *drive)
+{
+       if (ide_tune_dma(drive))
                return 0;
 
+       ide_set_max_pio(drive);
+
        return -1;
 }
 
@@ -692,6 +698,8 @@ static int au_ide_probe(struct device *dev)
        hwif->dma_off_quietly           = &auide_dma_off_quietly;
        hwif->dma_timeout               = &auide_dma_timeout;
 
+       hwif->mdma_filter               = &auide_mdma_filter;
+
        hwif->ide_dma_check             = &auide_dma_check;
        hwif->dma_exec_cmd              = &auide_dma_exec_cmd;
        hwif->dma_start                 = &auide_dma_start;
-
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