Skip to content

Commit 0af80c0

Browse files
dfriesbzolnier
authored andcommitted
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>
1 parent c15d8a6 commit 0af80c0

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

‎Documentation/kernel-parameters.txt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -868,8 +868,10 @@ and is between 256 and 4096 characters. It is defined in the file
868868
icn= [HW,ISDN]
869869
Format: <io>[,<membase>[,<icn_id>[,<icn_id2>]]]
870870

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
873875
See Documentation/ide/ide.txt.
874876

875877
idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed

‎drivers/ide/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ menuconfig IDE
4646
SMART parameters from disk drives.
4747

4848
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.
5050

5151
For further information, please read <file:Documentation/ide/ide.txt>.
5252

‎drivers/ide/ide.c‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ static int ide_set_dev_param_mask(const char *s, struct kernel_param *kp)
337337
int a, b, i, j = 1;
338338
unsigned int *dev_param_mask = (unsigned int *)kp->arg;
339339

340+
/* controller . device (0 or 1) [ : 1 (set) | 0 (clear) ] */
340341
if (sscanf(s, "%d.%d:%d", &a, &b, &j) != 3 &&
341342
sscanf(s, "%d.%d", &a, &b) != 2)
342343
return -EINVAL;
@@ -349,7 +350,7 @@ static int ide_set_dev_param_mask(const char *s, struct kernel_param *kp)
349350
if (j)
350351
*dev_param_mask |= (1 << i);
351352
else
352-
*dev_param_mask &= (1 << i);
353+
*dev_param_mask &= ~(1 << i);
353354

354355
return 0;
355356
}
@@ -392,6 +393,8 @@ static int ide_set_disk_chs(const char *str, struct kernel_param *kp)
392393
{
393394
int a, b, c = 0, h = 0, s = 0, i, j = 1;
394395

396+
/* controller . device (0 or 1) : Cylinders , Heads , Sectors */
397+
/* controller . device (0 or 1) : 1 (use CHS) | 0 (ignore CHS) */
395398
if (sscanf(str, "%d.%d:%d,%d,%d", &a, &b, &c, &h, &s) != 5 &&
396399
sscanf(str, "%d.%d:%d", &a, &b, &j) != 3)
397400
return -EINVAL;
@@ -407,7 +410,7 @@ static int ide_set_disk_chs(const char *str, struct kernel_param *kp)
407410
if (j)
408411
ide_disks |= (1 << i);
409412
else
410-
ide_disks &= (1 << i);
413+
ide_disks &= ~(1 << i);
411414

412415
ide_disks_chs[i].cyl = c;
413416
ide_disks_chs[i].head = h;
@@ -469,6 +472,8 @@ static int ide_set_ignore_cable(const char *s, struct kernel_param *kp)
469472
{
470473
int i, j = 1;
471474

475+
/* controller (ignore) */
476+
/* controller : 1 (ignore) | 0 (use) */
472477
if (sscanf(s, "%d:%d", &i, &j) != 2 && sscanf(s, "%d", &i) != 1)
473478
return -EINVAL;
474479

@@ -478,7 +483,7 @@ static int ide_set_ignore_cable(const char *s, struct kernel_param *kp)
478483
if (j)
479484
ide_ignore_cable |= (1 << i);
480485
else
481-
ide_ignore_cable &= (1 << i);
486+
ide_ignore_cable &= ~(1 << i);
482487

483488
return 0;
484489
}

0 commit comments

Comments
 (0)