diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-03-03 11:48:55 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-03-03 11:48:55 -0500 |
commit | 849138827c962589ac50496fa7feeb2a2d51b467 (patch) | |
tree | 3b7988c756068f00ccf8a1440a0f3709a241bcad | |
parent | b6209a90eca8c9a464bf9c5b91741fb125185619 (diff) |
ide: make legacy IDE VLB modules check for the "probe" kernel params (v2)
Legacy IDE VLB host drivers didn't check for "probe" options when compiled
as modules, which was obviously wrong as we don't want module to poke at
random I/O ports by simply loading it. Fix it by adding "probe" module param
to legacy IDE VLB host drivers.
v2:
* don't obsolete old "ide0=dtc2278/ht6560b/qd65xx/ali14xx/umc8672"
IDE driver options yet (per Alan Cox's request) and enhance documentation
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | Documentation/ide.txt | 14 | ||||
-rw-r--r-- | drivers/ide/Kconfig | 10 | ||||
-rw-r--r-- | drivers/ide/ide.c | 10 | ||||
-rw-r--r-- | drivers/ide/legacy/ali14xx.c | 9 | ||||
-rw-r--r-- | drivers/ide/legacy/dtc2278.c | 12 | ||||
-rw-r--r-- | drivers/ide/legacy/ht6560b.c | 8 | ||||
-rw-r--r-- | drivers/ide/legacy/qd65xx.c | 8 | ||||
-rw-r--r-- | drivers/ide/legacy/umc8672.c | 15 |
8 files changed, 66 insertions, 20 deletions
diff --git a/Documentation/ide.txt b/Documentation/ide.txt index 82349f5cd3d7..3bb9f9c98611 100644 --- a/Documentation/ide.txt +++ b/Documentation/ide.txt | |||
@@ -294,13 +294,8 @@ The following are valid ONLY on ide0, which usually corresponds | |||
294 | to the first ATA interface found on the particular host, and the defaults for | 294 | to the first ATA interface found on the particular host, and the defaults for |
295 | the base,ctl ports must not be altered. | 295 | the base,ctl ports must not be altered. |
296 | 296 | ||
297 | "ide0=dtc2278" : probe/support DTC2278 interface | ||
298 | "ide0=ht6560b" : probe/support HT6560B interface | ||
299 | "ide0=cmd640_vlb" : *REQUIRED* for VLB cards with the CMD640 chip | 297 | "ide0=cmd640_vlb" : *REQUIRED* for VLB cards with the CMD640 chip |
300 | (not for PCI -- automatically detected) | 298 | (not for PCI -- automatically detected) |
301 | "ide0=qd65xx" : probe/support qd65xx interface | ||
302 | "ide0=ali14xx" : probe/support ali14xx chipsets (ALI M1439/M1443/M1445) | ||
303 | "ide0=umc8672" : probe/support umc8672 chipsets | ||
304 | 299 | ||
305 | "ide=doubler" : probe/support IDE doublers on Amiga | 300 | "ide=doubler" : probe/support IDE doublers on Amiga |
306 | 301 | ||
@@ -308,6 +303,15 @@ There may be more options than shown -- use the source, Luke! | |||
308 | 303 | ||
309 | Everything else is rejected with a "BAD OPTION" message. | 304 | Everything else is rejected with a "BAD OPTION" message. |
310 | 305 | ||
306 | For legacy IDE VLB host drivers (ali14xx/dtc2278/ht6560b/qd65xx/umc8672) | ||
307 | you need to explicitly enable probing by using "probe" kernel parameter, | ||
308 | i.e. to enable probing for ALI M14xx chipsets (ali14xx host driver) use: | ||
309 | |||
310 | * "ali14xx.probe" boot option when ali14xx driver is built-in the kernel | ||
311 | |||
312 | * "probe" module parameter when ali14xx driver is compiled as module | ||
313 | ("modprobe ali14xx probe") | ||
314 | |||
311 | ================================================================================ | 315 | ================================================================================ |
312 | 316 | ||
313 | IDE ATAPI streaming tape driver | 317 | IDE ATAPI streaming tape driver |
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 49234e32fd16..5d134bb75ba1 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -1023,7 +1023,7 @@ config BLK_DEV_4DRIVES | |||
1023 | config BLK_DEV_ALI14XX | 1023 | config BLK_DEV_ALI14XX |
1024 | tristate "ALI M14xx support" | 1024 | tristate "ALI M14xx support" |
1025 | help | 1025 | help |
1026 | This driver is enabled at runtime using the "ide0=ali14xx" kernel | 1026 | This driver is enabled at runtime using the "ali14xx.probe" kernel |
1027 | boot parameter. It enables support for the secondary IDE interface | 1027 | boot parameter. It enables support for the secondary IDE interface |
1028 | of the ALI M1439/1443/1445/1487/1489 chipsets, and permits faster | 1028 | of the ALI M1439/1443/1445/1487/1489 chipsets, and permits faster |
1029 | I/O speeds to be set as well. See the files | 1029 | I/O speeds to be set as well. See the files |
@@ -1033,7 +1033,7 @@ config BLK_DEV_ALI14XX | |||
1033 | config BLK_DEV_DTC2278 | 1033 | config BLK_DEV_DTC2278 |
1034 | tristate "DTC-2278 support" | 1034 | tristate "DTC-2278 support" |
1035 | help | 1035 | help |
1036 | This driver is enabled at runtime using the "ide0=dtc2278" kernel | 1036 | This driver is enabled at runtime using the "dtc2278.probe" kernel |
1037 | boot parameter. It enables support for the secondary IDE interface | 1037 | boot parameter. It enables support for the secondary IDE interface |
1038 | of the DTC-2278 card, and permits faster I/O speeds to be set as | 1038 | of the DTC-2278 card, and permits faster I/O speeds to be set as |
1039 | well. See the <file:Documentation/ide.txt> and | 1039 | well. See the <file:Documentation/ide.txt> and |
@@ -1042,7 +1042,7 @@ config BLK_DEV_DTC2278 | |||
1042 | config BLK_DEV_HT6560B | 1042 | config BLK_DEV_HT6560B |
1043 | tristate "Holtek HT6560B support" | 1043 | tristate "Holtek HT6560B support" |
1044 | help | 1044 | help |
1045 | This driver is enabled at runtime using the "ide0=ht6560b" kernel | 1045 | This driver is enabled at runtime using the "ht6560b.probe" kernel |
1046 | boot parameter. It enables support for the secondary IDE interface | 1046 | boot parameter. It enables support for the secondary IDE interface |
1047 | of the Holtek card, and permits faster I/O speeds to be set as well. | 1047 | of the Holtek card, and permits faster I/O speeds to be set as well. |
1048 | See the <file:Documentation/ide.txt> and | 1048 | See the <file:Documentation/ide.txt> and |
@@ -1051,7 +1051,7 @@ config BLK_DEV_HT6560B | |||
1051 | config BLK_DEV_QD65XX | 1051 | config BLK_DEV_QD65XX |
1052 | tristate "QDI QD65xx support" | 1052 | tristate "QDI QD65xx support" |
1053 | help | 1053 | help |
1054 | This driver is enabled at runtime using the "ide0=qd65xx" kernel | 1054 | This driver is enabled at runtime using the "qd65xx.probe" kernel |
1055 | boot parameter. It permits faster I/O speeds to be set. See the | 1055 | boot parameter. It permits faster I/O speeds to be set. See the |
1056 | <file:Documentation/ide.txt> and <file:drivers/ide/legacy/qd65xx.c> for | 1056 | <file:Documentation/ide.txt> and <file:drivers/ide/legacy/qd65xx.c> for |
1057 | more info. | 1057 | more info. |
@@ -1059,7 +1059,7 @@ config BLK_DEV_QD65XX | |||
1059 | config BLK_DEV_UMC8672 | 1059 | config BLK_DEV_UMC8672 |
1060 | tristate "UMC-8672 support" | 1060 | tristate "UMC-8672 support" |
1061 | help | 1061 | help |
1062 | This driver is enabled at runtime using the "ide0=umc8672" kernel | 1062 | This driver is enabled at runtime using the "umc8672.probe" kernel |
1063 | boot parameter. It enables support for the secondary IDE interface | 1063 | boot parameter. It enables support for the secondary IDE interface |
1064 | of the UMC-8672, and permits faster I/O speeds to be set as well. | 1064 | of the UMC-8672, and permits faster I/O speeds to be set as well. |
1065 | See the files <file:Documentation/ide.txt> and | 1065 | See the files <file:Documentation/ide.txt> and |
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index ac1a720f182a..dfbd74458522 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -1484,23 +1484,23 @@ static int __init match_parm (char *s, const char *keywords[], int vals[], int m | |||
1484 | } | 1484 | } |
1485 | 1485 | ||
1486 | #ifdef CONFIG_BLK_DEV_ALI14XX | 1486 | #ifdef CONFIG_BLK_DEV_ALI14XX |
1487 | static int __initdata probe_ali14xx; | 1487 | extern int probe_ali14xx; |
1488 | extern int ali14xx_init(void); | 1488 | extern int ali14xx_init(void); |
1489 | #endif | 1489 | #endif |
1490 | #ifdef CONFIG_BLK_DEV_UMC8672 | 1490 | #ifdef CONFIG_BLK_DEV_UMC8672 |
1491 | static int __initdata probe_umc8672; | 1491 | extern int probe_umc8672; |
1492 | extern int umc8672_init(void); | 1492 | extern int umc8672_init(void); |
1493 | #endif | 1493 | #endif |
1494 | #ifdef CONFIG_BLK_DEV_DTC2278 | 1494 | #ifdef CONFIG_BLK_DEV_DTC2278 |
1495 | static int __initdata probe_dtc2278; | 1495 | extern int probe_dtc2278; |
1496 | extern int dtc2278_init(void); | 1496 | extern int dtc2278_init(void); |
1497 | #endif | 1497 | #endif |
1498 | #ifdef CONFIG_BLK_DEV_HT6560B | 1498 | #ifdef CONFIG_BLK_DEV_HT6560B |
1499 | static int __initdata probe_ht6560b; | 1499 | extern int probe_ht6560b; |
1500 | extern int ht6560b_init(void); | 1500 | extern int ht6560b_init(void); |
1501 | #endif | 1501 | #endif |
1502 | #ifdef CONFIG_BLK_DEV_QD65XX | 1502 | #ifdef CONFIG_BLK_DEV_QD65XX |
1503 | static int __initdata probe_qd65xx; | 1503 | extern int probe_qd65xx; |
1504 | extern int qd65xx_init(void); | 1504 | extern int qd65xx_init(void); |
1505 | #endif | 1505 | #endif |
1506 | 1506 | ||
diff --git a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c index f9f5b8d54d6d..91961aa03047 100644 --- a/drivers/ide/legacy/ali14xx.c +++ b/drivers/ide/legacy/ali14xx.c | |||
@@ -228,9 +228,17 @@ static int __init ali14xx_probe(void) | |||
228 | return 0; | 228 | return 0; |
229 | } | 229 | } |
230 | 230 | ||
231 | int probe_ali14xx = 0; | ||
232 | |||
233 | module_param_named(probe, probe_ali14xx, bool, 0); | ||
234 | MODULE_PARM_DESC(probe, "probe for ALI M14xx chipsets"); | ||
235 | |||
231 | /* Can be called directly from ide.c. */ | 236 | /* Can be called directly from ide.c. */ |
232 | int __init ali14xx_init(void) | 237 | int __init ali14xx_init(void) |
233 | { | 238 | { |
239 | if (probe_ali14xx == 0) | ||
240 | goto out; | ||
241 | |||
234 | /* auto-detect IDE controller port */ | 242 | /* auto-detect IDE controller port */ |
235 | if (findPort()) { | 243 | if (findPort()) { |
236 | if (ali14xx_probe()) | 244 | if (ali14xx_probe()) |
@@ -238,6 +246,7 @@ int __init ali14xx_init(void) | |||
238 | return 0; | 246 | return 0; |
239 | } | 247 | } |
240 | printk(KERN_ERR "ali14xx: not found.\n"); | 248 | printk(KERN_ERR "ali14xx: not found.\n"); |
249 | out: | ||
241 | return -ENODEV; | 250 | return -ENODEV; |
242 | } | 251 | } |
243 | 252 | ||
diff --git a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c index f2903b6e43c0..0219ffa64db6 100644 --- a/drivers/ide/legacy/dtc2278.c +++ b/drivers/ide/legacy/dtc2278.c | |||
@@ -92,7 +92,7 @@ static void tune_dtc2278 (ide_drive_t *drive, u8 pio) | |||
92 | HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1; | 92 | HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1; |
93 | } | 93 | } |
94 | 94 | ||
95 | static int __init probe_dtc2278(void) | 95 | static int __init dtc2278_probe(void) |
96 | { | 96 | { |
97 | unsigned long flags; | 97 | unsigned long flags; |
98 | ide_hwif_t *hwif, *mate; | 98 | ide_hwif_t *hwif, *mate; |
@@ -143,10 +143,18 @@ static int __init probe_dtc2278(void) | |||
143 | return 0; | 143 | return 0; |
144 | } | 144 | } |
145 | 145 | ||
146 | int probe_dtc2278 = 0; | ||
147 | |||
148 | module_param_named(probe, probe_dtc2278, bool, 0); | ||
149 | MODULE_PARM_DESC(probe, "probe for DTC2278xx chipsets"); | ||
150 | |||
146 | /* Can be called directly from ide.c. */ | 151 | /* Can be called directly from ide.c. */ |
147 | int __init dtc2278_init(void) | 152 | int __init dtc2278_init(void) |
148 | { | 153 | { |
149 | if (probe_dtc2278()) { | 154 | if (probe_dtc2278 == 0) |
155 | return -ENODEV; | ||
156 | |||
157 | if (dtc2278_probe()) { | ||
150 | printk(KERN_ERR "dtc2278: ide interfaces already in use!\n"); | 158 | printk(KERN_ERR "dtc2278: ide interfaces already in use!\n"); |
151 | return -EBUSY; | 159 | return -EBUSY; |
152 | } | 160 | } |
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c index 02d5e20791e3..a2832643c522 100644 --- a/drivers/ide/legacy/ht6560b.c +++ b/drivers/ide/legacy/ht6560b.c | |||
@@ -301,12 +301,20 @@ static void tune_ht6560b (ide_drive_t *drive, u8 pio) | |||
301 | #endif | 301 | #endif |
302 | } | 302 | } |
303 | 303 | ||
304 | int probe_ht6560b = 0; | ||
305 | |||
306 | module_param_named(probe, probe_ht6560b, bool, 0); | ||
307 | MODULE_PARM_DESC(probe, "probe for HT6560B chipset"); | ||
308 | |||
304 | /* Can be called directly from ide.c. */ | 309 | /* Can be called directly from ide.c. */ |
305 | int __init ht6560b_init(void) | 310 | int __init ht6560b_init(void) |
306 | { | 311 | { |
307 | ide_hwif_t *hwif, *mate; | 312 | ide_hwif_t *hwif, *mate; |
308 | int t; | 313 | int t; |
309 | 314 | ||
315 | if (probe_ht6560b == 0) | ||
316 | return -ENODEV; | ||
317 | |||
310 | hwif = &ide_hwifs[0]; | 318 | hwif = &ide_hwifs[0]; |
311 | mate = &ide_hwifs[1]; | 319 | mate = &ide_hwifs[1]; |
312 | 320 | ||
diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c index ab482c85e415..2fb8f50f1293 100644 --- a/drivers/ide/legacy/qd65xx.c +++ b/drivers/ide/legacy/qd65xx.c | |||
@@ -488,9 +488,17 @@ static int __init qd_probe(int base) | |||
488 | return 1; | 488 | return 1; |
489 | } | 489 | } |
490 | 490 | ||
491 | int probe_qd65xx = 0; | ||
492 | |||
493 | module_param_named(probe, probe_qd65xx, bool, 0); | ||
494 | MODULE_PARM_DESC(probe, "probe for QD65xx chipsets"); | ||
495 | |||
491 | /* Can be called directly from ide.c. */ | 496 | /* Can be called directly from ide.c. */ |
492 | int __init qd65xx_init(void) | 497 | int __init qd65xx_init(void) |
493 | { | 498 | { |
499 | if (probe_qd65xx == 0) | ||
500 | return -ENODEV; | ||
501 | |||
494 | if (qd_probe(0x30)) | 502 | if (qd_probe(0x30)) |
495 | qd_probe(0xb0); | 503 | qd_probe(0xb0); |
496 | if (ide_hwifs[0].chipset != ide_qd65xx && | 504 | if (ide_hwifs[0].chipset != ide_qd65xx && |
diff --git a/drivers/ide/legacy/umc8672.c b/drivers/ide/legacy/umc8672.c index 6e2c58c5f6a2..ca7974455578 100644 --- a/drivers/ide/legacy/umc8672.c +++ b/drivers/ide/legacy/umc8672.c | |||
@@ -165,12 +165,21 @@ static int __init umc8672_probe(void) | |||
165 | return 0; | 165 | return 0; |
166 | } | 166 | } |
167 | 167 | ||
168 | int probe_umc8672 = 0; | ||
169 | |||
170 | module_param_named(probe, probe_umc8672, bool, 0); | ||
171 | MODULE_PARM_DESC(probe, "probe for UMC8672 chipset"); | ||
172 | |||
168 | /* Can be called directly from ide.c. */ | 173 | /* Can be called directly from ide.c. */ |
169 | int __init umc8672_init(void) | 174 | int __init umc8672_init(void) |
170 | { | 175 | { |
171 | if (umc8672_probe()) | 176 | if (probe_umc8672 == 0) |
172 | return -ENODEV; | 177 | goto out; |
173 | return 0; | 178 | |
179 | if (umc8672_probe() == 0) | ||
180 | return 0;; | ||
181 | out: | ||
182 | return -ENODEV;; | ||
174 | } | 183 | } |
175 | 184 | ||
176 | #ifdef MODULE | 185 | #ifdef MODULE |