]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ide: add "hdx=nodma" kernel parameter
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 16 Oct 2007 20:29:58 +0000 (22:29 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 16 Oct 2007 20:29:58 +0000 (22:29 +0200)
* Add "hdx=nodma" option allowing user to disallow DMA for a given device.

* Obsolete "ide=nodma" option.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Documentation/ide.txt
drivers/ide/ide-dma.c
drivers/ide/ide.c
include/linux/ide.h

index c1640e306c53b200ebb992e28a9476aa8347c829..1d50f23a5cab092b237f09b21ff873f334224782 100644 (file)
@@ -242,6 +242,8 @@ Summary of ide driver parameters for kernel command line
                          and quite likely to cause trouble with
                          older/odd IDE drives.
 
+ "hdx=nodma"           : disallow DMA
+
  "hdx=swapdata"                : when the drive is a disk, byte swap all data
 
  "hdx=bswap"           : same as above..........
@@ -286,8 +288,6 @@ Summary of ide driver parameters for kernel command line
 
  "ide=reverse"         : formerly called to pci sub-system, but now local.
 
- "ide=nodma"           : disable DMA globally for the IDE subsystem.
-
 The following are valid ONLY on ide0, which usually corresponds
 to the first ATA interface found on the particular host, and the defaults for
 the base,ctl ports must not be altered.
index 45fa1ef29d2cbd57a260c23026571ea35919009a..bc57ce6bf0b3064ecdc76f9b55895e68988201f3 100644 (file)
@@ -759,7 +759,7 @@ static int ide_tune_dma(ide_drive_t *drive)
 {
        u8 speed;
 
-       if (noautodma || (drive->id->capability & 1) == 0)
+       if (noautodma || drive->nodma || (drive->id->capability & 1) == 0)
                return 0;
 
        /* consult the list of known "bad" drives */
index 27c4fe250701b0c8c234bd6db94af8cd629e8250..5b090662683ed25031b69e10593fc8582951c941 100644 (file)
@@ -1272,7 +1272,7 @@ static int __init ide_setup(char *s)
        if (!strcmp(s, "ide=nodma")) {
                printk(" : Prevented DMA\n");
                noautodma = 1;
-               return 1;
+               goto obsolete_option;
        }
 
 #ifdef CONFIG_IDEPCI_PCIBUS_ORDER
@@ -1306,7 +1306,7 @@ static int __init ide_setup(char *s)
         */
        if (s[0] == 'h' && s[1] == 'd' && s[2] >= 'a' && s[2] <= max_drive) {
                const char *hd_words[] = {
-                       "none", "noprobe", "nowerr", "cdrom", "minus5",
+                       "none", "noprobe", "nowerr", "cdrom", "nodma",
                        "autotune", "noautotune", "minus8", "swapdata", "bswap",
                        "noflush", "remap", "remap63", "scsi", NULL };
                unit = s[2] - 'a';
@@ -1334,6 +1334,9 @@ static int __init ide_setup(char *s)
                                drive->ready_stat = 0;
                                hwif->noprobe = 0;
                                goto done;
+                       case -5: /* nodma */
+                               drive->nodma = 1;
+                               goto done;
                        case -6: /* "autotune" */
                                drive->autotune = IDE_TUNE_AUTO;
                                goto obsolete_option;
index 79652c5c0ea5f84b57f588056783c03e88935a58..e39ee2fa260720a48236815c9ba6de334339de84 100644 (file)
@@ -599,6 +599,7 @@ typedef struct ide_drive_s {
        unsigned nice0          : 1;    /* give obvious excess bandwidth */
        unsigned nice2          : 1;    /* give a share in our own bandwidth */
        unsigned doorlocking    : 1;    /* for removable only: door lock/unlock works */
+       unsigned nodma          : 1;    /* disallow DMA */
        unsigned autotune       : 2;    /* 0=default, 1=autotune, 2=noautotune */
        unsigned remap_0_to_1   : 1;    /* 0=noremap, 1=remap 0->1 (for EZDrive) */
        unsigned blocked        : 1;    /* 1=powermanagment told us not to do anything, so sleep nicely */