Skip to content
Snippets Groups Projects
  1. Mar 18, 2013
  2. May 05, 2012
  3. Apr 30, 2012
    • Jim Cromie's avatar
      params: add 3rd arg to option handler callback signature · 9fb48c74
      Jim Cromie authored
      
      Add a 3rd arg, named "doing", to unknown-options callbacks invoked
      from parse_args(). The arg is passed as:
      
        "Booting kernel" from start_kernel(),
        initcall_level_names[i] from do_initcall_level(),
        mod->name from load_module(), via parse_args(), parse_one()
      
      parse_args() already has the "name" parameter, which is renamed to
      "doing" to better reflect current uses 1,2 above.  parse_args() passes
      it to an altered parse_one(), which now passes it down into the
      unknown option handler callbacks.
      
      The mod->name will be needed to handle dyndbg for loadable modules,
      since params passed by modprobe are not qualified (they do not have a
      "$modname." prefix), and by the time the unknown-param callback is
      called, the module name is not otherwise available.
      
      Minor tweaks:
      
      Add param-name to parse_one's pr_debug(), current message doesnt
      identify the param being handled, add it.
      
      Add a pr_info to print current level and level_name of the initcall,
      and number of registered initcalls at that level.  This adds 7 lines
      to dmesg output, like:
      
         initlevel:6=device, 172 registered initcalls
      
      Drop "parameters" from initcall_level_names[], its unhelpful in the
      pr_info() added above.  This array is passed into parse_args() by
      do_initcall_level().
      
      CC: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarJim Cromie <jim.cromie@gmail.com>
      Acked-by: default avatarJason Baron <jbaron@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9fb48c74
  4. Mar 26, 2012
  5. Feb 29, 2012
  6. Feb 14, 2012
  7. Jan 12, 2012
    • Rusty Russell's avatar
      module_param: avoid bool abuse, add bint for special cases. · 69116f27
      Rusty Russell authored
      
      For historical reasons, we allow module_param(bool) to take an int (or
      an unsigned int).  That's going away.
      
      A few drivers really want an int: they set it to -1 and a parameter
      will set it to 0 or 1.  This sucks: reading them from sysfs will give
      'Y' for both -1 and 1, but if we change it to an int, then the users
      might be broken (if they did "param" instead of "param=1").
      
      Use a new 'bint' parser for them.
      
      (ntfs has a different problem: it needs an int for debug_msgs because
      it's also exposed via sysctl.)
      
      Cc: Steve Glendinning <steve.glendinning@smsc.com>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: Guenter Roeck <guenter.roeck@ericsson.com>
      Cc: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
      Cc: Christoph Raisch <raisch@de.ibm.com>
      Cc: Roland Dreier <roland@kernel.org>
      Cc: Sean Hefty <sean.hefty@intel.com>
      Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
      Cc: linux390@de.ibm.com
      Cc: Anton Altaparmakov <anton@tuxera.com>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: lm-sensors@lm-sensors.org
      Cc: linux-rdma@vger.kernel.org
      Cc: linux-s390@vger.kernel.org
      Cc: linux-ntfs-dev@lists.sourceforge.net
      Cc: alsa-devel@alsa-project.org
      Acked-by: Takashi Iwai <tiwai@suse.de> (For the sound part)
      Acked-by: Guenter Roeck <guenter.roeck@ericsson.com> (For the hwmon driver)
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      69116f27
    • Jim Cromie's avatar
      kernel/params: replace DEBUGP with pr_debug · 8487bfd9
      Jim Cromie authored
      
      Use more flexible pr_debug.  This allows:
      
        echo "module params +p" > /dbg/dynamic_debug/control
      
      to turn on debug messages when needed.
      
      Signed-off-by: default avatarJim Cromie <jim.cromie@gmail.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      8487bfd9
  8. Oct 31, 2011
    • Paul Gortmaker's avatar
      kernel: params.c needs module.h not moduleparam.h · 72a59aaa
      Paul Gortmaker authored
      
      Through various other implicit include paths, some files were
      getting the full module.h file, and hence living the illusion
      that they really only needed moduleparam.h -- but the reality
      is that once you remove the module.h presence, these show up:
      
      kernel/params.c:583: warning: ‘struct module_kobject’ declared inside parameter list
      
      Such files really require module.h so simply make it so.  As the
      file module.h grabs moduleparam.h on the fly, all will be well.
      
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      72a59aaa
  9. Oct 26, 2011
  10. Jul 24, 2011
  11. May 19, 2011
  12. Apr 25, 2011
  13. Mar 31, 2011
  14. Jan 24, 2011
    • Dmitry Torokhov's avatar
      module: show version information for built-in modules in sysfs · e94965ed
      Dmitry Torokhov authored
      
      Currently only drivers that are built as modules have their versions
      shown in /sys/module/<module_name>/version, but this information might
      also be useful for built-in drivers as well. This especially important
      for drivers that do not define any parameters - such drivers, if
      built-in, are completely invisible from userspace.
      
      This patch changes MODULE_VERSION() macro so that in case when we are
      compiling built-in module, version information is stored in a separate
      section. Kernel then uses this data to create 'version' sysfs attribute
      in the same fashion it creates attributes for module parameters.
      
      Signed-off-by: default avatarDmitry Torokhov <dtor@vmware.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      e94965ed
  15. Aug 11, 2010
  16. Mar 08, 2010
  17. Mar 06, 2010
  18. Feb 05, 2010
  19. Dec 15, 2009
    • André Goddard Rosa's avatar
      tree-wide: convert open calls to remove spaces to skip_spaces() lib function · e7d2860b
      André Goddard Rosa authored
      Makes use of skip_spaces() defined in lib/string.c for removing leading
      spaces from strings all over the tree.
      
      It decreases lib.a code size by 47 bytes and reuses the function tree-wide:
         text    data     bss     dec     hex filename
        64688     584     592   65864   10148 (TOTALS-BEFORE)
        64641     584     592   65817   10119 (TOTALS-AFTER)
      
      Also, while at it, if we see (*str && isspace(*str)), we can be sure to
      remove the first condition (*str) as the second one (isspace(*str)) also
      evaluates to 0 whenever *str == 0, making it redundant. In other words,
      "a char equals zero is never a space".
      
      Julia Lawall tried the semantic patch (http://coccinelle.lip6.fr
      
      ) below,
      and found occurrences of this pattern on 3 more files:
          drivers/leds/led-class.c
          drivers/leds/ledtrig-timer.c
          drivers/video/output.c
      
      @@
      expression str;
      @@
      
      ( // ignore skip_spaces cases
      while (*str &&  isspace(*str)) { \(str++;\|++str;\) }
      |
      - *str &&
      isspace(*str)
      )
      
      Signed-off-by: default avatarAndré Goddard Rosa <andre.goddard@gmail.com>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
      Cc: David Howells <dhowells@redhat.com>
      Cc: <linux-ext4@vger.kernel.org>
      Cc: Samuel Ortiz <samuel@sortiz.org>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Takashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e7d2860b
  20. Oct 28, 2009
    • Rusty Russell's avatar
      param: fix setting arrays of bool · 3c7d76e3
      Rusty Russell authored
      
      We create a dummy struct kernel_param on the stack for parsing each
      array element, but we didn't initialize the flags word.  This matters
      for arrays of type "bool", where the flag indicates if it really is
      an array of bools or unsigned int (old-style).
      
      Reported-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Cc: stable@kernel.org
      3c7d76e3
    • Rusty Russell's avatar
      param: fix NULL comparison on oom · d553ad86
      Rusty Russell authored
      
      kp->arg is always true: it's the contents of that pointer we care about.
      
      Reported-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Cc: stable@kernel.org
      d553ad86
    • Rusty Russell's avatar
      param: fix lots of bugs with writing charp params from sysfs, by leaking mem. · 65afac7d
      Rusty Russell authored
      
      e180a6b7 "param: fix charp parameters set via sysfs" fixed the case
      where charp parameters written via sysfs were freed, leaving drivers
      accessing random memory.
      
      Unfortunately, storing a flag in the kparam struct was a bad idea: it's
      rodata so setting it causes an oops on some archs.  But that's not all:
      
      1) module_param_array() on charp doesn't work reliably, since we use an
         uninitialized temporary struct kernel_param.
      2) there's a fundamental race if a module uses this parameter and then
         it's changed: they will still access the old, freed, memory.
      
      The simplest fix (ie. for 2.6.32) is to never free the memory.  This
      prevents all these problems, at cost of a memory leak.  In practice, there
      are only 18 places where a charp is writable via sysfs, and all are
      root-only writable.
      
      Reported-by: default avatarTakashi Iwai <tiwai@suse.de>
      Cc: Sitsofe Wheeler <sitsofe@yahoo.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Christof Schmitt <christof.schmitt@de.ibm.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Cc: stable@kernel.org
      65afac7d
  21. Sep 24, 2009
    • Peter Oberparleiter's avatar
      param: allow whitespace as kernel parameter separator · 26d052bf
      Peter Oberparleiter authored
      
      Some boot mechanisms require that kernel parameters are stored in a
      separate file which is loaded to memory without further processing
      (e.g. the "Load from FTP" method on s390). When such a file contains
      newline characters, the kernel parameter preceding the newline might
      not be correctly parsed (due to the newline being stuck to the end of
      the actual parameter value) which can lead to boot failures.
      
      This patch improves kernel command line usability in such a situation
      by allowing generic whitespace characters as separators between kernel
      parameters.
      
      Signed-off-by: default avatarPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      26d052bf
  22. Jun 12, 2009
Loading