diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-03-26 19:36:50 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-04-29 18:00:30 -0400 |
commit | 70093cfde8af52b0b9030d90f9004cbde38f2ff8 (patch) | |
tree | f9230ca354e78b129898298095a6ee887c40a16d | |
parent | e00f04a70fa387b3accc81b5c346200f836e2a52 (diff) |
ieee1394: eth1394: don't autoload by hotplug when ohci1394 starts
Until now, ieee1394 put an IP-over-1394 capability entry into each new
host's config ROM. As soon as the controller was initialized --- i.e.
right after modprobe ohci1394 --- this entry triggered a hotplug event
which typically caused auto-loading of eth1394.
This irritated or annoyed many users and distributors. Of course they
could blacklist eth1394, but then ieee1394 wrongly advertized IP-over-
1394 capability to the FireWire bus.
Therefore
- remove the offending kernel config option
IEEE1394_CONFIG_ROM_IP1394,
- let eth1394 add the ROM entry by itself, i.e. only after eth1394 was
loaded.
This fixes http://bugzilla.kernel.org/show_bug.cgi?id=7793 .
To emulate the behaviour of older kernels, simply add the following to
to /etc/modprobe.conf:
install ohci1394 /sbin/modprobe eth1394; \
/sbin/modprobe --ignore-install ohci1394
Note, autoloading of eth1394 when an _external_ IP-over-1394 capable
device is discovered is _not_ affected by this patch.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r-- | drivers/ieee1394/Kconfig | 29 | ||||
-rw-r--r-- | drivers/ieee1394/config_roms.c | 76 | ||||
-rw-r--r-- | drivers/ieee1394/config_roms.h | 7 | ||||
-rw-r--r-- | drivers/ieee1394/eth1394.c | 7 | ||||
-rw-r--r-- | drivers/ieee1394/hosts.c | 3 |
5 files changed, 36 insertions, 86 deletions
diff --git a/drivers/ieee1394/Kconfig b/drivers/ieee1394/Kconfig index f8ff6b866e6e..5c0b522ae077 100644 --- a/drivers/ieee1394/Kconfig +++ b/drivers/ieee1394/Kconfig | |||
@@ -34,23 +34,6 @@ config IEEE1394_VERBOSEDEBUG | |||
34 | Say Y if you really want or need the debugging output, everyone | 34 | Say Y if you really want or need the debugging output, everyone |
35 | else says N. | 35 | else says N. |
36 | 36 | ||
37 | config IEEE1394_EXTRA_CONFIG_ROMS | ||
38 | bool "Build in extra config rom entries for certain functionality" | ||
39 | depends on IEEE1394 | ||
40 | help | ||
41 | Some IEEE1394 functionality depends on extra config rom entries | ||
42 | being available in the host adapters CSR. These options will | ||
43 | allow you to choose which ones. | ||
44 | |||
45 | config IEEE1394_CONFIG_ROM_IP1394 | ||
46 | bool "IP-1394 Entry" | ||
47 | depends on IEEE1394_EXTRA_CONFIG_ROMS && IEEE1394 | ||
48 | help | ||
49 | Adds an entry for using IP-over-1394. If you want to use your | ||
50 | IEEE1394 bus as a network for IP systems (including interacting | ||
51 | with MacOSX and WinXP IP-over-1394), enable this option and the | ||
52 | eth1394 option below. | ||
53 | |||
54 | comment "Device Drivers" | 37 | comment "Device Drivers" |
55 | depends on IEEE1394 | 38 | depends on IEEE1394 |
56 | 39 | ||
@@ -120,11 +103,15 @@ config IEEE1394_SBP2_PHYS_DMA | |||
120 | This option is buggy and currently broken on some architectures. | 103 | This option is buggy and currently broken on some architectures. |
121 | If unsure, say N. | 104 | If unsure, say N. |
122 | 105 | ||
106 | config IEEE1394_ETH1394_ROM_ENTRY | ||
107 | depends on IEEE1394 | ||
108 | bool | ||
109 | default n | ||
110 | |||
123 | config IEEE1394_ETH1394 | 111 | config IEEE1394_ETH1394 |
124 | tristate "Ethernet over 1394" | 112 | tristate "IP over 1394" |
125 | depends on IEEE1394 && EXPERIMENTAL && INET | 113 | depends on IEEE1394 && EXPERIMENTAL && INET |
126 | select IEEE1394_CONFIG_ROM_IP1394 | 114 | select IEEE1394_ETH1394_ROM_ENTRY |
127 | select IEEE1394_EXTRA_CONFIG_ROMS | ||
128 | help | 115 | help |
129 | This driver implements a functional majority of RFC 2734: IPv4 over | 116 | This driver implements a functional majority of RFC 2734: IPv4 over |
130 | 1394. It will provide IP connectivity with implementations of RFC | 117 | 1394. It will provide IP connectivity with implementations of RFC |
@@ -133,6 +120,8 @@ config IEEE1394_ETH1394 | |||
133 | This driver is still considered experimental. It does not yet support | 120 | This driver is still considered experimental. It does not yet support |
134 | MCAP, therefore multicast support is significantly limited. | 121 | MCAP, therefore multicast support is significantly limited. |
135 | 122 | ||
123 | The module is called eth1394 although it does not emulate Ethernet. | ||
124 | |||
136 | config IEEE1394_DV1394 | 125 | config IEEE1394_DV1394 |
137 | tristate "OHCI-DV I/O support (deprecated)" | 126 | tristate "OHCI-DV I/O support (deprecated)" |
138 | depends on IEEE1394 && IEEE1394_OHCI1394 | 127 | depends on IEEE1394 && IEEE1394_OHCI1394 |
diff --git a/drivers/ieee1394/config_roms.c b/drivers/ieee1394/config_roms.c index 556658a1db29..1b981207fa76 100644 --- a/drivers/ieee1394/config_roms.c +++ b/drivers/ieee1394/config_roms.c | |||
@@ -26,12 +26,6 @@ struct hpsb_config_rom_entry { | |||
26 | /* Base initialization, called at module load */ | 26 | /* Base initialization, called at module load */ |
27 | int (*init)(void); | 27 | int (*init)(void); |
28 | 28 | ||
29 | /* Add entry to specified host */ | ||
30 | int (*add)(struct hpsb_host *host); | ||
31 | |||
32 | /* Remove entry from specified host */ | ||
33 | void (*remove)(struct hpsb_host *host); | ||
34 | |||
35 | /* Cleanup called at module exit */ | 29 | /* Cleanup called at module exit */ |
36 | void (*cleanup)(void); | 30 | void (*cleanup)(void); |
37 | 31 | ||
@@ -78,7 +72,7 @@ int hpsb_default_host_entry(struct hpsb_host *host) | |||
78 | } | 72 | } |
79 | 73 | ||
80 | 74 | ||
81 | #ifdef CONFIG_IEEE1394_CONFIG_ROM_IP1394 | 75 | #ifdef CONFIG_IEEE1394_ETH1394_ROM_ENTRY |
82 | #include "eth1394.h" | 76 | #include "eth1394.h" |
83 | 77 | ||
84 | static struct csr1212_keyval *ip1394_ud; | 78 | static struct csr1212_keyval *ip1394_ud; |
@@ -137,7 +131,7 @@ static void config_rom_ip1394_cleanup(void) | |||
137 | } | 131 | } |
138 | } | 132 | } |
139 | 133 | ||
140 | static int config_rom_ip1394_add(struct hpsb_host *host) | 134 | int hpsb_config_rom_ip1394_add(struct hpsb_host *host) |
141 | { | 135 | { |
142 | if (!ip1394_ud) | 136 | if (!ip1394_ud) |
143 | return -ENODEV; | 137 | return -ENODEV; |
@@ -146,30 +140,33 @@ static int config_rom_ip1394_add(struct hpsb_host *host) | |||
146 | ip1394_ud) != CSR1212_SUCCESS) | 140 | ip1394_ud) != CSR1212_SUCCESS) |
147 | return -ENOMEM; | 141 | return -ENOMEM; |
148 | 142 | ||
143 | host->config_roms |= HPSB_CONFIG_ROM_ENTRY_IP1394; | ||
144 | host->update_config_rom = 1; | ||
149 | return 0; | 145 | return 0; |
150 | } | 146 | } |
147 | EXPORT_SYMBOL_GPL(hpsb_config_rom_ip1394_add); | ||
151 | 148 | ||
152 | static void config_rom_ip1394_remove(struct hpsb_host *host) | 149 | void hpsb_config_rom_ip1394_remove(struct hpsb_host *host) |
153 | { | 150 | { |
154 | csr1212_detach_keyval_from_directory(host->csr.rom->root_kv, ip1394_ud); | 151 | csr1212_detach_keyval_from_directory(host->csr.rom->root_kv, ip1394_ud); |
152 | host->config_roms &= ~HPSB_CONFIG_ROM_ENTRY_IP1394; | ||
153 | host->update_config_rom = 1; | ||
155 | } | 154 | } |
155 | EXPORT_SYMBOL_GPL(hpsb_config_rom_ip1394_remove); | ||
156 | 156 | ||
157 | static struct hpsb_config_rom_entry ip1394_entry = { | 157 | static struct hpsb_config_rom_entry ip1394_entry = { |
158 | .name = "ip1394", | 158 | .name = "ip1394", |
159 | .init = config_rom_ip1394_init, | 159 | .init = config_rom_ip1394_init, |
160 | .add = config_rom_ip1394_add, | ||
161 | .remove = config_rom_ip1394_remove, | ||
162 | .cleanup = config_rom_ip1394_cleanup, | 160 | .cleanup = config_rom_ip1394_cleanup, |
163 | .flag = HPSB_CONFIG_ROM_ENTRY_IP1394, | 161 | .flag = HPSB_CONFIG_ROM_ENTRY_IP1394, |
164 | }; | 162 | }; |
165 | #endif /* CONFIG_IEEE1394_CONFIG_ROM_IP1394 */ | ||
166 | 163 | ||
164 | #endif /* CONFIG_IEEE1394_ETH1394_ROM_ENTRY */ | ||
167 | 165 | ||
168 | static struct hpsb_config_rom_entry *const config_rom_entries[] = { | 166 | static struct hpsb_config_rom_entry *const config_rom_entries[] = { |
169 | #ifdef CONFIG_IEEE1394_CONFIG_ROM_IP1394 | 167 | #ifdef CONFIG_IEEE1394_ETH1394_ROM_ENTRY |
170 | &ip1394_entry, | 168 | &ip1394_entry, |
171 | #endif | 169 | #endif |
172 | NULL, | ||
173 | }; | 170 | }; |
174 | 171 | ||
175 | /* Initialize all config roms */ | 172 | /* Initialize all config roms */ |
@@ -177,18 +174,12 @@ int hpsb_init_config_roms(void) | |||
177 | { | 174 | { |
178 | int i, error = 0; | 175 | int i, error = 0; |
179 | 176 | ||
180 | for (i = 0; config_rom_entries[i]; i++) { | 177 | for (i = 0; i < ARRAY_SIZE(config_rom_entries); i++) |
181 | if (!config_rom_entries[i]->init) | ||
182 | continue; | ||
183 | |||
184 | if (config_rom_entries[i]->init()) { | 178 | if (config_rom_entries[i]->init()) { |
185 | HPSB_ERR("Failed to initialize config rom entry `%s'", | 179 | HPSB_ERR("Failed to initialize config rom entry `%s'", |
186 | config_rom_entries[i]->name); | 180 | config_rom_entries[i]->name); |
187 | error = -1; | 181 | error = -1; |
188 | } else | 182 | } |
189 | HPSB_DEBUG("Initialized config rom entry `%s'", | ||
190 | config_rom_entries[i]->name); | ||
191 | } | ||
192 | 183 | ||
193 | return error; | 184 | return error; |
194 | } | 185 | } |
@@ -198,43 +189,6 @@ void hpsb_cleanup_config_roms(void) | |||
198 | { | 189 | { |
199 | int i; | 190 | int i; |
200 | 191 | ||
201 | for (i = 0; config_rom_entries[i]; i++) { | 192 | for (i = 0; i < ARRAY_SIZE(config_rom_entries); i++) |
202 | if (config_rom_entries[i]->cleanup) | 193 | config_rom_entries[i]->cleanup(); |
203 | config_rom_entries[i]->cleanup(); | ||
204 | } | ||
205 | } | ||
206 | |||
207 | /* Add extra config roms to specified host */ | ||
208 | int hpsb_add_extra_config_roms(struct hpsb_host *host) | ||
209 | { | ||
210 | int i, error = 0; | ||
211 | |||
212 | for (i = 0; config_rom_entries[i]; i++) { | ||
213 | if (config_rom_entries[i]->add(host)) { | ||
214 | HPSB_ERR("fw-host%d: Failed to attach config rom entry `%s'", | ||
215 | host->id, config_rom_entries[i]->name); | ||
216 | error = -1; | ||
217 | } else { | ||
218 | host->config_roms |= config_rom_entries[i]->flag; | ||
219 | host->update_config_rom = 1; | ||
220 | } | ||
221 | } | ||
222 | |||
223 | return error; | ||
224 | } | ||
225 | |||
226 | /* Remove extra config roms from specified host */ | ||
227 | void hpsb_remove_extra_config_roms(struct hpsb_host *host) | ||
228 | { | ||
229 | int i; | ||
230 | |||
231 | for (i = 0; config_rom_entries[i]; i++) { | ||
232 | if (!(host->config_roms & config_rom_entries[i]->flag)) | ||
233 | continue; | ||
234 | |||
235 | config_rom_entries[i]->remove(host); | ||
236 | |||
237 | host->config_roms &= ~config_rom_entries[i]->flag; | ||
238 | host->update_config_rom = 1; | ||
239 | } | ||
240 | } | 194 | } |
diff --git a/drivers/ieee1394/config_roms.h b/drivers/ieee1394/config_roms.h index 02a21871bdaf..1f5cd1f16c44 100644 --- a/drivers/ieee1394/config_roms.h +++ b/drivers/ieee1394/config_roms.h | |||
@@ -6,11 +6,14 @@ struct hpsb_host; | |||
6 | int hpsb_default_host_entry(struct hpsb_host *host); | 6 | int hpsb_default_host_entry(struct hpsb_host *host); |
7 | int hpsb_init_config_roms(void); | 7 | int hpsb_init_config_roms(void); |
8 | void hpsb_cleanup_config_roms(void); | 8 | void hpsb_cleanup_config_roms(void); |
9 | int hpsb_add_extra_config_roms(struct hpsb_host *host); | ||
10 | void hpsb_remove_extra_config_roms(struct hpsb_host *host); | ||
11 | 9 | ||
12 | /* List of flags to check if a host contains a certain extra config rom | 10 | /* List of flags to check if a host contains a certain extra config rom |
13 | * entry. Available in the host->config_roms member. */ | 11 | * entry. Available in the host->config_roms member. */ |
14 | #define HPSB_CONFIG_ROM_ENTRY_IP1394 0x00000001 | 12 | #define HPSB_CONFIG_ROM_ENTRY_IP1394 0x00000001 |
15 | 13 | ||
14 | #ifdef CONFIG_IEEE1394_ETH1394_ROM_ENTRY | ||
15 | int hpsb_config_rom_ip1394_add(struct hpsb_host *host); | ||
16 | void hpsb_config_rom_ip1394_remove(struct hpsb_host *host); | ||
17 | #endif | ||
18 | |||
16 | #endif /* _IEEE1394_CONFIG_ROMS_H */ | 19 | #endif /* _IEEE1394_CONFIG_ROMS_H */ |
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index d056c5953be3..b4fa754bfd1a 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c | |||
@@ -561,8 +561,10 @@ static void ether1394_add_host (struct hpsb_host *host) | |||
561 | struct eth1394_priv *priv; | 561 | struct eth1394_priv *priv; |
562 | u64 fifo_addr; | 562 | u64 fifo_addr; |
563 | 563 | ||
564 | if (!(host->config_roms & HPSB_CONFIG_ROM_ENTRY_IP1394)) | 564 | if (hpsb_config_rom_ip1394_add(host) != 0) { |
565 | ETH1394_PRINT_G(KERN_ERR, "Can't add IP-over-1394 ROM entry\n"); | ||
565 | return; | 566 | return; |
567 | } | ||
566 | 568 | ||
567 | fifo_addr = hpsb_allocate_and_register_addrspace( | 569 | fifo_addr = hpsb_allocate_and_register_addrspace( |
568 | ð1394_highlevel, host, &addr_ops, | 570 | ð1394_highlevel, host, &addr_ops, |
@@ -570,6 +572,7 @@ static void ether1394_add_host (struct hpsb_host *host) | |||
570 | CSR1212_INVALID_ADDR_SPACE, CSR1212_INVALID_ADDR_SPACE); | 572 | CSR1212_INVALID_ADDR_SPACE, CSR1212_INVALID_ADDR_SPACE); |
571 | if (fifo_addr == CSR1212_INVALID_ADDR_SPACE) { | 573 | if (fifo_addr == CSR1212_INVALID_ADDR_SPACE) { |
572 | ETH1394_PRINT_G(KERN_ERR, "Cannot register CSR space\n"); | 574 | ETH1394_PRINT_G(KERN_ERR, "Cannot register CSR space\n"); |
575 | hpsb_config_rom_ip1394_remove(host); | ||
573 | return; | 576 | return; |
574 | } | 577 | } |
575 | 578 | ||
@@ -649,6 +652,7 @@ out: | |||
649 | if (hi) | 652 | if (hi) |
650 | hpsb_destroy_hostinfo(ð1394_highlevel, host); | 653 | hpsb_destroy_hostinfo(ð1394_highlevel, host); |
651 | hpsb_unregister_addrspace(ð1394_highlevel, host, fifo_addr); | 654 | hpsb_unregister_addrspace(ð1394_highlevel, host, fifo_addr); |
655 | hpsb_config_rom_ip1394_remove(host); | ||
652 | } | 656 | } |
653 | 657 | ||
654 | /* Remove a card from our list */ | 658 | /* Remove a card from our list */ |
@@ -662,6 +666,7 @@ static void ether1394_remove_host (struct hpsb_host *host) | |||
662 | return; | 666 | return; |
663 | priv = netdev_priv(hi->dev); | 667 | priv = netdev_priv(hi->dev); |
664 | hpsb_unregister_addrspace(ð1394_highlevel, host, priv->local_fifo); | 668 | hpsb_unregister_addrspace(ð1394_highlevel, host, priv->local_fifo); |
669 | hpsb_config_rom_ip1394_remove(host); | ||
665 | if (priv->iso) | 670 | if (priv->iso) |
666 | hpsb_iso_shutdown(priv->iso); | 671 | hpsb_iso_shutdown(priv->iso); |
667 | unregister_netdev(hi->dev); | 672 | unregister_netdev(hi->dev); |
diff --git a/drivers/ieee1394/hosts.c b/drivers/ieee1394/hosts.c index 1bf4aa3e8d15..6164a9a83396 100644 --- a/drivers/ieee1394/hosts.c +++ b/drivers/ieee1394/hosts.c | |||
@@ -180,7 +180,7 @@ int hpsb_add_host(struct hpsb_host *host) | |||
180 | { | 180 | { |
181 | if (hpsb_default_host_entry(host)) | 181 | if (hpsb_default_host_entry(host)) |
182 | return -ENOMEM; | 182 | return -ENOMEM; |
183 | hpsb_add_extra_config_roms(host); | 183 | |
184 | highlevel_add_host(host); | 184 | highlevel_add_host(host); |
185 | return 0; | 185 | return 0; |
186 | } | 186 | } |
@@ -202,7 +202,6 @@ void hpsb_remove_host(struct hpsb_host *host) | |||
202 | 202 | ||
203 | host->driver = &dummy_driver; | 203 | host->driver = &dummy_driver; |
204 | highlevel_remove_host(host); | 204 | highlevel_remove_host(host); |
205 | hpsb_remove_extra_config_roms(host); | ||
206 | 205 | ||
207 | class_device_unregister(&host->class_dev); | 206 | class_device_unregister(&host->class_dev); |
208 | device_unregister(&host->device); | 207 | device_unregister(&host->device); |