aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-16 16:29:58 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-16 16:29:58 -0400
commitc223701cf6c706f42840631c1ca919a18e6e2800 (patch)
tree0ae93a4a36e874d5e1378e5e2d032a81e71350f7
parent9ff6f72f432364991d68e99cae72cb141c166e70 (diff)
ide: add "hdx=nodma" kernel parameter
* 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>
-rw-r--r--Documentation/ide.txt4
-rw-r--r--drivers/ide/ide-dma.c2
-rw-r--r--drivers/ide/ide.c7
-rw-r--r--include/linux/ide.h1
4 files changed, 9 insertions, 5 deletions
diff --git a/Documentation/ide.txt b/Documentation/ide.txt
index c1640e306c53..1d50f23a5cab 100644
--- a/Documentation/ide.txt
+++ b/Documentation/ide.txt
@@ -242,6 +242,8 @@ Summary of ide driver parameters for kernel command line
242 and quite likely to cause trouble with 242 and quite likely to cause trouble with
243 older/odd IDE drives. 243 older/odd IDE drives.
244 244
245 "hdx=nodma" : disallow DMA
246
245 "hdx=swapdata" : when the drive is a disk, byte swap all data 247 "hdx=swapdata" : when the drive is a disk, byte swap all data
246 248
247 "hdx=bswap" : same as above.......... 249 "hdx=bswap" : same as above..........
@@ -286,8 +288,6 @@ Summary of ide driver parameters for kernel command line
286 288
287 "ide=reverse" : formerly called to pci sub-system, but now local. 289 "ide=reverse" : formerly called to pci sub-system, but now local.
288 290
289 "ide=nodma" : disable DMA globally for the IDE subsystem.
290
291The following are valid ONLY on ide0, which usually corresponds 291The following are valid ONLY on ide0, which usually corresponds
292to the first ATA interface found on the particular host, and the defaults for 292to the first ATA interface found on the particular host, and the defaults for
293the base,ctl ports must not be altered. 293the base,ctl ports must not be altered.
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 45fa1ef29d2c..bc57ce6bf0b3 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -759,7 +759,7 @@ static int ide_tune_dma(ide_drive_t *drive)
759{ 759{
760 u8 speed; 760 u8 speed;
761 761
762 if (noautodma || (drive->id->capability & 1) == 0) 762 if (noautodma || drive->nodma || (drive->id->capability & 1) == 0)
763 return 0; 763 return 0;
764 764
765 /* consult the list of known "bad" drives */ 765 /* consult the list of known "bad" drives */
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 27c4fe250701..5b090662683e 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1272,7 +1272,7 @@ static int __init ide_setup(char *s)
1272 if (!strcmp(s, "ide=nodma")) { 1272 if (!strcmp(s, "ide=nodma")) {
1273 printk(" : Prevented DMA\n"); 1273 printk(" : Prevented DMA\n");
1274 noautodma = 1; 1274 noautodma = 1;
1275 return 1; 1275 goto obsolete_option;
1276 } 1276 }
1277 1277
1278#ifdef CONFIG_IDEPCI_PCIBUS_ORDER 1278#ifdef CONFIG_IDEPCI_PCIBUS_ORDER
@@ -1306,7 +1306,7 @@ static int __init ide_setup(char *s)
1306 */ 1306 */
1307 if (s[0] == 'h' && s[1] == 'd' && s[2] >= 'a' && s[2] <= max_drive) { 1307 if (s[0] == 'h' && s[1] == 'd' && s[2] >= 'a' && s[2] <= max_drive) {
1308 const char *hd_words[] = { 1308 const char *hd_words[] = {
1309 "none", "noprobe", "nowerr", "cdrom", "minus5", 1309 "none", "noprobe", "nowerr", "cdrom", "nodma",
1310 "autotune", "noautotune", "minus8", "swapdata", "bswap", 1310 "autotune", "noautotune", "minus8", "swapdata", "bswap",
1311 "noflush", "remap", "remap63", "scsi", NULL }; 1311 "noflush", "remap", "remap63", "scsi", NULL };
1312 unit = s[2] - 'a'; 1312 unit = s[2] - 'a';
@@ -1334,6 +1334,9 @@ static int __init ide_setup(char *s)
1334 drive->ready_stat = 0; 1334 drive->ready_stat = 0;
1335 hwif->noprobe = 0; 1335 hwif->noprobe = 0;
1336 goto done; 1336 goto done;
1337 case -5: /* nodma */
1338 drive->nodma = 1;
1339 goto done;
1337 case -6: /* "autotune" */ 1340 case -6: /* "autotune" */
1338 drive->autotune = IDE_TUNE_AUTO; 1341 drive->autotune = IDE_TUNE_AUTO;
1339 goto obsolete_option; 1342 goto obsolete_option;
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 79652c5c0ea5..e39ee2fa2607 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -599,6 +599,7 @@ typedef struct ide_drive_s {
599 unsigned nice0 : 1; /* give obvious excess bandwidth */ 599 unsigned nice0 : 1; /* give obvious excess bandwidth */
600 unsigned nice2 : 1; /* give a share in our own bandwidth */ 600 unsigned nice2 : 1; /* give a share in our own bandwidth */
601 unsigned doorlocking : 1; /* for removable only: door lock/unlock works */ 601 unsigned doorlocking : 1; /* for removable only: door lock/unlock works */
602 unsigned nodma : 1; /* disallow DMA */
602 unsigned autotune : 2; /* 0=default, 1=autotune, 2=noautotune */ 603 unsigned autotune : 2; /* 0=default, 1=autotune, 2=noautotune */
603 unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ 604 unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */
604 unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ 605 unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */