2009-03-10 16:53:49

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 00/31] *** SUBJECT HERE ***

module-init-tools on most distributions ships with a file that contains a
large list of aliases to auto-load modules on demand, either by matching
a MODALIAS string from the kernel uevent, or by the {block,char}-major-*
aliases requested by the kernel when device nodes are opened.

There are convenient macros for defining these inside the kernel modules
themselves, so they are exported by file2alias and put into the files
created by depmod. This is far preferable to a file in another package
that has to be parsed every time modprobe is called (many, many times
on a typical boot) and may get out of date.

The majority of these are of the type that cause modules to be loaded
when devices are opened, which are not generally needed in a udev system.
If the maintainers feel they aren't warranted, so be it.

Some match network protocols instead, it'd be nice if they could be merged.

And one (sg) is a missing match from a device driver to a MODALIAS,
we'd definitely like that one to be merged.

Thanks!

Scott

Scott James Remnant (30):
bridge: Auto-load bridge module when socket opened.
netlink: Auto-load af_netlink module when socket opened.
wanrouter: Auto-load wanrouter module when socket opened.
netfilter: Auto-load ip_queue module when socket opened.
netfilter: Auto-load ip6_queue module when socket opened.
connector: Auto-load cn module when socket opened.
scsi: Auto-load scsi_transport_iscsi module when socket opened.
mtd: Auto-load ftl module when device opened.
paride: Auto-load pcd module when device opened.
paride: Auto-load pf module when device opened.
mtd: Auto-load nftl module when device opened.
input: Auto-load mousedev module when psaux device opened.
input: Auto-load mousedev module when /dev/input/mice opened.
hw_random: Auto-load rng-core module when device opened.
sbus: Auto-load openprom module when device opened.
applicom: Auto-load applicom module when device opened.
toshiba: Auto-load toshiba module when device opened.
cyclades: Auto-load cyclades module when device opened.
riscom8: Auto-load riscom8 module when device opened.
specialix: Auto-load specialix module when device opened.
video: Auto-load videodev module when device opened.
i2c: Auto-load i2c_dev module when device opened.
mtd: Auto-load mtdchar module when device opened.
paride: Auto-load pt module when device opened.
paride: Auto-load pg module when device opened.
usb: Auto-load cdc_acm module when device opened.
x86: Auto-load msr module when device opened.
x86: Auto-load cpuid module when device opened.
mwave: Auto-load mwave module when device opened.
scsi: Add scsi type modalias to ch.

Tim Gardner (1):
esp: Auto-load esp module when device opened.

arch/x86/kernel/cpuid.c | 1 +
arch/x86/kernel/msr.c | 1 +
drivers/block/paride/pcd.c | 1 +
drivers/block/paride/pf.c | 1 +
drivers/block/paride/pg.c | 1 +
drivers/block/paride/pt.c | 1 +
drivers/char/applicom.c | 1 +
drivers/char/cyclades.c | 2 ++
drivers/char/esp.c | 3 +++
drivers/char/hw_random/core.c | 1 +
drivers/char/mwave/mwavedd.c | 1 +
drivers/char/riscom8.c | 2 ++
drivers/char/specialix.c | 1 +
drivers/char/toshiba.c | 1 +
drivers/connector/connector.c | 2 ++
drivers/i2c/i2c-dev.c | 1 +
drivers/input/mousedev.c | 3 +++
drivers/media/video/v4l2-dev.c | 1 +
drivers/mtd/ftl.c | 2 ++
drivers/mtd/mtdchar.c | 1 +
drivers/mtd/nftlcore.c | 2 ++
drivers/sbus/char/openprom.c | 1 +
drivers/scsi/ch.c | 1 +
drivers/scsi/scsi_transport_iscsi.c | 3 +++
drivers/usb/class/cdc-acm.c | 2 +-
net/bridge/br.c | 2 ++
net/ipv4/netfilter/ip_queue.c | 2 ++
net/ipv6/netfilter/ip6_queue.c | 1 +
net/netlink/af_netlink.c | 2 ++
net/wanrouter/wanmain.c | 1 +
30 files changed, 44 insertions(+), 1 deletions(-)


2009-03-10 16:43:58

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 06/31] connector: Auto-load cn module when socket opened.

The cn module is missing the net-pf-16-proto-11 alias that would cause
it to be auto-loaded when a socket of that type is opened. This patch
adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/connector/connector.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index bf48300..c610089 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -23,6 +23,7 @@
#include <linux/module.h>
#include <linux/list.h>
#include <linux/skbuff.h>
+#include <linux/net.h>
#include <linux/netlink.h>
#include <linux/moduleparam.h>
#include <linux/connector.h>
@@ -35,6 +36,7 @@
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Evgeniy Polyakov <[email protected]>");
MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector.");
+MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_CONNECTOR);

static u32 cn_idx = CN_IDX_CONNECTOR;
static u32 cn_val = CN_VAL_CONNECTOR;
--
1.6.0.5

2009-03-10 16:44:21

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 02/31] netlink: Auto-load af_netlink module when socket opened.

The af_netlink module is missing the net-pf-16 alias that would cause it
to be auto-loaded when a socket of that type is opened. This patch adds
the alias.

While we normally build this module in, some users may choose to
reconfigure their kernel with this as a module.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
net/netlink/af_netlink.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 3ae3cb8..a9d5484 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2007,3 +2007,5 @@ panic:
}

core_initcall(netlink_proto_init);
+
+MODULE_ALIAS_NETPROTO(PF_NETLINK);
--
1.6.0.5

2009-03-10 16:45:14

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 04/31] netfilter: Auto-load ip_queue module when socket opened.

The ip_queue module is missing the net-pf-16-proto-3 alias that would
causae it to be auto-loaded when a socket of that type is opened. This
patch adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
net/ipv4/netfilter/ip_queue.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
index 432ce9d..5f22c91 100644
--- a/net/ipv4/netfilter/ip_queue.c
+++ b/net/ipv4/netfilter/ip_queue.c
@@ -24,6 +24,7 @@
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/security.h>
+#include <linux/net.h>
#include <linux/mutex.h>
#include <net/net_namespace.h>
#include <net/sock.h>
@@ -640,6 +641,7 @@ static void __exit ip_queue_fini(void)
MODULE_DESCRIPTION("IPv4 packet queue handler");
MODULE_AUTHOR("James Morris <[email protected]>");
MODULE_LICENSE("GPL");
+MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_FIREWALL);

module_init(ip_queue_init);
module_exit(ip_queue_fini);
--
1.6.0.5

2009-03-10 16:44:51

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 03/31] wanrouter: Auto-load wanrouter module when socket opened.

The wanrouter module is missing the net-pf-25 alias that would cause it
to be auto-loaded when a socket of that type is opened. This patch adds
the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
net/wanrouter/wanmain.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index 39701de..b1eaa63 100644
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -777,6 +777,7 @@ EXPORT_SYMBOL(register_wan_device);
EXPORT_SYMBOL(unregister_wan_device);

MODULE_LICENSE("GPL");
+MODULE_ALIAS_NETPROTO(PF_WANPIPE);

/*
* End
--
1.6.0.5

2009-03-10 16:44:36

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 01/31] bridge: Auto-load bridge module when socket opened.

The bridge module is missing the net-pf-7 alias that would cause it to
be auto-loaded when a socket of that type is opened. This patch adds
the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
net/bridge/br.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/bridge/br.c b/net/bridge/br.c
index 4d2c1f1..229daee 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -16,6 +16,7 @@
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/init.h>
+#include <linux/net.h>
#include <linux/llc.h>
#include <net/llc.h>
#include <net/stp.h>
@@ -108,3 +109,4 @@ module_init(br_init)
module_exit(br_deinit)
MODULE_LICENSE("GPL");
MODULE_VERSION(BR_VERSION);
+MODULE_ALIAS_NETPROTO(PF_BRIDGE);
--
1.6.0.5

2009-03-10 16:45:40

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 05/31] netfilter: Auto-load ip6_queue module when socket opened.

The ip6_queue module is missing the net-pf-16-proto-13 alias that would
cause it to be auto-loaded when a socket of that type is opened. This
patch adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
net/ipv6/netfilter/ip6_queue.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
index 5859c04..b693f84 100644
--- a/net/ipv6/netfilter/ip6_queue.c
+++ b/net/ipv6/netfilter/ip6_queue.c
@@ -643,6 +643,7 @@ static void __exit ip6_queue_fini(void)

MODULE_DESCRIPTION("IPv6 packet queue handler");
MODULE_LICENSE("GPL");
+MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_IP6_FW);

module_init(ip6_queue_init);
module_exit(ip6_queue_fini);
--
1.6.0.5

2009-03-10 16:46:33

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 15/31] sbus: Auto-load openprom module when device opened.

The openprom module is missing the char-major-10-139 alias that would
cause it to be auto-loaded when a device of that type is opened. This
patch adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/sbus/char/openprom.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c
index 29dc735..124f660 100644
--- a/drivers/sbus/char/openprom.c
+++ b/drivers/sbus/char/openprom.c
@@ -51,6 +51,7 @@ MODULE_AUTHOR("Thomas K. Dyas ([email protected]) and Eddie C. Dost (ecd@sk
MODULE_DESCRIPTION("OPENPROM Configuration Driver");
MODULE_LICENSE("GPL");
MODULE_VERSION("1.0");
+MODULE_ALIAS_MISCDEV(SUN_OPENPROM_MINOR);

/* Private data kept by the driver for each descriptor. */
typedef struct openprom_private_data
--
1.6.0.5

2009-03-10 16:46:18

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 14/31] hw_random: Auto-load rng-core module when device opened.

The rng-core module is missing the char-major-10-183 alias that would
cause it to be auto-loaded when a device of that type is opened. This
patch adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/char/hw_random/core.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index e5d583c..fd7dff2 100644
--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -347,3 +347,4 @@ EXPORT_SYMBOL_GPL(hwrng_unregister);

MODULE_DESCRIPTION("H/W Random Number Generator (RNG) driver");
MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(RNG_MISCDEV_MINOR);
--
1.6.0.5

2009-03-10 16:45:57

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 11/31] mtd: Auto-load nftl module when device opened.

The nftl module is missing the block-major-93-* alias that would cause
it to be auto-loaded when a nftl of that type is opened. This patch
adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/mtd/nftlcore.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c
index d1c4546..ff0a249 100644
--- a/drivers/mtd/nftlcore.c
+++ b/drivers/mtd/nftlcore.c
@@ -20,6 +20,7 @@
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/hdreg.h>
+#include <linux/blkdev.h>

#include <linux/kmod.h>
#include <linux/mtd/mtd.h>
@@ -818,3 +819,4 @@ module_exit(cleanup_nftl);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("David Woodhouse <[email protected]>, Fabrice Bellard <[email protected]> et al.");
MODULE_DESCRIPTION("Support code for NAND Flash Translation Layer, used on M-Systems DiskOnChip 2000 and Millennium");
+MODULE_ALIAS_BLOCKDEV_MAJOR(NFTL_MAJOR);
--
1.6.0.5

2009-03-10 16:46:50

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 16/31] applicom: Auto-load applicom module when device opened.

The applicom module is missing the char-major-10-157 alias that would
cause it to be auto-loaded when a device of that type is opened. This
patch adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/char/applicom.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index 05674fe..73a0765 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -75,6 +75,7 @@ MODULE_DEVICE_TABLE(pci, applicom_pci_tbl);
MODULE_AUTHOR("David Woodhouse & Applicom International");
MODULE_DESCRIPTION("Driver for Applicom Profibus card");
MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(AC_MINOR);

MODULE_SUPPORTED_DEVICE("ac");

--
1.6.0.5

2009-03-10 16:47:11

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 18/31] cyclades: Auto-load cyclades module when device opened.

The cyclades module is missing the char-major-19-* alias that would
cause it to be auto-loaded when a device of that type is opened. This
patch adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/char/cyclades.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 6a59f72..4e89d49 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -646,6 +646,7 @@
#include <linux/spinlock.h>
#include <linux/bitops.h>
#include <linux/firmware.h>
+#include <linux/device.h>

#include <asm/system.h>
#include <linux/io.h>
@@ -5422,3 +5423,4 @@ module_exit(cy_cleanup_module);

MODULE_LICENSE("GPL");
MODULE_VERSION(CY_VERSION);
+MODULE_ALIAS_CHARDEV_MAJOR(CYCLADES_MAJOR);
--
1.6.0.5

2009-03-10 16:47:31

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 28/31] x86: Auto-load cpuid module when device opened.

The cpuid module is missing the char-major-203-* alias that would cause
it to be auto-loaded when a device of that type is opened. This patch
adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
arch/x86/kernel/cpuid.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 2ac1f0c..8211f3a 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -237,3 +237,4 @@ module_exit(cpuid_exit);
MODULE_AUTHOR("H. Peter Anvin <[email protected]>");
MODULE_DESCRIPTION("x86 generic CPUID driver");
MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV_MAJOR(CPUID_MAJOR);
--
1.6.0.5

2009-03-10 16:48:24

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 31/31] scsi: Add scsi type modalias to ch.

The ch module is missing the scsi:t-0x08* alias that would cause it to
be auto-loaded when a device of that type if found by udev, requiring
udev to have a specific rule just for this one module. This patch adds
the alias.

Signed-off-by: Scott James Remnant <[email protected]>
---
drivers/scsi/ch.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c
index af97254..7b1633a 100644
--- a/drivers/scsi/ch.c
+++ b/drivers/scsi/ch.c
@@ -41,6 +41,7 @@ MODULE_DESCRIPTION("device driver for scsi media changer devices");
MODULE_AUTHOR("Gerd Knorr <[email protected]>");
MODULE_LICENSE("GPL");
MODULE_ALIAS_CHARDEV_MAJOR(SCSI_CHANGER_MAJOR);
+MODULE_ALIAS_SCSI_DEVICE(TYPE_MEDIUM_CHANGER);

static int init = 1;
module_param(init, int, 0444);
--
1.6.0.5

2009-03-10 16:47:47

by Tim Gardner

[permalink] [raw]
Subject: [PATCH 29/31] esp: Auto-load esp module when device opened.

The esp module is missing the char-major-57-* alias that would cause it
to be auto-loaded when a device of that type is opened. This patch adds
the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/char/esp.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/char/esp.c b/drivers/char/esp.c
index 45ec263..0a643f6 100644
--- a/drivers/char/esp.c
+++ b/drivers/char/esp.c
@@ -51,6 +51,7 @@
#include <linux/serialP.h>
#include <linux/serial_reg.h>
#include <linux/major.h>
+#include <linux/device.h>
#include <linux/string.h>
#include <linux/fcntl.h>
#include <linux/ptrace.h>
@@ -85,6 +86,8 @@ static unsigned int rx_timeout = ESP_RX_TMOUT;
static unsigned int pio_threshold = ESP_PIO_THRESHOLD;

MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV_MAJOR(ESP_IN_MAJOR);
+

module_param_array(irq, int, NULL, 0);
module_param_array(divisor, uint, NULL, 0);
--
1.6.0.5

2009-03-10 16:48:40

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 07/31] scsi: Auto-load scsi_transport_iscsi module when socket opened.

The scsi_transport_iscsi module is missing the net-pf-16-proto-8 alias
that would cause it to be auto-loaded when a socket of that type is
opened. This patch adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/scsi/scsi_transport_iscsi.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 75c9297..056fdae 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -22,6 +22,8 @@
*/
#include <linux/module.h>
#include <linux/mutex.h>
+#include <linux/net.h>
+#include <linux/netlink.h>
#include <net/tcp.h>
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
@@ -2013,3 +2015,4 @@ MODULE_AUTHOR("Mike Christie <[email protected]>, "
MODULE_DESCRIPTION("iSCSI Transport Interface");
MODULE_LICENSE("GPL");
MODULE_VERSION(ISCSI_TRANSPORT_VERSION);
+MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_ISCSI);
--
1.6.0.5

2009-03-10 16:48:56

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 26/31] usb: Auto-load cdc_acm module when device opened.

The cdc_acm module is missing the char-major-166-* alias that would
cause it to be auto-loaded when a device of that type is opened. This
patch adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/usb/class/cdc-acm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index b3d5a23..85f22c6 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1493,4 +1493,4 @@ module_exit(acm_exit);
MODULE_AUTHOR( DRIVER_AUTHOR );
MODULE_DESCRIPTION( DRIVER_DESC );
MODULE_LICENSE("GPL");
-
+MODULE_ALIAS_CHARDEV_MAJOR(ACM_TTY_MAJOR);
--
1.6.0.5

2009-03-10 16:48:03

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 27/31] x86: Auto-load msr module when device opened.

The msr module is missing the char-major-202-* alias that would cause it
to be auto-loaded when a device of that type is opened. This patch adds
the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
arch/x86/kernel/msr.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 7262666..7d2bb98 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -249,3 +249,4 @@ module_exit(msr_exit)
MODULE_AUTHOR("H. Peter Anvin <[email protected]>");
MODULE_DESCRIPTION("x86 generic MSR driver");
MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV_MAJOR(MSR_MAJOR);
--
1.6.0.5

2009-03-10 16:49:21

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 30/31] mwave: Auto-load mwave module when device opened.

The mwave module is missing the char-major-10-219 alias that would cause
it to be auto-loaded when a device of that type is opened. This patch
adds the alias

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/char/mwave/mwavedd.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/char/mwave/mwavedd.c b/drivers/char/mwave/mwavedd.c
index 94ad2c3..cf9e383 100644
--- a/drivers/char/mwave/mwavedd.c
+++ b/drivers/char/mwave/mwavedd.c
@@ -67,6 +67,7 @@
MODULE_DESCRIPTION("3780i Advanced Communications Processor (Mwave) driver");
MODULE_AUTHOR("Mike Sullivan and Paul Schroeder");
MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(MWAVE_MINOR);

/*
* These parameters support the setting of MWave resources. Note that no
--
1.6.0.5

2009-03-10 16:50:20

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 17/31] toshiba: Auto-load toshiba module when device opened.

The toshiba module is missing the char-major-10-181 alias that would
cause it to be auto-loaded when a device of that type is opened. This
patch adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/char/toshiba.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/char/toshiba.c b/drivers/char/toshiba.c
index 663cd15..7212f5f 100644
--- a/drivers/char/toshiba.c
+++ b/drivers/char/toshiba.c
@@ -77,6 +77,7 @@ MODULE_LICENSE("GPL");
MODULE_AUTHOR("Jonathan Buzzard <[email protected]>");
MODULE_DESCRIPTION("Toshiba laptop SMM driver");
MODULE_SUPPORTED_DEVICE("toshiba");
+MODULE_ALIAS_MISCDEV(TOSH_MINOR_DEV);

static int tosh_fn;
module_param_named(fn, tosh_fn, int, 0);
--
1.6.0.5

2009-03-10 16:49:52

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 20/31] specialix: Auto-load specialix module when device opened.

The specialix module is missing the char-major-75-* alias that would
cause it to be auto-loaded when a device of that type is opened. This
patch adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/char/specialix.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index 3c67c3d..e72be41 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -2365,3 +2365,4 @@ module_init(specialix_init_module);
module_exit(specialix_exit_module);

MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV_MAJOR(SPECIALIX_NORMAL_MAJOR);
--
1.6.0.5

2009-03-10 16:49:36

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 22/31] i2c: Auto-load i2c_dev module when device opened.

The i2c_dev module is missing the char-major-89-* alias that would cause
it to be auto-loaded when a device of that type is opened. This patch
adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/i2c/i2c-dev.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 7e13d2d..f3f83ba 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -618,6 +618,7 @@ MODULE_AUTHOR("Frodo Looijaard <[email protected]> and "
"Simon G. Vogl <[email protected]>");
MODULE_DESCRIPTION("I2C /dev entries driver");
MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV_MAJOR(I2C_MAJOR);

module_init(i2c_dev_init);
module_exit(i2c_dev_exit);
--
1.6.0.5

2009-03-10 16:50:55

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 24/31] paride: Auto-load pt module when device opened.

The pt module is missing the char-major-96-* alias that would cause it
to be auto-loaded when a device of that type is opened. This patch adds
the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/block/paride/pt.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c
index 1e4006e..e298e75 100644
--- a/drivers/block/paride/pt.c
+++ b/drivers/block/paride/pt.c
@@ -1008,5 +1008,6 @@ static void __exit pt_exit(void)
}

MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV_MAJOR(PT_MAJOR);
module_init(pt_init)
module_exit(pt_exit)
--
1.6.0.5

2009-03-10 16:50:40

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 25/31] paride: Auto-load pg module when device opened.

The pg module is missing the char-major-97-* alias that would cause it
to be auto-loaded when a device of that type is opened. This patch adds
the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/block/paride/pg.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c
index c397b3d..442853f 100644
--- a/drivers/block/paride/pg.c
+++ b/drivers/block/paride/pg.c
@@ -718,5 +718,6 @@ static void __exit pg_exit(void)
}

MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV_MAJOR(PG_MAJOR);
module_init(pg_init)
module_exit(pg_exit)
--
1.6.0.5

2009-03-10 16:51:18

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 23/31] mtd: Auto-load mtdchar module when device opened.

The mtdchar module is missing the char-major-90-* alias that would cause
it to be auto-loaded when a device of that type is opened. This patch
adds the alia..

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/mtd/mtdchar.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index e9ec59e..2c8a16f 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -825,3 +825,4 @@ module_exit(cleanup_mtdchar);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("David Woodhouse <[email protected]>");
MODULE_DESCRIPTION("Direct character-device access to MTD devices");
+MODULE_ALIAS_CHARDEV_MAJOR(MTD_CHAR_MAJOR);
--
1.6.0.5

2009-03-10 16:51:34

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 08/31] mtd: Auto-load ftl module when device opened.

The ftl module is missing the block-major-44-* alias that would cause it
to be auto-loaded when a device of that type is opened. This patch adds
the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/mtd/ftl.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
index a790c06..0af7eee 100644
--- a/drivers/mtd/ftl.c
+++ b/drivers/mtd/ftl.c
@@ -69,6 +69,7 @@
#include <linux/init.h>
#include <linux/hdreg.h>
#include <linux/vmalloc.h>
+#include <linux/blkdev.h>
#include <linux/blkpg.h>
#include <asm/uaccess.h>

@@ -1116,3 +1117,4 @@ module_exit(cleanup_ftl);
MODULE_LICENSE("Dual MPL/GPL");
MODULE_AUTHOR("David Hinds <[email protected]>");
MODULE_DESCRIPTION("Support code for Flash Translation Layer, used on PCMCIA devices");
+MODULE_ALIAS_BLOCKDEV_MAJOR(FTL_MAJOR);
--
1.6.0.5

2009-03-10 16:52:30

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 09/31] paride: Auto-load pcd module when device opened.

The pcd module is missing the block-major-46-* alias that would cause it
to be auto-loaded when a device of that type is opened. This patch adds
the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/block/paride/pcd.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c
index e91d4b4..d8a31c5 100644
--- a/drivers/block/paride/pcd.c
+++ b/drivers/block/paride/pcd.c
@@ -967,5 +967,6 @@ static void __exit pcd_exit(void)
}

MODULE_LICENSE("GPL");
+MODULE_ALIAS_BLOCKDEV_MAJOR(PCD_MAJOR);
module_init(pcd_init)
module_exit(pcd_exit)
--
1.6.0.5

2009-03-10 16:53:03

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 13/31] input: Auto-load mousedev module when /dev/input/mice opened.

The mousedev module is missing the char-major-13-31 alias that would
cause it to be auto-loaded when the /dev/input/mice device is opened.
This patch adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/input/mousedev.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index dfde8ee..a290e90 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -29,6 +29,7 @@
MODULE_AUTHOR("Vojtech Pavlik <[email protected]>");
MODULE_DESCRIPTION("Mouse (ExplorerPS/2) device interfaces");
MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV(INPUT_MAJOR, MOUSEDEV_MIX);

#ifndef CONFIG_INPUT_MOUSEDEV_SCREEN_X
#define CONFIG_INPUT_MOUSEDEV_SCREEN_X 1024
--
1.6.0.5

2009-03-10 16:52:46

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 12/31] input: Auto-load mousedev module when psaux device opened.

The mousedev module is missing the char-major-10-1 alias that would cause
it to be auto-loaded when the /dev/psaux device is opened. This patch
adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/input/mousedev.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index ef99a7e..dfde8ee 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -1065,6 +1065,8 @@ static struct miscdevice psaux_mouse = {
PSMOUSE_MINOR, "psaux", &mousedev_fops
};
static int psaux_registered;
+
+MODULE_ALIAS_MISCDEV(PSMOUSE_MINOR);
#endif

static int __init mousedev_init(void)
--
1.6.0.5

2009-03-10 16:51:50

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 21/31] video: Auto-load videodev module when device opened.

The videodev module is missing the char-major-81-* alias that would
cause it to be auto-loaded when a device of that type is opened. This
patch adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/media/video/v4l2-dev.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index 13f87c2..7de7e9a 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -582,6 +582,7 @@ module_exit(videodev_exit)
MODULE_AUTHOR("Alan Cox, Mauro Carvalho Chehab <[email protected]>");
MODULE_DESCRIPTION("Device registrar for Video4Linux drivers v2");
MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV_MAJOR(VIDEO_MAJOR);


/*
--
1.6.0.5

2009-03-10 16:52:14

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 10/31] paride: Auto-load pf module when device opened.

The pf module is missing the block-major-47-* alias that would cause it
to be auto-loaded when a device of that type is opened. This patch adds
the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/block/paride/pf.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
index bef3b99..8acbc43 100644
--- a/drivers/block/paride/pf.c
+++ b/drivers/block/paride/pf.c
@@ -988,5 +988,6 @@ static void __exit pf_exit(void)
}

MODULE_LICENSE("GPL");
+MODULE_ALIAS_BLOCKDEV_MAJOR(PF_MAJOR);
module_init(pf_init)
module_exit(pf_exit)
--
1.6.0.5

2009-03-10 16:53:29

by Scott James Remnant

[permalink] [raw]
Subject: [PATCH 19/31] riscom8: Auto-load riscom8 module when device opened.

The riscom8 module is missing the char-major-48-* alias that would cause
it to be auto-loaded when a device of that type is opened. This patch
adds the alias.

Signed-off-by: Scott James Remnant <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
---
drivers/char/riscom8.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index 9af8d74..2176604 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -48,6 +48,7 @@
#include <linux/delay.h>
#include <linux/tty_flip.h>
#include <linux/spinlock.h>
+#include <linux/device.h>

#include <linux/uaccess.h>

@@ -1524,6 +1525,7 @@ module_param(iobase2, int, 0);
module_param(iobase3, int, 0);

MODULE_LICENSE("GPL");
+MODULE_ALIAS_CHARDEV_MAJOR(RISCOM8_NORMAL_MAJOR);
#endif /* MODULE */

/*
--
1.6.0.5

2009-03-10 16:56:35

by Jean Delvare

[permalink] [raw]
Subject: Re: [PATCH 22/31] i2c: Auto-load i2c_dev module when device opened.

Scott,

Your clock is off by a significant number of days, isn't it?

On Mon, 2 Mar 2009 18:41:51 +0000, Scott James Remnant wrote:
> The i2c_dev module is missing the char-major-89-* alias that would cause
> it to be auto-loaded when a device of that type is opened. This patch
> adds the alias.

Why not, however this is pretty pointless nowadays as /dev nodes tend
to be created dynamically by udev, so there is no way i2c-dev will
auto-load.

> Signed-off-by: Scott James Remnant <[email protected]>
> Signed-off-by: Tim Gardner <[email protected]>
> ---
> drivers/i2c/i2c-dev.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
> index 7e13d2d..f3f83ba 100644
> --- a/drivers/i2c/i2c-dev.c
> +++ b/drivers/i2c/i2c-dev.c
> @@ -618,6 +618,7 @@ MODULE_AUTHOR("Frodo Looijaard <[email protected]> and "
> "Simon G. Vogl <[email protected]>");
> MODULE_DESCRIPTION("I2C /dev entries driver");
> MODULE_LICENSE("GPL");
> +MODULE_ALIAS_CHARDEV_MAJOR(I2C_MAJOR);
>
> module_init(i2c_dev_init);
> module_exit(i2c_dev_exit);


--
Jean Delvare

2009-03-10 16:58:39

by Rogier Wolff

[permalink] [raw]
Subject: Re: [PATCH 20/31] specialix: Auto-load specialix module when device opened.

On Mon, Mar 02, 2009 at 06:39:40PM +0000, Scott James Remnant wrote:
> The specialix module is missing the char-major-75-* alias that would
> cause it to be auto-loaded when a device of that type is opened. This
> patch adds the alias.
>
> Signed-off-by: Scott James Remnant <[email protected]>
> Signed-off-by: Tim Gardner <[email protected]>
Signed-off-by: Roger Wolff <[email protected]>

--
** [email protected] ** http://www.BitWizard.nl/ ** +31-15-2600998 **
** Delftechpark 26 2628 XH Delft, The Netherlands. KVK: 27239233 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
Q: It doesn't work. A: Look buddy, doesn't work is an ambiguous statement.
Does it sit on the couch all day? Is it unemployed? Please be specific!
Define 'it' and what it isn't doing. --------- Adapted from lxrbot FAQ

2009-03-10 17:01:19

by Scott James Remnant

[permalink] [raw]
Subject: Re: [PATCH 22/31] i2c: Auto-load i2c_dev module when device opened.

On Tue, 2009-03-10 at 17:56 +0100, Jean Delvare wrote:

> Your clock is off by a significant number of days, isn't it?
>
No, I've just been carefully testing them - and then waited until they
were in the jaunty kernel and a couple of thousand other users
not-so-carefully tested them too <g>

Scott
--
Scott James Remnant
[email protected]


Attachments:
signature.asc (197.00 B)
This is a digitally signed message part

2009-03-10 17:03:34

by Matthias Schwarzott

[permalink] [raw]
Subject: Re: [PATCH 21/31] video: Auto-load videodev module when device opened.

On Montag, 2. M?rz 2009, Scott James Remnant wrote:
Hi Scott!

> The videodev module is missing the char-major-81-* alias that would
> cause it to be auto-loaded when a device of that type is opened. This
> patch adds the alias.

The patch looks fine, but if videodev is not yet loaded, will loading videodev
get any devices registered? For that to happen normally some pci video bridge
adapter driver is needed, and that registers at videodev module.

Without modprobe.conf tricks this still is not loaded then.

Regards
Matthias

2009-03-10 17:11:19

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 26/31] usb: Auto-load cdc_acm module when device opened.

On Mon, Mar 02, 2009 at 06:46:15PM +0000, Scott James Remnant wrote:
> The cdc_acm module is missing the char-major-166-* alias that would
> cause it to be auto-loaded when a device of that type is opened. This
> patch adds the alias.

You really have users that are using a static /dev that need this kind
of fix? I thought we were phasing out the char-major- aliases as they
don't make any sense anymore.

thanks,

greg k-h

2009-03-10 17:19:19

by Scott James Remnant

[permalink] [raw]
Subject: Re: [PATCH 26/31] usb: Auto-load cdc_acm module when device opened.

On Tue, 2009-03-10 at 10:08 -0700, Greg KH wrote:

> On Mon, Mar 02, 2009 at 06:46:15PM +0000, Scott James Remnant wrote:
> > The cdc_acm module is missing the char-major-166-* alias that would
> > cause it to be auto-loaded when a device of that type is opened. This
> > patch adds the alias.
>
> You really have users that are using a static /dev that need this kind
> of fix? I thought we were phasing out the char-major- aliases as they
> don't make any sense anymore.
>
I don't think so.

But since we had aliases to support users, I wasn't going to drop them
without at least sending a patch upstream to see if they cared about
such things.

(and there are many modules which do have the char-major aliases, so at
least someone is trying to put them in).

As noted in the cover, feel free to drop these - I can use your reply
when a user complains <g>

Scott
--
Scott James Remnant
[email protected]


Attachments:
signature.asc (197.00 B)
This is a digitally signed message part

2009-03-10 17:27:52

by Stephen Hemminger

[permalink] [raw]
Subject: Re: [PATCH 01/31] bridge: Auto-load bridge module when socket opened.

On Mon, 2 Mar 2009 16:40:10 +0000
Scott James Remnant <[email protected]> wrote:

> The bridge module is missing the net-pf-7 alias that would cause it to
> be auto-loaded when a socket of that type is opened. This patch adds
> the alias.
>
> Signed-off-by: Scott James Remnant <[email protected]>
> Signed-off-by: Tim Gardner <[email protected]>
> ---
> net/bridge/br.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/net/bridge/br.c b/net/bridge/br.c
> index 4d2c1f1..229daee 100644
> --- a/net/bridge/br.c
> +++ b/net/bridge/br.c
> @@ -16,6 +16,7 @@
> #include <linux/netdevice.h>
> #include <linux/etherdevice.h>
> #include <linux/init.h>
> +#include <linux/net.h>
> #include <linux/llc.h>
> #include <net/llc.h>
> #include <net/stp.h>
> @@ -108,3 +109,4 @@ module_init(br_init)
> module_exit(br_deinit)
> MODULE_LICENSE("GPL");
> MODULE_VERSION(BR_VERSION);
> +MODULE_ALIAS_NETPROTO(PF_BRIDGE);

Hmm. It looks okay, but there is not real direct socket interface
for PF_BRIDGE/AF_BRIDGE.

2009-03-10 17:46:44

by Jean Delvare

[permalink] [raw]
Subject: Re: [PATCH 00/31] *** SUBJECT HERE ***

On Tue, 10 Mar 2009 16:23:48 +0000, Scott James Remnant wrote:
> module-init-tools on most distributions ships with a file that contains a
> large list of aliases to auto-load modules on demand, either by matching
> a MODALIAS string from the kernel uevent, or by the {block,char}-major-*
> aliases requested by the kernel when device nodes are opened.
>
> There are convenient macros for defining these inside the kernel modules
> themselves, so they are exported by file2alias and put into the files
> created by depmod. This is far preferable to a file in another package
> that has to be parsed every time modprobe is called (many, many times
> on a typical boot) and may get out of date.

I don't get how it could make any difference in terms of performance.
As far as I know, all the module aliases that come from the kernel are
assembled into /lib/modules/$version/modules.alias when the kernel is
installed, and that file must be processed by modprobe the exact same
way another configuration file would. Or am I missing something?

--
Jean Delvare

2009-03-10 17:50:11

by Scott James Remnant

[permalink] [raw]
Subject: Re: [PATCH 00/31] *** SUBJECT HERE ***

On Tue, 2009-03-10 at 18:46 +0100, Jean Delvare wrote:

> I don't get how it could make any difference in terms of performance.
> As far as I know, all the module aliases that come from the kernel are
> assembled into /lib/modules/$version/modules.alias when the kernel is
> installed, and that file must be processed by modprobe the exact same
> way another configuration file would. Or am I missing something?
>
With current modprobe those files are turned into a binary index that
can be read and processed *much* faster.

Scott
--
Scott James Remnant
[email protected]


Attachments:
signature.asc (197.00 B)
This is a digitally signed message part

2009-03-10 17:56:20

by Jean Delvare

[permalink] [raw]
Subject: Re: [PATCH 00/31] Add a lot of module alias statements

On Tue, 10 Mar 2009 17:49:51 +0000, Scott James Remnant wrote:
> On Tue, 2009-03-10 at 18:46 +0100, Jean Delvare wrote:
>
> > I don't get how it could make any difference in terms of performance.
> > As far as I know, all the module aliases that come from the kernel are
> > assembled into /lib/modules/$version/modules.alias when the kernel is
> > installed, and that file must be processed by modprobe the exact same
> > way another configuration file would. Or am I missing something?
>
> With current modprobe those files are turned into a binary index that
> can be read and processed *much* faster.

What would prevent the same binary index from being generated from
user-provided module aliases?

--
Jean Delvare

2009-03-10 18:13:38

by Scott James Remnant

[permalink] [raw]
Subject: Re: [PATCH 00/31] Add a lot of module alias statements

On Tue, 2009-03-10 at 18:55 +0100, Jean Delvare wrote:

> On Tue, 10 Mar 2009 17:49:51 +0000, Scott James Remnant wrote:
> > On Tue, 2009-03-10 at 18:46 +0100, Jean Delvare wrote:
> >
> > > I don't get how it could make any difference in terms of performance.
> > > As far as I know, all the module aliases that come from the kernel are
> > > assembled into /lib/modules/$version/modules.alias when the kernel is
> > > installed, and that file must be processed by modprobe the exact same
> > > way another configuration file would. Or am I missing something?
> >
> > With current modprobe those files are turned into a binary index that
> > can be read and processed *much* faster.
>
> What would prevent the same binary index from being generated from
> user-provided module aliases?
>
Why go to all that effort when adding the alias to the kernel is just a
one-line change, and then it shows up along with all of the other
aliases that depmod generates the existing binary index from?

Scott
--
Scott James Remnant
[email protected]


Attachments:
signature.asc (197.00 B)
This is a digitally signed message part

2009-03-10 18:22:28

by Kay Sievers

[permalink] [raw]
Subject: Re: [PATCH 00/31] Add a lot of module alias statements

On Tue, Mar 10, 2009 at 19:13, Scott James Remnant <[email protected]> wrote:
> On Tue, 2009-03-10 at 18:55 +0100, Jean Delvare wrote:
>> On Tue, 10 Mar 2009 17:49:51 +0000, Scott James Remnant wrote:
>> > On Tue, 2009-03-10 at 18:46 +0100, Jean Delvare wrote:
>> >
>> > > I don't get how it could make any difference in terms of performance.
>> > > As far as I know, all the module aliases that come from the kernel are
>> > > assembled into /lib/modules/$version/modules.alias when the kernel is
>> > > installed, and that file must be processed by modprobe the exact same
>> > > way another configuration file would. Or am I missing something?
>> >
>> > With current modprobe those files are turned into a binary index that
>> > can be read and processed *much* faster.
>>
>> What would prevent the same binary index from being generated from
>> user-provided module aliases?
>>
> Why go to all that effort when adding the alias to the kernel is just a
> one-line change, and then it shows up along with all of the other
> aliases that depmod generates the existing binary index from?

The problem, with a new kernel or module, we know for forever, that we
have to run depmod, but this is not the case for depmod config files,
and not really to manage, to require a binary index update here.

But the main point is that we want to put information where it
belongs: in the module itself. Just look at the crap we ship in
/etc/modprobe* and you know that externally maintained configs for
kernel modules just don't work. :)

Thanks,
Kay

2009-03-10 18:34:21

by Kay Sievers

[permalink] [raw]
Subject: Re: [PATCH 26/31] usb: Auto-load cdc_acm module when device opened.

On Tue, Mar 10, 2009 at 18:18, Scott James Remnant <[email protected]> wrote:
> On Tue, 2009-03-10 at 10:08 -0700, Greg KH wrote:
>> On Mon, Mar 02, 2009 at 06:46:15PM +0000, Scott James Remnant wrote:
>> > The cdc_acm module is missing the char-major-166-* alias that would
>> > cause it to be auto-loaded when a device of that type is opened.  This
>> > patch adds the alias.
>>
>> You really have users that are using a static /dev that need this kind
>> of fix?  I thought we were phasing out the char-major- aliases as they
>> don't make any sense anymore.
>>
> I don't think so.
>
> But since we had aliases to support users, I wasn't going to drop them
> without at least sending a patch upstream to see if they cared about
> such things.
>
> (and there are many modules which do have the char-major aliases, so at
> least someone is trying to put them in).
>
> As noted in the cover, feel free to drop these - I can use your reply
> when a user complains <g>

Yeah, we should put them into the module, where they belong, or just
remove them all. :) They surely do not belong into disconnected
userspace config files.

We are going to delete all kernel module configurations from the
userspace packages, and the only alternative for the kernel to provide
the autoload-by-open facility to users who like to use that, would be
that the kernel installs a modprobe config file which is maintained by
the kernel maintainers. Not sure if someone wants to do that instead.
:)

The new modprobe does not really care how many aliases we have, the
time to lookup the aliases depends mainly on the length of the alias
lookup string, not the number of strings to match against, so this
should all be fine.

Thanks,
Kay

2009-03-10 20:38:35

by Jean Delvare

[permalink] [raw]
Subject: Re: [PATCH 00/31] Add a lot of module alias statements

On Tue, 10 Mar 2009 19:22:16 +0100, Kay Sievers wrote:
> On Tue, Mar 10, 2009 at 19:13, Scott James Remnant <[email protected]> wrote:
> > On Tue, 2009-03-10 at 18:55 +0100, Jean Delvare wrote:
> >> On Tue, 10 Mar 2009 17:49:51 +0000, Scott James Remnant wrote:
> >> > With current modprobe those files are turned into a binary index that
> >> > can be read and processed *much* faster.
> >>
> >> What would prevent the same binary index from being generated from
> >> user-provided module aliases?
> >
> > Why go to all that effort when adding the alias to the kernel is just a
> > one-line change, and then it shows up along with all of the other
> > aliases that depmod generates the existing binary index from?

Well, _you_ used the performance improvement as one of the arguments to
explain why your patches would be good to have. It's only fair to let
us know if and why there is a relation between where the modalias comes
from (kernel module or user config) and the possibility to improve
performance.

> The problem, with a new kernel or module, we know for forever, that we
> have to run depmod, but this is not the case for depmod config files,
> and not really to manage, to require a binary index update here.

You are not really clear, sorry. As Scott said before, modprobe is run
many many times during boot, so it would seem fair to build a binary
index for all configuration files if it helps with performance. A
simple time comparison between all configuration files and the index
should be much faster than parsing all configuration files each time
modprobe is run, shouldn't it?

> But the main point is that we want to put information where it
> belongs: in the module itself. Just look at the crap we ship in
> /etc/modprobe* and you know that externally maintained configs for
> kernel modules just don't work. :)

This I certainly agree with (for module aliases which do have an
interest, that is), no question about that.

--
Jean Delvare

2009-03-10 20:54:00

by Kay Sievers

[permalink] [raw]
Subject: Re: [PATCH 00/31] Add a lot of module alias statements

On Tue, Mar 10, 2009 at 21:38, Jean Delvare <[email protected]> wrote:
> On Tue, 10 Mar 2009 19:22:16 +0100, Kay Sievers wrote:
>> On Tue, Mar 10, 2009 at 19:13, Scott James Remnant <[email protected]> wrote:
>> > On Tue, 2009-03-10 at 18:55 +0100, Jean Delvare wrote:
>> >> On Tue, 10 Mar 2009 17:49:51 +0000, Scott James Remnant wrote:
>> >> > With current modprobe those files are turned into a binary index that
>> >> > can be read and processed *much* faster.
>> >>
>> >> What would prevent the same binary index from being generated from
>> >> user-provided module aliases?
>> >
>> > Why go to all that effort when adding the alias to the kernel is just a
>> > one-line change, and then it shows up along with all of the other
>> > aliases that depmod generates the existing binary index from?
>
> Well, _you_ used the performance improvement as one of the arguments to
> explain why your patches would be good to have. It's only fair to let
> us know if and why there is a relation between where the modalias comes
> from (kernel module or user config) and the possibility to improve
> performance.
>
>> The problem, with a new kernel or module, we know for forever, that we
>> have to run depmod, but this is not the case for depmod config files,
>> and not really to manage, to require a binary index update here.
>
> You are not really clear, sorry. As Scott said before, modprobe is run
> many many times during boot, so it would seem fair to build a binary
> index for all configuration files if it helps with performance. A
> simple time comparison between all configuration files and the index
> should be much faster than parsing all configuration files each time
> modprobe is run, shouldn't it?

It's the long list of fnmatch() calls which is expensive, not the
reading/parsing of the files. It could certainly be implemented, but
it would heavily complicate things. You would need to ignore the
binary index if one config file does not match the current index, or
re-generate it silently, or do other rather complicated stuff to make
things predictable. We would likely better go with a modprobe daemon,
than doing anything like this. But the goal is to have almost no
config files, so we do not need complex optimizations for them. At
least that looks like the best compromise today. :)

>> But the main point is that we want to put information where it
>> belongs: in the module itself. Just look at the crap we ship in
>> /etc/modprobe* and you know that externally maintained configs for
>> kernel modules just don't work. :)
>
> This I certainly agree with (for module aliases which do have an
> interest, that is), no question about that.

Yeah, and there should only be a few things needed. Most of the
content of /etc/modprobe* are missing kernel aliases, module options
which should be made the default in the module, and kernel driver bugs
which should be fixed in the kernel, not in module config files.

Thanks,
Kay

2009-03-11 13:46:19

by Alan

[permalink] [raw]
Subject: Re: [PATCH 29/31] esp: Auto-load esp module when device opened.

On Wed, 4 Mar 2009 20:55:52 -0700
Tim Gardner <[email protected]> wrote:

> The esp module is missing the char-major-57-* alias that would cause it
> to be auto-loaded when a device of that type is opened. This patch adds
> the alias.

NAK - the default esp behaviour is to do unsafe ISA probes to find the
ports. We don't want it autoloading therefore.

2009-03-11 13:50:23

by Alan

[permalink] [raw]
Subject: Re: [PATCH 30/31] mwave: Auto-load mwave module when device opened.

On Thu, 5 Mar 2009 15:31:24 +0000
Scott James Remnant <[email protected]> wrote:

> The mwave module is missing the char-major-10-219 alias that would cause
> it to be auto-loaded when a device of that type is opened. This patch
> adds the alias

NAK - another one we don't want autoprobing by default.

2009-03-11 17:02:29

by Tim Gardner

[permalink] [raw]
Subject: Re: [PATCH 29/31] esp: Auto-load esp module when device opened.

Alan Cox wrote:
> On Wed, 4 Mar 2009 20:55:52 -0700
> Tim Gardner <[email protected]> wrote:
>
>> The esp module is missing the char-major-57-* alias that would cause it
>> to be auto-loaded when a device of that type is opened. This patch adds
>> the alias.
>
> NAK - the default esp behaviour is to do unsafe ISA probes to find the
> ports. We don't want it autoloading therefore.
>

Good point. Its been awhile since I had to think about ISA probing.

--
Tim Gardner [email protected]

2009-03-13 21:26:49

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 02/31] netlink: Auto-load af_netlink module when socket opened.

From: Scott James Remnant <[email protected]>
Date: Mon, 2 Mar 2009 16:44:00 +0000

> The af_netlink module is missing the net-pf-16 alias that would cause it
> to be auto-loaded when a socket of that type is opened. This patch adds
> the alias.
>
> While we normally build this module in, some users may choose to
> reconfigure their kernel with this as a module.
>
> Signed-off-by: Scott James Remnant <[email protected]>
> Signed-off-by: Tim Gardner <[email protected]>

If you can get netlink to be built modular, impressive. :-)

It's always built statically into the kernel so there is no
reason for this patch.

2009-03-13 21:27:40

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 01/31] bridge: Auto-load bridge module when socket opened.

From: Scott James Remnant <[email protected]>
Date: Mon, 2 Mar 2009 16:40:10 +0000

> The bridge module is missing the net-pf-7 alias that would cause it to
> be auto-loaded when a socket of that type is opened. This patch adds
> the alias.
>
> Signed-off-by: Scott James Remnant <[email protected]>
> Signed-off-by: Tim Gardner <[email protected]>

Bridging has no sockets, so this patch won't do anything.

Did you verify that these changes actually do something?
Or did you blindly run around peppering source files with
these annotations?

2009-03-13 21:28:54

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 03/31] wanrouter: Auto-load wanrouter module when socket opened.

From: Scott James Remnant <[email protected]>
Date: Mon, 2 Mar 2009 16:47:46 +0000

> The wanrouter module is missing the net-pf-25 alias that would cause it
> to be auto-loaded when a socket of that type is opened. This patch adds
> the alias.
>
> Signed-off-by: Scott James Remnant <[email protected]>
> Signed-off-by: Tim Gardner <[email protected]>

This module has no sockets, this patch doesn't do anything.

These patches really stink, and have been prepared in a really
careless manner, sorry.

2009-03-13 21:30:55

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 15/31] sbus: Auto-load openprom module when device opened.

From: Scott James Remnant <[email protected]>
Date: Mon, 2 Mar 2009 18:23:13 +0000

> The openprom module is missing the char-major-10-139 alias that would
> cause it to be auto-loaded when a device of that type is opened. This
> patch adds the alias.
>
> Signed-off-by: Scott James Remnant <[email protected]>
> Signed-off-by: Tim Gardner <[email protected]>

Although I am sure you didn't test this, this patch is actually
correct so applied.

Thanks.

2009-03-13 22:12:28

by Stephen Hemminger

[permalink] [raw]
Subject: Re: [PATCH 01/31] bridge: Auto-load bridge module when socket opened.

On Fri, 13 Mar 2009 14:27:18 -0700 (PDT)
David Miller <[email protected]> wrote:

> From: Scott James Remnant <[email protected]>
> Date: Mon, 2 Mar 2009 16:40:10 +0000
>
> > The bridge module is missing the net-pf-7 alias that would cause it to
> > be auto-loaded when a socket of that type is opened. This patch adds
> > the alias.
> >
> > Signed-off-by: Scott James Remnant <[email protected]>
> > Signed-off-by: Tim Gardner <[email protected]>
>
> Bridging has no sockets, so this patch won't do anything.
>
> Did you verify that these changes actually do something?
> Or did you blindly run around peppering source files with
> these annotations?

I think this all started when I was debugging a problem where LLC
was not getting autoloaded properly. It turned out that distro's
like Debian (and therefore Ubuntu) had incorrect modprobe.d/alias file
entries. I raised the bug that, "hey you have wrong data and you
really don't need these alias entries at all anymore". There was some
comparison of what was being shipped versus what was in the kernel
and the Debian/Ubuntu guys stepped in to try and unify this.

Let's be supportive of Ubuntu maintainers actually working on upstream
resolution for a change. The normal distro maintainer is "patch and ignore".
In this case, many of these are correct, but several of them are cases
where there is no point in having a module alias because there is no
functiona user visible API. You can try and open a PF_BRIDGE socket, there just
is no point.

2009-03-13 22:28:52

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 01/31] bridge: Auto-load bridge module when socket opened.

From: Stephen Hemminger <[email protected]>
Date: Fri, 13 Mar 2009 15:12:00 -0700

> Let's be supportive of Ubuntu maintainers actually working on
> upstream resolution for a change. The normal distro maintainer is
> "patch and ignore".

This has nothing to do with being supportive or not.

If the changes are wrong, many of these in fact were, and they were
not even tested on top of it, I cannot be happy at all about that.

And that goes for anyone submitting patches here.

2009-03-14 10:36:28

by Scott James Remnant

[permalink] [raw]
Subject: Re: [PATCH 01/31] bridge: Auto-load bridge module when socket opened.

On Fri, 2009-03-13 at 14:27 -0700, David Miller wrote:

> Did you verify that these changes actually do something?
> Or did you blindly run around peppering source files with
> these annotations?
>
I converted existing modprobe aliases that most distributions are
carrying around into the one-line kernel patches.

I tested the important ones such as the floppy and ch changes.

If the patches are wrong, which I personally suspected many of them
were, then it's a good example as to why distributions shouldn't hack
around the kernel in userspace, or keep their own patches.

So yes, they're a bit stinky (hell, I even fluffed up the covering mail
subject line <g>) - but distros including Ubuntu were trying to do these
aliases in modprobe rules, so it's a good thing to find out that they're
wrong; no?

Scott
--
Scott James Remnant
[email protected]


Attachments:
signature.asc (197.00 B)
This is a digitally signed message part

2009-03-16 14:31:16

by Patrick McHardy

[permalink] [raw]
Subject: Re: [PATCH 05/31] netfilter: Auto-load ip6_queue module when socket opened.

Scott James Remnant wrote:
> The ip6_queue module is missing the net-pf-16-proto-13 alias that would
> cause it to be auto-loaded when a socket of that type is opened. This
> patch adds the alias.

Applied, thanks.

2009-03-16 14:31:59

by Patrick McHardy

[permalink] [raw]
Subject: Re: [PATCH 04/31] netfilter: Auto-load ip_queue module when socket opened.

Scott James Remnant wrote:
> The ip_queue module is missing the net-pf-16-proto-3 alias that would
> causae it to be auto-loaded when a socket of that type is opened. This
> patch adds the alias.

Also applied, thanks.

2009-03-21 05:47:58

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 12/31] input: Auto-load mousedev module when psaux device opened.

Hi Scott,

On Tuesday 03 March 2009 07:32:15 Scott James Remnant wrote:
> The mousedev module is missing the char-major-10-1 alias that would cause
> it to be auto-loaded when the /dev/psaux device is opened. This patch
> adds the alias.
>

I think we are trying to go in the different direction that what you are
proposing - we should automatically load mousedev and other input handlers
when input device that is compatible with that handler is registered with
input core, not the other way around. This way you won't need static device
node in your /dev, udev will create it for you as needed.

Same goes for your other patch.

--
Dmitry