Commit 0af80c04e2f2e45ae09fceb17df8050f828a5c40

Authored by David Fries
Committed by Bartlomiej Zolnierkiewicz
1 parent c15d8a6499

ide: ide.c 'clear' fix, update "ide=nodma" documentation

Documentation/kernel-parameters.txt
- ide=nodma is no longer valid.

drivers/ide/Kconfig
- The module is ide-core.ko not ide.

drivers/ide/ide.c
- It took me a while to figure out what the arguments %d.%d:%d to nodma
  module parameter ment, so I added a comment to each.
- Added a comment to each of the sscanf lines.
- There is a bug, if j is 0 it would previously clear all the other bits
  except the current device, changed in three different places.
  mask &= (1 << i) should be mask &= ~(1 << i).

Signed-off-by: David Fries <david@fries.net>
[bart: s/disk/device/ in ide.c, beautify patch description]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Showing 3 changed files with 13 additions and 6 deletions Side-by-side Diff

Documentation/kernel-parameters.txt
... ... @@ -868,8 +868,10 @@
868 868 icn= [HW,ISDN]
869 869 Format: <io>[,<membase>[,<icn_id>[,<icn_id2>]]]
870 870  
871   - ide= [HW] (E)IDE subsystem
872   - Format: ide=nodma or ide=doubler
  871 + ide-core.nodma= [HW] (E)IDE subsystem
  872 + Format: =0.0 to prevent dma on hda, =0.1 hdb =1.0 hdc
  873 + .vlb_clock .pci_clock .noflush .noprobe .nowerr .cdrom
  874 + .chs .ignore_cable are additional options
873 875 See Documentation/ide/ide.txt.
874 876  
875 877 idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed
... ... @@ -46,7 +46,7 @@
46 46 SMART parameters from disk drives.
47 47  
48 48 To compile this driver as a module, choose M here: the
49   - module will be called ide.
  49 + module will be called ide-core.ko.
50 50  
51 51 For further information, please read <file:Documentation/ide/ide.txt>.
52 52  
... ... @@ -337,6 +337,7 @@
337 337 int a, b, i, j = 1;
338 338 unsigned int *dev_param_mask = (unsigned int *)kp->arg;
339 339  
  340 + /* controller . device (0 or 1) [ : 1 (set) | 0 (clear) ] */
340 341 if (sscanf(s, "%d.%d:%d", &a, &b, &j) != 3 &&
341 342 sscanf(s, "%d.%d", &a, &b) != 2)
342 343 return -EINVAL;
... ... @@ -349,7 +350,7 @@
349 350 if (j)
350 351 *dev_param_mask |= (1 << i);
351 352 else
352   - *dev_param_mask &= (1 << i);
  353 + *dev_param_mask &= ~(1 << i);
353 354  
354 355 return 0;
355 356 }
... ... @@ -392,6 +393,8 @@
392 393 {
393 394 int a, b, c = 0, h = 0, s = 0, i, j = 1;
394 395  
  396 + /* controller . device (0 or 1) : Cylinders , Heads , Sectors */
  397 + /* controller . device (0 or 1) : 1 (use CHS) | 0 (ignore CHS) */
395 398 if (sscanf(str, "%d.%d:%d,%d,%d", &a, &b, &c, &h, &s) != 5 &&
396 399 sscanf(str, "%d.%d:%d", &a, &b, &j) != 3)
397 400 return -EINVAL;
... ... @@ -407,7 +410,7 @@
407 410 if (j)
408 411 ide_disks |= (1 << i);
409 412 else
410   - ide_disks &= (1 << i);
  413 + ide_disks &= ~(1 << i);
411 414  
412 415 ide_disks_chs[i].cyl = c;
413 416 ide_disks_chs[i].head = h;
... ... @@ -469,6 +472,8 @@
469 472 {
470 473 int i, j = 1;
471 474  
  475 + /* controller (ignore) */
  476 + /* controller : 1 (ignore) | 0 (use) */
472 477 if (sscanf(s, "%d:%d", &i, &j) != 2 && sscanf(s, "%d", &i) != 1)
473 478 return -EINVAL;
474 479  
... ... @@ -478,7 +483,7 @@
478 483 if (j)
479 484 ide_ignore_cable |= (1 << i);
480 485 else
481   - ide_ignore_cable &= (1 << i);
  486 + ide_ignore_cable &= ~(1 << i);
482 487  
483 488 return 0;
484 489 }