[PATCH update/RFC] ieee1394: eth1394: don't autoload by hotplug when ohci1394 starts

2007-03-26 Thread Stefan Richter
I wrote:
>   - add a new kernel config option which brings back the old behavior
> for those who liked it.  We don't re-use the old config option
> because then nobody would notice that there is a choice now.  This
> new option is scheduled to be removed soon.
...
> Instead of keeping this until the proposed date of removal (June 2007),
> should I kill CONFIG_IEEE1394_AUTOLOAD_ETH1394 right away?
> 
> 
>  Documentation/feature-removal-schedule.txt |9 +++
>  drivers/ieee1394/Kconfig   |   49 -
>  drivers/ieee1394/config_roms.c |   47 +++-
>  drivers/ieee1394/config_roms.h |   10 
>  drivers/ieee1394/eth1394.c |9 +++
>  5 files changed, 91 insertions(+), 33 deletions(-)


If I skip the feature-removal-schedule procedure, the resulting code is
a lot nicer. I prefer this updated patch and I consider it a candidate
for before 2.6.22-rc1.


From: Stefan Richter <[EMAIL PROTECTED]>
Subject: 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 .

Autoloading of eth1394 when an _external_ IP-over-1394 capable device is
discovered is _not_ affected by this patch.

Signed-off-by: Stefan Richter <[EMAIL PROTECTED]>
---

 drivers/ieee1394/Kconfig   |   29 +++-
 drivers/ieee1394/config_roms.c |   76 ++---
 drivers/ieee1394/config_roms.h |7 ++-
 drivers/ieee1394/eth1394.c |7 ++-
 drivers/ieee1394/hosts.c   |3 -
 5 files changed, 36 insertions(+), 86 deletions(-)


Index: linux/drivers/ieee1394/Kconfig
===
--- linux.orig/drivers/ieee1394/Kconfig
+++ linux/drivers/ieee1394/Kconfig
@@ -36,23 +36,6 @@ config IEEE1394_VERBOSEDEBUG
  Say Y if you really want or need the debugging output, everyone
  else says N.
 
-config IEEE1394_EXTRA_CONFIG_ROMS
-   bool "Build in extra config rom entries for certain functionality"
-   depends on IEEE1394
-   help
- Some IEEE1394 functionality depends on extra config rom entries
- being available in the host adapters CSR. These options will
- allow you to choose which ones.
-
-config IEEE1394_CONFIG_ROM_IP1394
-   bool "IP-1394 Entry"
-   depends on IEEE1394_EXTRA_CONFIG_ROMS && IEEE1394
-   help
- Adds an entry for using IP-over-1394. If you want to use your
- IEEE1394 bus as a network for IP systems (including interacting
- with MacOSX and WinXP IP-over-1394), enable this option and the
- eth1394 option below.
-
 comment "Device Drivers"
depends on IEEE1394
 
@@ -122,11 +105,15 @@ config IEEE1394_SBP2_PHYS_DMA
  This option is buggy and currently broken on some architectures.
  If unsure, say N.
 
+config IEEE1394_ETH1394_ROM_ENTRY
+   depends on IEEE1394
+   bool
+   default n
+
 config IEEE1394_ETH1394
-   tristate "Ethernet over 1394"
+   tristate "IP over 1394"
depends on IEEE1394 && EXPERIMENTAL && INET
-   select IEEE1394_CONFIG_ROM_IP1394
-   select IEEE1394_EXTRA_CONFIG_ROMS
+   select IEEE1394_ETH1394_ROM_ENTRY
help
  This driver implements a functional majority of RFC 2734: IPv4 over
  1394.  It will provide IP connectivity with implementations of RFC
@@ -135,6 +122,8 @@ config IEEE1394_ETH1394
  This driver is still considered experimental.  It does not yet support
  MCAP, therefore multicast support is significantly limited.
 
+ The module is called eth1394 although it does not emulate Ethernet.
+
 config IEEE1394_DV1394
tristate "OHCI-DV I/O support (deprecated)"
depends on IEEE1394 && IEEE1394_OHCI1394
Index: linux/drivers/ieee1394/config_roms.c
===
--- linux.orig/drivers/ieee1394/config_roms.c
+++ linux/drivers/ieee1394/config_roms.c
@@ -26,12 +26,6 @@ struct hpsb_config_rom_entry {
/* Base initialization, called at module load */
int (*init)(void);
 
-   /* Add entry to specified host */
-   int (*add)(struct hpsb_host *host);
-
-   /* Remove entry from specified host */
-   void (*remove)(struct hpsb_host *host);
-
/* Cleanup called at 

[PATCH update/RFC] ieee1394: eth1394: don't autoload by hotplug when ohci1394 starts

2007-03-26 Thread Stefan Richter
I wrote:
   - add a new kernel config option which brings back the old behavior
 for those who liked it.  We don't re-use the old config option
 because then nobody would notice that there is a choice now.  This
 new option is scheduled to be removed soon.
...
 Instead of keeping this until the proposed date of removal (June 2007),
 should I kill CONFIG_IEEE1394_AUTOLOAD_ETH1394 right away?
 
 
  Documentation/feature-removal-schedule.txt |9 +++
  drivers/ieee1394/Kconfig   |   49 -
  drivers/ieee1394/config_roms.c |   47 +++-
  drivers/ieee1394/config_roms.h |   10 
  drivers/ieee1394/eth1394.c |9 +++
  5 files changed, 91 insertions(+), 33 deletions(-)


If I skip the feature-removal-schedule procedure, the resulting code is
a lot nicer. I prefer this updated patch and I consider it a candidate
for before 2.6.22-rc1.


From: Stefan Richter [EMAIL PROTECTED]
Subject: 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 .

Autoloading of eth1394 when an _external_ IP-over-1394 capable device is
discovered is _not_ affected by this patch.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---

 drivers/ieee1394/Kconfig   |   29 +++-
 drivers/ieee1394/config_roms.c |   76 ++---
 drivers/ieee1394/config_roms.h |7 ++-
 drivers/ieee1394/eth1394.c |7 ++-
 drivers/ieee1394/hosts.c   |3 -
 5 files changed, 36 insertions(+), 86 deletions(-)


Index: linux/drivers/ieee1394/Kconfig
===
--- linux.orig/drivers/ieee1394/Kconfig
+++ linux/drivers/ieee1394/Kconfig
@@ -36,23 +36,6 @@ config IEEE1394_VERBOSEDEBUG
  Say Y if you really want or need the debugging output, everyone
  else says N.
 
-config IEEE1394_EXTRA_CONFIG_ROMS
-   bool Build in extra config rom entries for certain functionality
-   depends on IEEE1394
-   help
- Some IEEE1394 functionality depends on extra config rom entries
- being available in the host adapters CSR. These options will
- allow you to choose which ones.
-
-config IEEE1394_CONFIG_ROM_IP1394
-   bool IP-1394 Entry
-   depends on IEEE1394_EXTRA_CONFIG_ROMS  IEEE1394
-   help
- Adds an entry for using IP-over-1394. If you want to use your
- IEEE1394 bus as a network for IP systems (including interacting
- with MacOSX and WinXP IP-over-1394), enable this option and the
- eth1394 option below.
-
 comment Device Drivers
depends on IEEE1394
 
@@ -122,11 +105,15 @@ config IEEE1394_SBP2_PHYS_DMA
  This option is buggy and currently broken on some architectures.
  If unsure, say N.
 
+config IEEE1394_ETH1394_ROM_ENTRY
+   depends on IEEE1394
+   bool
+   default n
+
 config IEEE1394_ETH1394
-   tristate Ethernet over 1394
+   tristate IP over 1394
depends on IEEE1394  EXPERIMENTAL  INET
-   select IEEE1394_CONFIG_ROM_IP1394
-   select IEEE1394_EXTRA_CONFIG_ROMS
+   select IEEE1394_ETH1394_ROM_ENTRY
help
  This driver implements a functional majority of RFC 2734: IPv4 over
  1394.  It will provide IP connectivity with implementations of RFC
@@ -135,6 +122,8 @@ config IEEE1394_ETH1394
  This driver is still considered experimental.  It does not yet support
  MCAP, therefore multicast support is significantly limited.
 
+ The module is called eth1394 although it does not emulate Ethernet.
+
 config IEEE1394_DV1394
tristate OHCI-DV I/O support (deprecated)
depends on IEEE1394  IEEE1394_OHCI1394
Index: linux/drivers/ieee1394/config_roms.c
===
--- linux.orig/drivers/ieee1394/config_roms.c
+++ linux/drivers/ieee1394/config_roms.c
@@ -26,12 +26,6 @@ struct hpsb_config_rom_entry {
/* Base initialization, called at module load */
int (*init)(void);
 
-   /* Add entry to specified host */
-   int (*add)(struct hpsb_host *host);
-
-   /* Remove entry from specified host */
-   void (*remove)(struct hpsb_host *host);
-
/* Cleanup called at module exit */
void