Commit:     6f5050a96c9e0521f42a3a1d676c7ad9815f62ad
Parent:     a1067db8ebae6817a66fd4e40e34699f402c2544
Author:     Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Mar 17 21:57:39 2007 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Mar 17 21:57:39 2007 +0100

    ide: don't allow DMA to be enabled if CONFIG_IDEDMA_{ICS,PCI}_AUTO=n
    For CONFIG_IDEDMA_{ICS,PCI}_AUTO=n and/or "ide=nodma" option the host/device
    are not programmed for DMA and it is also explicitly disabled by 
    (->ide_dma_check returns "-1").  However the code responsible for manually
    enabling DMA ("hdparm -d 1") has a bug which results in DMA being 
    enabled - ide_set_dma() incorrectly passes "0" return value to 
    This may work if BIOS/firmware configured the host/device for DMA and 
    allows independent configuration of DMA/PIO modes but won't work after 
    and is generally unsafe on many chipsets (possibly including data corruption
    if the same registers are used for DMA/PIO timings).
    This patch fixes kernel bugzilla bug #8169 (piix host driver fixes for
    setting PIO mode exposed the problem described above).  The side-effect of
    the fix is that some rare configuration may be forced to PIO mode when DMA
    mode was previously used - this is addressed by the next patch which removes
    CONFIG_IDEDMA_{PCI,ICS}_AUTO config option completely.
    Thanks goes out to Patrick Horn for reporting the issue, narrowing it down
    to the specific commit and testing the fix.  Also thanks to Sergei Shtylyov
    for help in debugging the problem.
    Cc: Patrick Horn <[EMAIL PROTECTED]>
    Cc: Sergei Shtylyov <[EMAIL PROTECTED]>
    Cc: Russell King <[EMAIL PROTECTED]>
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
 drivers/ide/ide-dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 08e7cd0..fd21308 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -767,7 +767,7 @@ int ide_set_dma(ide_drive_t *drive)
        switch(rc) {
        case -1: /* DMA needs to be disabled */
-               return 0;
+               return -1;
        case  0: /* DMA needs to be enabled */
                return hwif->ide_dma_on(drive);
        case  1: /* DMA setting cannot be changed */
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

Reply via email to