aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-27 09:38:30 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-27 09:38:30 -0400
commit6e87543a94fb2a966c81a61fc91246592f9719da (patch)
treea402e8e5fae4b1e9d9a8535d89d8c1255c574eaa /drivers
parent207daeaabb5396995ebac63415fab71476b64ca3 (diff)
ide: add "nodma|noflush|noprobe|nowerr=" parameters
* Add "nodma|noflush|noprobe|nowerr=" parameters. * Obsolete "hdx=noprobe|none|nowerr|nodma|noflush" kernel parameters. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide.c79
1 files changed, 75 insertions, 4 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 71fa37979215..d8f40ee74ce8 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -915,10 +915,10 @@ static int __init ide_setup(char *s)
915 case -1: /* "none" */ 915 case -1: /* "none" */
916 case -2: /* "noprobe" */ 916 case -2: /* "noprobe" */
917 drive->noprobe = 1; 917 drive->noprobe = 1;
918 goto done; 918 goto obsolete_option;
919 case -3: /* "nowerr" */ 919 case -3: /* "nowerr" */
920 drive->bad_wstat = BAD_R_STAT; 920 drive->bad_wstat = BAD_R_STAT;
921 goto done; 921 goto obsolete_option;
922 case -4: /* "cdrom" */ 922 case -4: /* "cdrom" */
923 drive->present = 1; 923 drive->present = 1;
924 drive->media = ide_cdrom; 924 drive->media = ide_cdrom;
@@ -927,10 +927,10 @@ static int __init ide_setup(char *s)
927 goto done; 927 goto done;
928 case -5: /* nodma */ 928 case -5: /* nodma */
929 drive->nodma = 1; 929 drive->nodma = 1;
930 goto done; 930 goto obsolete_option;
931 case -11: /* noflush */ 931 case -11: /* noflush */
932 drive->noflush = 1; 932 drive->noflush = 1;
933 goto done; 933 goto obsolete_option;
934 case -12: /* "remap" */ 934 case -12: /* "remap" */
935 drive->remap_0_to_1 = 1; 935 drive->remap_0_to_1 = 1;
936 goto obsolete_option; 936 goto obsolete_option;
@@ -1125,6 +1125,72 @@ EXPORT_SYMBOL_GPL(ide_pci_clk);
1125module_param_named(pci_clock, ide_pci_clk, int, 0); 1125module_param_named(pci_clock, ide_pci_clk, int, 0);
1126MODULE_PARM_DESC(pci_clock, "PCI bus clock frequency (in MHz)"); 1126MODULE_PARM_DESC(pci_clock, "PCI bus clock frequency (in MHz)");
1127 1127
1128static int ide_set_dev_param_mask(const char *s, struct kernel_param *kp)
1129{
1130 int a, b, i, j = 1;
1131 unsigned int *dev_param_mask = (unsigned int *)kp->arg;
1132
1133 if (sscanf(s, "%d.%d:%d", &a, &b, &j) != 3 &&
1134 sscanf(s, "%d.%d", &a, &b) != 2)
1135 return -EINVAL;
1136
1137 i = a * MAX_DRIVES + b;
1138
1139 if (i >= MAX_HWIFS * MAX_DRIVES || j < 0 || j > 1)
1140 return -EINVAL;
1141
1142 if (j)
1143 *dev_param_mask |= (1 << i);
1144 else
1145 *dev_param_mask &= (1 << i);
1146
1147 return 0;
1148}
1149
1150static unsigned int ide_nodma;
1151
1152module_param_call(nodma, ide_set_dev_param_mask, NULL, &ide_nodma, 0);
1153MODULE_PARM_DESC(nodma, "disallow DMA for a device");
1154
1155static unsigned int ide_noflush;
1156
1157module_param_call(noflush, ide_set_dev_param_mask, NULL, &ide_noflush, 0);
1158MODULE_PARM_DESC(noflush, "disable flush requests for a device");
1159
1160static unsigned int ide_noprobe;
1161
1162module_param_call(noprobe, ide_set_dev_param_mask, NULL, &ide_noprobe, 0);
1163MODULE_PARM_DESC(noprobe, "skip probing for a device");
1164
1165static unsigned int ide_nowerr;
1166
1167module_param_call(nowerr, ide_set_dev_param_mask, NULL, &ide_nowerr, 0);
1168MODULE_PARM_DESC(nowerr, "ignore the WRERR_STAT bit for a device");
1169
1170static void ide_dev_apply_params(ide_drive_t *drive)
1171{
1172 int i = drive->hwif->index * MAX_DRIVES + drive->select.b.unit;
1173
1174 if (ide_nodma & (1 << i)) {
1175 printk(KERN_INFO "ide: disallowing DMA for %s\n", drive->name);
1176 drive->nodma = 1;
1177 }
1178 if (ide_noflush & (1 << i)) {
1179 printk(KERN_INFO "ide: disabling flush requests for %s\n",
1180 drive->name);
1181 drive->noflush = 1;
1182 }
1183 if (ide_noprobe & (1 << i)) {
1184 printk(KERN_INFO "ide: skipping probe for %s\n", drive->name);
1185 drive->noprobe = 1;
1186 }
1187 if (ide_nowerr & (1 << i)) {
1188 printk(KERN_INFO "ide: ignoring the WRERR_STAT bit for %s\n",
1189 drive->name);
1190 drive->bad_wstat = BAD_R_STAT;
1191 }
1192}
1193
1128static unsigned int ide_ignore_cable; 1194static unsigned int ide_ignore_cable;
1129 1195
1130static int ide_set_ignore_cable(const char *s, struct kernel_param *kp) 1196static int ide_set_ignore_cable(const char *s, struct kernel_param *kp)
@@ -1150,11 +1216,16 @@ MODULE_PARM_DESC(ignore_cable, "ignore cable detection");
1150 1216
1151void ide_port_apply_params(ide_hwif_t *hwif) 1217void ide_port_apply_params(ide_hwif_t *hwif)
1152{ 1218{
1219 int i;
1220
1153 if (ide_ignore_cable & (1 << hwif->index)) { 1221 if (ide_ignore_cable & (1 << hwif->index)) {
1154 printk(KERN_INFO "ide: ignoring cable detection for %s\n", 1222 printk(KERN_INFO "ide: ignoring cable detection for %s\n",
1155 hwif->name); 1223 hwif->name);
1156 hwif->cbl = ATA_CBL_PATA40_SHORT; 1224 hwif->cbl = ATA_CBL_PATA40_SHORT;
1157 } 1225 }
1226
1227 for (i = 0; i < MAX_DRIVES; i++)
1228 ide_dev_apply_params(&hwif->drives[i]);
1158} 1229}
1159 1230
1160/* 1231/*