diff options
-rw-r--r-- | Documentation/ide/ide.txt | 26 | ||||
-rw-r--r-- | drivers/ide/ide.c | 79 |
2 files changed, 88 insertions, 17 deletions
diff --git a/Documentation/ide/ide.txt b/Documentation/ide/ide.txt index 601e79ecef03..5bff93c89a23 100644 --- a/Documentation/ide/ide.txt +++ b/Documentation/ide/ide.txt | |||
@@ -99,10 +99,10 @@ with hd.c but not with ide.c), then an command line option may be specified | |||
99 | for each drive for which you'd like the drive to skip the hardware | 99 | for each drive for which you'd like the drive to skip the hardware |
100 | probe/identification sequence. For example: | 100 | probe/identification sequence. For example: |
101 | 101 | ||
102 | hdb=noprobe | 102 | ide_core.noprobe=0.1 |
103 | or | 103 | or |
104 | hdc=768,16,32 | 104 | hdc=768,16,32 |
105 | hdc=noprobe | 105 | ide_core.noprobe=1.0 |
106 | 106 | ||
107 | Note that when only one IDE device is attached to an interface, it should be | 107 | Note that when only one IDE device is attached to an interface, it should be |
108 | jumpered as "single" or "master", *not* "slave". Many folks have had | 108 | jumpered as "single" or "master", *not* "slave". Many folks have had |
@@ -174,9 +174,7 @@ to /etc/modprobe.conf. | |||
174 | 174 | ||
175 | When ide.c is used as a module, you can pass command line parameters to the | 175 | When ide.c is used as a module, you can pass command line parameters to the |
176 | driver using the "options=" keyword to insmod, while replacing any ',' with | 176 | driver using the "options=" keyword to insmod, while replacing any ',' with |
177 | ';'. For example: | 177 | ';'. |
178 | |||
179 | insmod ide.o options="hda=nodma hdb=nodma" | ||
180 | 178 | ||
181 | 179 | ||
182 | ================================================================================ | 180 | ================================================================================ |
@@ -186,18 +184,10 @@ Summary of ide driver parameters for kernel command line | |||
186 | 184 | ||
187 | "hdx=" is recognized for all "x" from "a" to "u", such as "hdc". | 185 | "hdx=" is recognized for all "x" from "a" to "u", such as "hdc". |
188 | 186 | ||
189 | "hdx=noprobe" : drive may be present, but do not probe for it | ||
190 | |||
191 | "hdx=none" : drive is NOT present, ignore cmos and do not probe | ||
192 | |||
193 | "hdx=nowerr" : ignore the WRERR_STAT bit on this drive | ||
194 | |||
195 | "hdx=cdrom" : drive is present, and is a cdrom drive | 187 | "hdx=cdrom" : drive is present, and is a cdrom drive |
196 | 188 | ||
197 | "hdx=cyl,head,sect" : disk drive is present, with specified geometry | 189 | "hdx=cyl,head,sect" : disk drive is present, with specified geometry |
198 | 190 | ||
199 | "hdx=nodma" : disallow DMA | ||
200 | |||
201 | "ide=doubler" : probe/support IDE doublers on Amiga | 191 | "ide=doubler" : probe/support IDE doublers on Amiga |
202 | 192 | ||
203 | There may be more options than shown -- use the source, Luke! | 193 | There may be more options than shown -- use the source, Luke! |
@@ -230,6 +220,16 @@ a case please report it as a bug instead) use "ignore_cable" kernel parameter: | |||
230 | * "ignore_cable=[interface_number]" module parameter (for ide_core module) | 220 | * "ignore_cable=[interface_number]" module parameter (for ide_core module) |
231 | if IDE is compiled as module | 221 | if IDE is compiled as module |
232 | 222 | ||
223 | Other kernel parameters for ide_core are: | ||
224 | |||
225 | * "nodma=[interface_number.device_number]" to disallow DMA for a device | ||
226 | |||
227 | * "noflush=[interface_number.device_number]" to disable flush requests | ||
228 | |||
229 | * "noprobe=[interface_number.device_number]" to skip probing | ||
230 | |||
231 | * "nowerr=[interface_number.device_number]" to ignore the WRERR_STAT bit | ||
232 | |||
233 | ================================================================================ | 233 | ================================================================================ |
234 | 234 | ||
235 | Some Terminology | 235 | Some Terminology |
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); | |||
1125 | module_param_named(pci_clock, ide_pci_clk, int, 0); | 1125 | module_param_named(pci_clock, ide_pci_clk, int, 0); |
1126 | MODULE_PARM_DESC(pci_clock, "PCI bus clock frequency (in MHz)"); | 1126 | MODULE_PARM_DESC(pci_clock, "PCI bus clock frequency (in MHz)"); |
1127 | 1127 | ||
1128 | static 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 | |||
1150 | static unsigned int ide_nodma; | ||
1151 | |||
1152 | module_param_call(nodma, ide_set_dev_param_mask, NULL, &ide_nodma, 0); | ||
1153 | MODULE_PARM_DESC(nodma, "disallow DMA for a device"); | ||
1154 | |||
1155 | static unsigned int ide_noflush; | ||
1156 | |||
1157 | module_param_call(noflush, ide_set_dev_param_mask, NULL, &ide_noflush, 0); | ||
1158 | MODULE_PARM_DESC(noflush, "disable flush requests for a device"); | ||
1159 | |||
1160 | static unsigned int ide_noprobe; | ||
1161 | |||
1162 | module_param_call(noprobe, ide_set_dev_param_mask, NULL, &ide_noprobe, 0); | ||
1163 | MODULE_PARM_DESC(noprobe, "skip probing for a device"); | ||
1164 | |||
1165 | static unsigned int ide_nowerr; | ||
1166 | |||
1167 | module_param_call(nowerr, ide_set_dev_param_mask, NULL, &ide_nowerr, 0); | ||
1168 | MODULE_PARM_DESC(nowerr, "ignore the WRERR_STAT bit for a device"); | ||
1169 | |||
1170 | static 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 | |||
1128 | static unsigned int ide_ignore_cable; | 1194 | static unsigned int ide_ignore_cable; |
1129 | 1195 | ||
1130 | static int ide_set_ignore_cable(const char *s, struct kernel_param *kp) | 1196 | static 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 | ||
1151 | void ide_port_apply_params(ide_hwif_t *hwif) | 1217 | void 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 | /* |