Commit 70093cfde8af52b0b9030d90f9004cbde38f2ff8

Authored by Stefan Richter
1 parent e00f04a70f

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>

Showing 5 changed files with 36 additions and 86 deletions Side-by-side Diff

drivers/ieee1394/Kconfig
... ... @@ -34,23 +34,6 @@
34 34 Say Y if you really want or need the debugging output, everyone
35 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 37 comment "Device Drivers"
55 38 depends on IEEE1394
56 39  
57 40  
58 41  
... ... @@ -120,11 +103,15 @@
120 103 This option is buggy and currently broken on some architectures.
121 104 If unsure, say N.
122 105  
  106 +config IEEE1394_ETH1394_ROM_ENTRY
  107 + depends on IEEE1394
  108 + bool
  109 + default n
  110 +
123 111 config IEEE1394_ETH1394
124   - tristate "Ethernet over 1394"
  112 + tristate "IP over 1394"
125 113 depends on IEEE1394 && EXPERIMENTAL && INET
126   - select IEEE1394_CONFIG_ROM_IP1394
127   - select IEEE1394_EXTRA_CONFIG_ROMS
  114 + select IEEE1394_ETH1394_ROM_ENTRY
128 115 help
129 116 This driver implements a functional majority of RFC 2734: IPv4 over
130 117 1394. It will provide IP connectivity with implementations of RFC
... ... @@ -132,6 +119,8 @@
132 119 older versions of this driver found in stock kernels prior to 2.6.3.
133 120 This driver is still considered experimental. It does not yet support
134 121 MCAP, therefore multicast support is significantly limited.
  122 +
  123 + The module is called eth1394 although it does not emulate Ethernet.
135 124  
136 125 config IEEE1394_DV1394
137 126 tristate "OHCI-DV I/O support (deprecated)"
drivers/ieee1394/config_roms.c
... ... @@ -26,12 +26,6 @@
26 26 /* Base initialization, called at module load */
27 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 29 /* Cleanup called at module exit */
36 30 void (*cleanup)(void);
37 31  
... ... @@ -78,7 +72,7 @@
78 72 }
79 73  
80 74  
81   -#ifdef CONFIG_IEEE1394_CONFIG_ROM_IP1394
  75 +#ifdef CONFIG_IEEE1394_ETH1394_ROM_ENTRY
82 76 #include "eth1394.h"
83 77  
84 78 static struct csr1212_keyval *ip1394_ud;
... ... @@ -137,7 +131,7 @@
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 136 if (!ip1394_ud)
143 137 return -ENODEV;
144 138  
145 139  
146 140  
147 141  
148 142  
149 143  
150 144  
151 145  
152 146  
... ... @@ -146,30 +140,33 @@
146 140 ip1394_ud) != CSR1212_SUCCESS)
147 141 return -ENOMEM;
148 142  
  143 + host->config_roms |= HPSB_CONFIG_ROM_ENTRY_IP1394;
  144 + host->update_config_rom = 1;
149 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 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 157 static struct hpsb_config_rom_entry ip1394_entry = {
158 158 .name = "ip1394",
159 159 .init = config_rom_ip1394_init,
160   - .add = config_rom_ip1394_add,
161   - .remove = config_rom_ip1394_remove,
162 160 .cleanup = config_rom_ip1394_cleanup,
163 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 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 168 &ip1394_entry,
171 169 #endif
172   - NULL,
173 170 };
174 171  
175 172 /* Initialize all config roms */
176 173  
... ... @@ -177,18 +174,12 @@
177 174 {
178 175 int i, error = 0;
179 176  
180   - for (i = 0; config_rom_entries[i]; i++) {
181   - if (!config_rom_entries[i]->init)
182   - continue;
183   -
  177 + for (i = 0; i < ARRAY_SIZE(config_rom_entries); i++)
184 178 if (config_rom_entries[i]->init()) {
185 179 HPSB_ERR("Failed to initialize config rom entry `%s'",
186 180 config_rom_entries[i]->name);
187 181 error = -1;
188   - } else
189   - HPSB_DEBUG("Initialized config rom entry `%s'",
190   - config_rom_entries[i]->name);
191   - }
  182 + }
192 183  
193 184 return error;
194 185 }
... ... @@ -198,44 +189,7 @@
198 189 {
199 190 int i;
200 191  
201   - for (i = 0; config_rom_entries[i]; i++) {
202   - if (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   - }
  192 + for (i = 0; i < ARRAY_SIZE(config_rom_entries); i++)
  193 + config_rom_entries[i]->cleanup();
240 194 }
drivers/ieee1394/config_roms.h
... ... @@ -6,12 +6,15 @@
6 6 int hpsb_default_host_entry(struct hpsb_host *host);
7 7 int hpsb_init_config_roms(void);
8 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 10 /* List of flags to check if a host contains a certain extra config rom
13 11 * entry. Available in the host->config_roms member. */
14 12 #define HPSB_CONFIG_ROM_ENTRY_IP1394 0x00000001
  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
15 18  
16 19 #endif /* _IEEE1394_CONFIG_ROMS_H */
drivers/ieee1394/eth1394.c
... ... @@ -561,8 +561,10 @@
561 561 struct eth1394_priv *priv;
562 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 566 return;
  567 + }
566 568  
567 569 fifo_addr = hpsb_allocate_and_register_addrspace(
568 570 &eth1394_highlevel, host, &addr_ops,
... ... @@ -570,6 +572,7 @@
570 572 CSR1212_INVALID_ADDR_SPACE, CSR1212_INVALID_ADDR_SPACE);
571 573 if (fifo_addr == CSR1212_INVALID_ADDR_SPACE) {
572 574 ETH1394_PRINT_G(KERN_ERR, "Cannot register CSR space\n");
  575 + hpsb_config_rom_ip1394_remove(host);
573 576 return;
574 577 }
575 578  
... ... @@ -649,6 +652,7 @@
649 652 if (hi)
650 653 hpsb_destroy_hostinfo(&eth1394_highlevel, host);
651 654 hpsb_unregister_addrspace(&eth1394_highlevel, host, fifo_addr);
  655 + hpsb_config_rom_ip1394_remove(host);
652 656 }
653 657  
654 658 /* Remove a card from our list */
... ... @@ -662,6 +666,7 @@
662 666 return;
663 667 priv = netdev_priv(hi->dev);
664 668 hpsb_unregister_addrspace(&eth1394_highlevel, host, priv->local_fifo);
  669 + hpsb_config_rom_ip1394_remove(host);
665 670 if (priv->iso)
666 671 hpsb_iso_shutdown(priv->iso);
667 672 unregister_netdev(hi->dev);
drivers/ieee1394/hosts.c
... ... @@ -180,7 +180,7 @@
180 180 {
181 181 if (hpsb_default_host_entry(host))
182 182 return -ENOMEM;
183   - hpsb_add_extra_config_roms(host);
  183 +
184 184 highlevel_add_host(host);
185 185 return 0;
186 186 }
... ... @@ -202,7 +202,6 @@
202 202  
203 203 host->driver = &dummy_driver;
204 204 highlevel_remove_host(host);
205   - hpsb_remove_extra_config_roms(host);
206 205  
207 206 class_device_unregister(&host->class_dev);
208 207 device_unregister(&host->device);