[kernel] r10946 - in dists/trunk/linux-2.6/debian: config/alpha config/amd64 config/arm config/i386 config/mips config/mipsel patches/bugfix/all patches/series

Gordon Farquharson gordon-guest at alioth.debian.org
Sun Mar 23 06:08:53 UTC 2008


Author: gordon-guest
Date: Sun Mar 23 06:08:51 2008
New Revision: 10946

Log:
* Add patch to prevent physmap from calling request_module() too early
  (see http://lkml.org/lkml/2008/3/12/23) (patch is in -mm).
* Update configs appropriately.


Added:
   dists/trunk/linux-2.6/debian/patches/bugfix/all/mtd-prevent-physmap-from-causing-request_module-runaway-loop-modprobe-net-pf-1.patch
Modified:
   dists/trunk/linux-2.6/debian/config/alpha/config
   dists/trunk/linux-2.6/debian/config/amd64/config
   dists/trunk/linux-2.6/debian/config/arm/config.iop32x
   dists/trunk/linux-2.6/debian/config/i386/config
   dists/trunk/linux-2.6/debian/config/mips/config.4kc-malta
   dists/trunk/linux-2.6/debian/config/mips/config.5kc-malta
   dists/trunk/linux-2.6/debian/config/mipsel/config.4kc-malta
   dists/trunk/linux-2.6/debian/config/mipsel/config.5kc-malta
   dists/trunk/linux-2.6/debian/patches/series/1~experimental.1

Modified: dists/trunk/linux-2.6/debian/config/alpha/config
==============================================================================
--- dists/trunk/linux-2.6/debian/config/alpha/config	(original)
+++ dists/trunk/linux-2.6/debian/config/alpha/config	Sun Mar 23 06:08:51 2008
@@ -673,7 +673,7 @@
 # CONFIG_MTD_DEBUG is not set
 CONFIG_MTD_CONCAT=m
 CONFIG_MTD_PARTITIONS=y
-CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
 CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
 CONFIG_MTD_REDBOOT_PARTS_READONLY=y

Modified: dists/trunk/linux-2.6/debian/config/amd64/config
==============================================================================
--- dists/trunk/linux-2.6/debian/config/amd64/config	(original)
+++ dists/trunk/linux-2.6/debian/config/amd64/config	Sun Mar 23 06:08:51 2008
@@ -788,7 +788,7 @@
 # CONFIG_MTD_DEBUG is not set
 CONFIG_MTD_CONCAT=m
 CONFIG_MTD_PARTITIONS=y
-CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
 # CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
 # CONFIG_MTD_REDBOOT_PARTS_READONLY is not set

Modified: dists/trunk/linux-2.6/debian/config/arm/config.iop32x
==============================================================================
--- dists/trunk/linux-2.6/debian/config/arm/config.iop32x	(original)
+++ dists/trunk/linux-2.6/debian/config/arm/config.iop32x	Sun Mar 23 06:08:51 2008
@@ -458,7 +458,7 @@
 CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
 # CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
 # CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
-CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_CMDLINE_PARTS is not set
 # CONFIG_MTD_AFS_PARTS is not set
 CONFIG_MTD_CHAR=y
 CONFIG_MTD_BLOCK=y

Modified: dists/trunk/linux-2.6/debian/config/i386/config
==============================================================================
--- dists/trunk/linux-2.6/debian/config/i386/config	(original)
+++ dists/trunk/linux-2.6/debian/config/i386/config	Sun Mar 23 06:08:51 2008
@@ -944,7 +944,7 @@
 # CONFIG_MTD_DEBUG is not set
 CONFIG_MTD_CONCAT=m
 CONFIG_MTD_PARTITIONS=y
-CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
 # CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
 # CONFIG_MTD_REDBOOT_PARTS_READONLY is not set

Modified: dists/trunk/linux-2.6/debian/config/mips/config.4kc-malta
==============================================================================
--- dists/trunk/linux-2.6/debian/config/mips/config.4kc-malta	(original)
+++ dists/trunk/linux-2.6/debian/config/mips/config.4kc-malta	Sun Mar 23 06:08:51 2008
@@ -956,7 +956,7 @@
 # CONFIG_MTD_DEBUG is not set
 CONFIG_MTD_CONCAT=m
 CONFIG_MTD_PARTITIONS=y
-CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
 # CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
 # CONFIG_MTD_REDBOOT_PARTS_READONLY is not set

Modified: dists/trunk/linux-2.6/debian/config/mips/config.5kc-malta
==============================================================================
--- dists/trunk/linux-2.6/debian/config/mips/config.5kc-malta	(original)
+++ dists/trunk/linux-2.6/debian/config/mips/config.5kc-malta	Sun Mar 23 06:08:51 2008
@@ -1166,7 +1166,7 @@
 # CONFIG_MTD_DEBUG is not set
 CONFIG_MTD_CONCAT=m
 CONFIG_MTD_PARTITIONS=y
-CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
 # CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
 # CONFIG_MTD_REDBOOT_PARTS_READONLY is not set

Modified: dists/trunk/linux-2.6/debian/config/mipsel/config.4kc-malta
==============================================================================
--- dists/trunk/linux-2.6/debian/config/mipsel/config.4kc-malta	(original)
+++ dists/trunk/linux-2.6/debian/config/mipsel/config.4kc-malta	Sun Mar 23 06:08:51 2008
@@ -955,7 +955,7 @@
 # CONFIG_MTD_DEBUG is not set
 CONFIG_MTD_CONCAT=m
 CONFIG_MTD_PARTITIONS=y
-CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
 # CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
 # CONFIG_MTD_REDBOOT_PARTS_READONLY is not set

Modified: dists/trunk/linux-2.6/debian/config/mipsel/config.5kc-malta
==============================================================================
--- dists/trunk/linux-2.6/debian/config/mipsel/config.5kc-malta	(original)
+++ dists/trunk/linux-2.6/debian/config/mipsel/config.5kc-malta	Sun Mar 23 06:08:51 2008
@@ -1165,7 +1165,7 @@
 # CONFIG_MTD_DEBUG is not set
 CONFIG_MTD_CONCAT=m
 CONFIG_MTD_PARTITIONS=y
-CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
 # CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
 # CONFIG_MTD_REDBOOT_PARTS_READONLY is not set

Added: dists/trunk/linux-2.6/debian/patches/bugfix/all/mtd-prevent-physmap-from-causing-request_module-runaway-loop-modprobe-net-pf-1.patch
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/all/mtd-prevent-physmap-from-causing-request_module-runaway-loop-modprobe-net-pf-1.patch	Sun Mar 23 06:08:51 2008
@@ -0,0 +1,199 @@
+From: "Gordon Farquharson" <gordonfarquharson at gmail.com>
+
+On machines that register a physmap flash platform device (e.g.  many arm
+machines), parse_mtd_partitions() in drivers/mtd/mtdpart.c can cause the
+following output in the boot log:
+
+request_module: runaway loop modprobe net-pf-1
+modprobe: FATAL: Could not load
+/lib/modules/2.6.25-rc4-iop32x/modules.dep: No such file or directory
+
+modprobe: FATAL: Could not load
+/lib/modules/2.6.25-rc4-iop32x/modules.dep: No such file or directory
+
+modprobe: FATAL: Could not load
+/lib/modules/2.6.25-rc4-iop32x/modules.dep: No such file or directory
+...
+
+To illustrate how this can occur, I'll use the example where CONFIG_KMOD=y,
+CONFIG_MTD_PARTITIONS=y, CONFIG_MTD_REDBOOT_PARTS=y, and CONFIG_CMDLINE_PARTS
+is not set.  I'll also refer to the following code segment which is in
+drivers/mtd/mtdpart.c:parse_mtd_partitions():
+
+	for ( ; ret <= 0 && *types; types++) {
+		parser = get_partition_parser(*types);
+#ifdef CONFIG_KMOD
+		if (!parser && !request_module("%s", *types))
+				parser = get_partition_parser(*types);
+#endif
+		if (!parser) {
+			printk(KERN_NOTICE "%s partition parsing not available\n",
+			       *types);
+			continue;
+		}
+		ret = (*parser->parse_fn)(master, pparts, origin);
+		if (ret > 0) {
+			printk(KERN_NOTICE "%d %s partitions found on MTD device %s\n",
+			       ret, parser->name, master->name);
+		}
+		put_partition_parser(parser);
+
+I should note that I am assuming (because I don't understand how) that
+request_module() requires net-pf-1 to succeed.  This assumption is based on my
+observation of the request_module message ("request_module: runaway loop
+modprobe net-pf-1"), and that af_unix_init() (net-pf-1 initialization) is
+called only after the call to request_module() in this example.
+
+Based on the configuration and assumptions described above, the sequence of
+events that cause the boot log messages above are:
+
+1. the first call to get_partition_parser() in parse_mtd_partitions() does
+   not find the parser in the the list of registered parsers, i.e. 
+   get_partition_parser() returns a NULL pointer.  In this example, the only
+   registered parser in the list is called Redboot;
+
+2. parse_mtd_partitions() calls request_module() with (in this example)
+   the parameter "cmdlinepart";
+
+3. request_module() complains (request_module: runaway loop modprobe
+   net-pf-1, etc.) because af_unix_init() has not been called.  The boot log
+   shows that af_unix_init() is called only after parse_mtd_partitions()
+   finishes.
+
+register_mtd_parser: RedBoot
+physmap platform flash device: 00080000 at f0000000
+Found: ST M29W400DB
+physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
+number of JEDEC chips: 1
+cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
+parse_mtd_partitions:
+get_partition_parser: name=cmdlinepart
+get_partition_parser: p->name=RedBoot
+get_partition_parser: p->owner=00000000
+get_partition_parser: ret=00000000
+parse_mtd_partitions: cmdlinepart
+request_module: runaway loop modprobe net-pf-1
+modprobe: FATAL: Could not load
+/lib/modules/2.6.25-rc4-iop32x/modules.dep: No such file or directory
+
+modprobe: FATAL: Could not load
+/lib/modules/2.6.25-rc4-iop32x/modules.dep: No such file or directory
+
+modprobe: FATAL: Could not load
+/lib/modules/2.6.25-rc4-iop32x/modules.dep: No such file or directory
+
+<--- 47 repeated modprobe messages deleted --->
+parse_mtd_partitions: request_module called
+cmdlinepart partition parsing not available
+get_partition_parser: name=RedBoot
+get_partition_parser: p->name=RedBoot
+get_partition_parser: p->owner=00000000
+get_partition_parser: ret->name=RedBoot
+get_partition_parser: ret=c02b0f8c
+parse_mtd_partitions: RedBoot
+parse_mtd_partitions: request_module called
+Searching for RedBoot partition table in physmap-flash.0 at offset 0x70000
+No RedBoot partition table detected in physmap-flash.0
+parse_mtd_partitions: end of function
+mice: PS/2 mouse device common for all mice
+i2c /dev entries driver
+rtc-rs5c372 0-0032: rs5c372a found, 24hr, driver version 0.5
+rtc-rs5c372 0-0032: rtc core: registered rtc-rs5c372 as rtc0
+iop-adma iop-adma.0: Intel(R) IOP: ( cpy intr )
+iop-adma iop-adma.1: Intel(R) IOP: ( cpy intr )
+NET: Registered protocol family 26
+TCP bic registered
+af_unix_init:
+NET: Registered protocol family 1
+NET: Registered protocol family 17
+XScale DSP coprocessor detected.
+registered taskstats version 1
+rtc-rs5c372 0-0032: setting system clock to 2008-03-11 03:16:46 UTC (1205205406)
+
+The reason parse_mtd_partitions() tries to use cmdlinepart, even though it is
+not a registered parsing scheme when CONFIG_CMDLINE_PARTS is not set, is
+because cmdlinepart is hard coded in drivers/mtd/maps/physmap.c:
+
+#ifdef CONFIG_MTD_PARTITIONS
+static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
+#endif
+
+The patch below changes CONFIG_MTD_REDBOOT_PARTS, CONFIG_MTD_AFS_PARTS, and
+CONFIG_MTD_OF_PARTS from tristate to bool, and removes the call to
+request_module() in drivers/mtd/mtdpart.c:parse_mtd_partitions().  The changes
+to the definitions of the configuration variables ensure that MTD parsers
+compiled into the kernel are registered before parse_mtd_partitions() is
+called, which negates the need to have parse_mtd_partitions() call
+request_module(), and thereby eliminating the call to request_module() before
+af_unix_init().  The patch also changes the setting of
+CONFIG_MTD_REDBOOT_PARTS in arch/mips/configs/mtx1_defconfig from 'm' to 'y'. 
+This defconfig is the only one that set any of the partitioning schemes to be
+compiled as a module.
+
+Signed-off-by: Gordon Farquharson <gordonfarquharson at gmail.com>
+Cc: David Woodhouse <dwmw2 at infradead.org>
+Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
+---
+
+ arch/mips/configs/mtx1_defconfig |    2 +-
+ drivers/mtd/Kconfig              |    6 +++---
+ drivers/mtd/mtdpart.c            |    4 ----
+ 3 files changed, 4 insertions(+), 8 deletions(-)
+
+diff -puN arch/mips/configs/mtx1_defconfig~mtd-prevent-physmap-from-causing-request_module-runaway-loop-modprobe-net-pf-1 arch/mips/configs/mtx1_defconfig
+--- a/arch/mips/configs/mtx1_defconfig~mtd-prevent-physmap-from-causing-request_module-runaway-loop-modprobe-net-pf-1
++++ a/arch/mips/configs/mtx1_defconfig
+@@ -743,7 +743,7 @@ CONFIG_MTD=m
+ # CONFIG_MTD_DEBUG is not set
+ CONFIG_MTD_CONCAT=m
+ CONFIG_MTD_PARTITIONS=y
+-CONFIG_MTD_REDBOOT_PARTS=m
++CONFIG_MTD_REDBOOT_PARTS=y
+ CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
+ # CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
+ # CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
+diff -puN drivers/mtd/Kconfig~mtd-prevent-physmap-from-causing-request_module-runaway-loop-modprobe-net-pf-1 drivers/mtd/Kconfig
+--- a/drivers/mtd/Kconfig~mtd-prevent-physmap-from-causing-request_module-runaway-loop-modprobe-net-pf-1
++++ a/drivers/mtd/Kconfig
+@@ -48,7 +48,7 @@ config MTD_PARTITIONS
+ 	  'normal' form of partitioning used on a block device.
+ 
+ config MTD_REDBOOT_PARTS
+-	tristate "RedBoot partition table parsing"
++	bool "RedBoot partition table parsing"
+ 	depends on MTD_PARTITIONS
+ 	---help---
+ 	  RedBoot is a ROM monitor and bootloader which deals with multiple
+@@ -135,7 +135,7 @@ config MTD_CMDLINE_PARTS
+ 	  If unsure, say 'N'.
+ 
+ config MTD_AFS_PARTS
+-	tristate "ARM Firmware Suite partition parsing"
++	bool "ARM Firmware Suite partition parsing"
+ 	depends on ARM && MTD_PARTITIONS
+ 	---help---
+ 	  The ARM Firmware Suite allows the user to divide flash devices into
+@@ -151,7 +151,7 @@ config MTD_AFS_PARTS
+ 	  'armflash' map driver (CONFIG_MTD_ARMFLASH) does this, for example.
+ 
+ config MTD_OF_PARTS
+-	tristate "Flash partition map based on OF description"
++	bool "Flash partition map based on OF description"
+ 	depends on PPC_OF && MTD_PARTITIONS
+ 	help
+ 	  This provides a partition parsing function which derives
+diff -puN drivers/mtd/mtdpart.c~mtd-prevent-physmap-from-causing-request_module-runaway-loop-modprobe-net-pf-1 drivers/mtd/mtdpart.c
+--- a/drivers/mtd/mtdpart.c~mtd-prevent-physmap-from-causing-request_module-runaway-loop-modprobe-net-pf-1
++++ a/drivers/mtd/mtdpart.c
+@@ -555,10 +555,6 @@ int parse_mtd_partitions(struct mtd_info
+ 
+ 	for ( ; ret <= 0 && *types; types++) {
+ 		parser = get_partition_parser(*types);
+-#ifdef CONFIG_KMOD
+-		if (!parser && !request_module("%s", *types))
+-				parser = get_partition_parser(*types);
+-#endif
+ 		if (!parser) {
+ 			printk(KERN_NOTICE "%s partition parsing not available\n",
+ 			       *types);
+_

Modified: dists/trunk/linux-2.6/debian/patches/series/1~experimental.1
==============================================================================
--- dists/trunk/linux-2.6/debian/patches/series/1~experimental.1	(original)
+++ dists/trunk/linux-2.6/debian/patches/series/1~experimental.1	Sun Mar 23 06:08:51 2008
@@ -36,3 +36,4 @@
 + bugfix/all/rtc-x1205-new-style-conversion-checkpatch-fixes.patch
 + bugfix/all/file2alias-cross-compile-fix.patch
 + bugfix/arm/ixp4xx-beeper-add-module_alias.patch
++ bugfix/all/mtd-prevent-physmap-from-causing-request_module-runaway-loop-modprobe-net-pf-1.patch



More information about the Kernel-svn-changes mailing list