Commit c223701cf6c706f42840631c1ca919a18e6e2800

Authored by Bartlomiej Zolnierkiewicz
1 parent 9ff6f72f43

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>

Showing 4 changed files with 9 additions and 5 deletions Side-by-side Diff

Documentation/ide.txt
... ... @@ -242,6 +242,8 @@
242 242 and quite likely to cause trouble with
243 243 older/odd IDE drives.
244 244  
  245 + "hdx=nodma" : disallow DMA
  246 +
245 247 "hdx=swapdata" : when the drive is a disk, byte swap all data
246 248  
247 249 "hdx=bswap" : same as above..........
... ... @@ -285,8 +287,6 @@
285 287 unknown.
286 288  
287 289 "ide=reverse" : formerly called to pci sub-system, but now local.
288   -
289   - "ide=nodma" : disable DMA globally for the IDE subsystem.
290 290  
291 291 The following are valid ONLY on ide0, which usually corresponds
292 292 to the first ATA interface found on the particular host, and the defaults for
drivers/ide/ide-dma.c
... ... @@ -759,7 +759,7 @@
759 759 {
760 760 u8 speed;
761 761  
762   - if (noautodma || (drive->id->capability & 1) == 0)
  762 + if (noautodma || drive->nodma || (drive->id->capability & 1) == 0)
763 763 return 0;
764 764  
765 765 /* consult the list of known "bad" drives */
... ... @@ -1272,7 +1272,7 @@
1272 1272 if (!strcmp(s, "ide=nodma")) {
1273 1273 printk(" : Prevented DMA\n");
1274 1274 noautodma = 1;
1275   - return 1;
  1275 + goto obsolete_option;
1276 1276 }
1277 1277  
1278 1278 #ifdef CONFIG_IDEPCI_PCIBUS_ORDER
... ... @@ -1306,7 +1306,7 @@
1306 1306 */
1307 1307 if (s[0] == 'h' && s[1] == 'd' && s[2] >= 'a' && s[2] <= max_drive) {
1308 1308 const char *hd_words[] = {
1309   - "none", "noprobe", "nowerr", "cdrom", "minus5",
  1309 + "none", "noprobe", "nowerr", "cdrom", "nodma",
1310 1310 "autotune", "noautotune", "minus8", "swapdata", "bswap",
1311 1311 "noflush", "remap", "remap63", "scsi", NULL };
1312 1312 unit = s[2] - 'a';
... ... @@ -1333,6 +1333,9 @@
1333 1333 /* an ATAPI device ignores DRDY */
1334 1334 drive->ready_stat = 0;
1335 1335 hwif->noprobe = 0;
  1336 + goto done;
  1337 + case -5: /* nodma */
  1338 + drive->nodma = 1;
1336 1339 goto done;
1337 1340 case -6: /* "autotune" */
1338 1341 drive->autotune = IDE_TUNE_AUTO;
... ... @@ -599,6 +599,7 @@
599 599 unsigned nice0 : 1; /* give obvious excess bandwidth */
600 600 unsigned nice2 : 1; /* give a share in our own bandwidth */
601 601 unsigned doorlocking : 1; /* for removable only: door lock/unlock works */
  602 + unsigned nodma : 1; /* disallow DMA */
602 603 unsigned autotune : 2; /* 0=default, 1=autotune, 2=noautotune */
603 604 unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */
604 605 unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */