1. 21 1月, 2011 1 次提交
    • D
      kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT · 6a108a14
      David Rientjes 提交于
      The meaning of CONFIG_EMBEDDED has long since been obsoleted; the option
      is used to configure any non-standard kernel with a much larger scope than
      only small devices.
      
      This patch renames the option to CONFIG_EXPERT in init/Kconfig and fixes
      references to the option throughout the kernel.  A new CONFIG_EMBEDDED
      option is added that automatically selects CONFIG_EXPERT when enabled and
      can be used in the future to isolate options that should only be
      considered for embedded systems (RISC architectures, SLOB, etc).
      
      Calling the option "EXPERT" more accurately represents its intention: only
      expert users who understand the impact of the configuration changes they
      are making should enable it.
      Reviewed-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NDavid Woodhouse <david.woodhouse@intel.com>
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Cc: Greg KH <gregkh@suse.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Robin Holt <holt@sgi.com>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6a108a14
  2. 14 1月, 2011 5 次提交
  3. 25 11月, 2010 1 次提交
    • W
      uml: disable winch irq before freeing handler data · 69e83dad
      Will Newton 提交于
      Disable the winch irq early to make sure we don't take an interrupt part
      way through the freeing of the handler data, resulting in a crash on
      shutdown:
      
        winch_interrupt : read failed, errno = 9
        fd 13 is losing SIGWINCH support
        ------------[ cut here ]------------
        WARNING: at lib/list_debug.c:48 list_del+0xc6/0x100()
        list_del corruption, next is LIST_POISON1 (00100100)
        082578c8:  [<081fd77f>] dump_stack+0x22/0x24
        082578e0:  [<0807a18a>] warn_slowpath_common+0x5a/0x80
        08257908:  [<0807a23e>] warn_slowpath_fmt+0x2e/0x30
        08257920:  [<08172196>] list_del+0xc6/0x100
        08257940:  [<08060244>] free_winch+0x14/0x80
        08257958:  [<080606fb>] winch_interrupt+0xdb/0xe0
        08257978:  [<080a65b5>] handle_IRQ_event+0x35/0xe0
        08257998:  [<080a8717>] handle_edge_irq+0xb7/0x170
        082579bc:  [<08059bc4>] do_IRQ+0x34/0x50
        082579d4:  [<08059e1b>] sigio_handler+0x5b/0x80
        082579ec:  [<0806a374>] sig_handler_common+0x44/0xb0
        08257a68:  [<0806a538>] sig_handler+0x38/0x50
        08257a78:  [<0806a77c>] handle_signal+0x5c/0xa0
        08257a9c:  [<0806be28>] hard_handler+0x18/0x20
        08257aac:  [<00c14400>] 0xc14400
      Signed-off-by: NWill Newton <will.newton@gmail.com>
      Acked-by: NWANG Cong <xiyou.wangcong@gmail.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      69e83dad
  4. 18 11月, 2010 1 次提交
  5. 12 11月, 2010 1 次提交
  6. 28 10月, 2010 2 次提交
  7. 27 10月, 2010 7 次提交
  8. 19 10月, 2010 1 次提交
    • A
      uml: kill big kernel lock · 9a181c58
      Arnd Bergmann 提交于
      Three uml device drivers still use the big kernel lock,
      but all of them can be safely converted to using
      a per-driver mutex instead. Most likely this is not
      even necessary, so after further review these can
      and should be removed as well.
      
      The exec system call no longer requires the BKL either,
      so remove it from there, too.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: user-mode-linux-devel@lists.sourceforge.net
      9a181c58
  9. 16 10月, 2010 1 次提交
    • F
      uml: fix build · e3c6cf61
      FUJITA Tomonori 提交于
      Fix a build error introduced by d6d1b650 ("param: simple
      locking for sysfs-writable charp parameters").
      
          CC      arch/um/kernel/trap.o
        arch/um/drivers/hostaudio_kern.c: In function 'hostaudio_open':
        arch/um/drivers/hostaudio_kern.c:204: error: '__param_dsp' undeclared (first use in this function)
        arch/um/drivers/hostaudio_kern.c:204: error: (Each undeclared identifier is reported only once
        arch/um/drivers/hostaudio_kern.c:204: error: for each function it appears in.)
        arch/um/drivers/hostaudio_kern.c: In function 'hostmixer_open_mixdev':
        arch/um/drivers/hostaudio_kern.c:265: error: '__param_mixer' undeclared (first use in this function)
        arch/um/drivers/hostaudio_kern.c:272: error: '__param_dsp' undeclared (first use in this function)
      Reported-by: NToralf Förster <toralf.foerster@gmx.de>
      Tested-by: NToralf Förster <toralf.foerster@gmx.de>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Jeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e3c6cf61
  10. 15 10月, 2010 2 次提交
    • A
      llseek: automatically add .llseek fop · 6038f373
      Arnd Bergmann 提交于
      All file_operations should get a .llseek operation so we can make
      nonseekable_open the default for future file operations without a
      .llseek pointer.
      
      The three cases that we can automatically detect are no_llseek, seq_lseek
      and default_llseek. For cases where we can we can automatically prove that
      the file offset is always ignored, we use noop_llseek, which maintains
      the current behavior of not returning an error from a seek.
      
      New drivers should normally not use noop_llseek but instead use no_llseek
      and call nonseekable_open at open time.  Existing drivers can be converted
      to do the same when the maintainer knows for certain that no user code
      relies on calling seek on the device file.
      
      The generated code is often incorrectly indented and right now contains
      comments that clarify for each added line why a specific variant was
      chosen. In the version that gets submitted upstream, the comments will
      be gone and I will manually fix the indentation, because there does not
      seem to be a way to do that using coccinelle.
      
      Some amount of new code is currently sitting in linux-next that should get
      the same modifications, which I will do at the end of the merge window.
      
      Many thanks to Julia Lawall for helping me learn to write a semantic
      patch that does all this.
      
      ===== begin semantic patch =====
      // This adds an llseek= method to all file operations,
      // as a preparation for making no_llseek the default.
      //
      // The rules are
      // - use no_llseek explicitly if we do nonseekable_open
      // - use seq_lseek for sequential files
      // - use default_llseek if we know we access f_pos
      // - use noop_llseek if we know we don't access f_pos,
      //   but we still want to allow users to call lseek
      //
      @ open1 exists @
      identifier nested_open;
      @@
      nested_open(...)
      {
      <+...
      nonseekable_open(...)
      ...+>
      }
      
      @ open exists@
      identifier open_f;
      identifier i, f;
      identifier open1.nested_open;
      @@
      int open_f(struct inode *i, struct file *f)
      {
      <+...
      (
      nonseekable_open(...)
      |
      nested_open(...)
      )
      ...+>
      }
      
      @ read disable optional_qualifier exists @
      identifier read_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      expression E;
      identifier func;
      @@
      ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
      {
      <+...
      (
         *off = E
      |
         *off += E
      |
         func(..., off, ...)
      |
         E = *off
      )
      ...+>
      }
      
      @ read_no_fpos disable optional_qualifier exists @
      identifier read_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      @@
      ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
      {
      ... when != off
      }
      
      @ write @
      identifier write_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      expression E;
      identifier func;
      @@
      ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
      {
      <+...
      (
        *off = E
      |
        *off += E
      |
        func(..., off, ...)
      |
        E = *off
      )
      ...+>
      }
      
      @ write_no_fpos @
      identifier write_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      @@
      ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
      {
      ... when != off
      }
      
      @ fops0 @
      identifier fops;
      @@
      struct file_operations fops = {
       ...
      };
      
      @ has_llseek depends on fops0 @
      identifier fops0.fops;
      identifier llseek_f;
      @@
      struct file_operations fops = {
      ...
       .llseek = llseek_f,
      ...
      };
      
      @ has_read depends on fops0 @
      identifier fops0.fops;
      identifier read_f;
      @@
      struct file_operations fops = {
      ...
       .read = read_f,
      ...
      };
      
      @ has_write depends on fops0 @
      identifier fops0.fops;
      identifier write_f;
      @@
      struct file_operations fops = {
      ...
       .write = write_f,
      ...
      };
      
      @ has_open depends on fops0 @
      identifier fops0.fops;
      identifier open_f;
      @@
      struct file_operations fops = {
      ...
       .open = open_f,
      ...
      };
      
      // use no_llseek if we call nonseekable_open
      ////////////////////////////////////////////
      @ nonseekable1 depends on !has_llseek && has_open @
      identifier fops0.fops;
      identifier nso ~= "nonseekable_open";
      @@
      struct file_operations fops = {
      ...  .open = nso, ...
      +.llseek = no_llseek, /* nonseekable */
      };
      
      @ nonseekable2 depends on !has_llseek @
      identifier fops0.fops;
      identifier open.open_f;
      @@
      struct file_operations fops = {
      ...  .open = open_f, ...
      +.llseek = no_llseek, /* open uses nonseekable */
      };
      
      // use seq_lseek for sequential files
      /////////////////////////////////////
      @ seq depends on !has_llseek @
      identifier fops0.fops;
      identifier sr ~= "seq_read";
      @@
      struct file_operations fops = {
      ...  .read = sr, ...
      +.llseek = seq_lseek, /* we have seq_read */
      };
      
      // use default_llseek if there is a readdir
      ///////////////////////////////////////////
      @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier readdir_e;
      @@
      // any other fop is used that changes pos
      struct file_operations fops = {
      ... .readdir = readdir_e, ...
      +.llseek = default_llseek, /* readdir is present */
      };
      
      // use default_llseek if at least one of read/write touches f_pos
      /////////////////////////////////////////////////////////////////
      @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read.read_f;
      @@
      // read fops use offset
      struct file_operations fops = {
      ... .read = read_f, ...
      +.llseek = default_llseek, /* read accesses f_pos */
      };
      
      @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier write.write_f;
      @@
      // write fops use offset
      struct file_operations fops = {
      ... .write = write_f, ...
      +	.llseek = default_llseek, /* write accesses f_pos */
      };
      
      // Use noop_llseek if neither read nor write accesses f_pos
      ///////////////////////////////////////////////////////////
      
      @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read_no_fpos.read_f;
      identifier write_no_fpos.write_f;
      @@
      // write fops use offset
      struct file_operations fops = {
      ...
       .write = write_f,
       .read = read_f,
      ...
      +.llseek = noop_llseek, /* read and write both use no f_pos */
      };
      
      @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier write_no_fpos.write_f;
      @@
      struct file_operations fops = {
      ... .write = write_f, ...
      +.llseek = noop_llseek, /* write uses no f_pos */
      };
      
      @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read_no_fpos.read_f;
      @@
      struct file_operations fops = {
      ... .read = read_f, ...
      +.llseek = noop_llseek, /* read uses no f_pos */
      };
      
      @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      @@
      struct file_operations fops = {
      ...
      +.llseek = noop_llseek, /* no read or write fn */
      };
      ===== End semantic patch =====
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: Christoph Hellwig <hch@infradead.org>
      6038f373
    • T
      ubd: fix incorrect sector handling during request restart · 47526903
      Tejun Heo 提交于
      Commit f81f2f7c (ubd: drop unnecessary rq->sector manipulation)
      dropped request->sector manipulation in preparation for global request
      handling cleanup; unfortunately, it incorrectly assumed that the
      updated sector wasn't being used.
      
      ubd tries to issue as many requests as possible to io_thread.  When
      issuing fails due to memory pressure or other reasons, the device is
      put on the restart list and issuing stops.  On IO completion, devices
      on the restart list are scanned and IO issuing is restarted.
      
      ubd issues IOs sg-by-sg and issuing can be stopped in the middle of a
      request, so each device on the restart queue needs to remember where
      to restart in its current request.  ubd needs to keep track of the
      issue position itself because,
      
      * blk_rq_pos(req) is now updated by the block layer to keep track of
        _completion_ position.
      
      * Multiple io_req's for the current request may be in flight, so it's
        difficult to tell where blk_rq_pos(req) currently is.
      
      Add ubd->rq_pos to keep track of the issue position and use it to
      correctly restart io_req issue.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NRichard Weinberger <richard@nod.at>
      Tested-by: NRichard Weinberger <richard@nod.at>
      Tested-by: NChris Frey <cdfrey@foursquare.net>
      Cc: stable@kernel.org
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      47526903
  11. 30 9月, 2010 1 次提交
    • B
      um: Proper Fix for f25c80a4: remove duplicate structure field initialization · 9337057d
      Boaz Harrosh 提交于
      uml_net_set_mac() was broken and luckily it was never used, before.
      What it was trying to do is spin_lock before memcopy the mac address.
      Linus attempted to fix it in assumption that someone decided the
      lock was needed. But since it was never ever used at all, and was
      just dead code, I think we can assume that it is not needed, after
      all.
      
      On the other hand patch [f25c80a4] was trying to use eth_mac_addr()
      in eth_configure(), *which was the real fallout*. Because of state
      checks done inside eth_mac_addr() the address was never set. I have
      not reintroduced the memcpy wrapper, but I've put a comment for future
      cats.
      
      The code now is back to exactly as it was before [f25c80a4]. With
      the cleanup applied. If the spin_lock is indeed needed then a contender
      should supply a test case that fails, then fix it with the proper
      locking, as a separate unrelated patch.
      
      CC: Julia Lawall <julia@diku.dk>
      CC: David S. Miller <davem@davemloft.net>
      CC: Andrew Morton <akpm@linux-foundation.org>
      CC: Al Viro <viro@ZenIV.linux.org.uk>
      Tested-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9337057d
  12. 24 9月, 2010 1 次提交
  13. 23 9月, 2010 1 次提交
  14. 20 9月, 2010 1 次提交
  15. 21 8月, 2010 2 次提交
  16. 18 8月, 2010 1 次提交
    • D
      Make do_execve() take a const filename pointer · d7627467
      David Howells 提交于
      Make do_execve() take a const filename pointer so that kernel_execve() compiles
      correctly on ARM:
      
      arch/arm/kernel/sys_arm.c:88: warning: passing argument 1 of 'do_execve' discards qualifiers from pointer target type
      
      This also requires the argv and envp arguments to be consted twice, once for
      the pointer array and once for the strings the array points to.  This is
      because do_execve() passes a pointer to the filename (now const) to
      copy_strings_kernel().  A simpler alternative would be to cast the filename
      pointer in do_execve() when it's passed to copy_strings_kernel().
      
      do_execve() may not change any of the strings it is passed as part of the argv
      or envp lists as they are some of them in .rodata, so marking these strings as
      const should be fine.
      
      Further kernel_execve() and sys_execve() need to be changed to match.
      
      This has been test built on x86_64, frv, arm and mips.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Tested-by: NRalf Baechle <ralf@linux-mips.org>
      Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d7627467
  17. 14 8月, 2010 1 次提交
  18. 11 8月, 2010 2 次提交
  19. 10 8月, 2010 3 次提交
    • C
      arch/um/kernel/ptrace.c: remove dead PROC_MM · 7833e7c9
      Christoph Egger 提交于
      PROC_MM doesn't exist in Kconfig.  Looking around it looks like a
      left-over from 2.6.0 or even 2.4 times, last mentioned in a fedora patch
      for 2.6.10.  I believe it's time to get rid of that last tiny parts here
      that are still around.
      Signed-off-by: NChristoph Egger <siccegge@cs.fau.de>
      Cc: Jeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7833e7c9
    • R
      um: call free_irq() only on enabled channels · 47562277
      Richard Weinberger 提交于
      When I use OpenSUSE-11.2 on UML (> 2.6.25)
      I get lots of such errors:
      
      Registering fd 1 twice
      Irqs : 3, 3
      Ids : 0x09cb41a0, 0x09cb4120
      ------------[ cut here ]------------
      WARNING: at kernel/irq/manage.c:896 __free_irq+0x79/0x11a()
      Trying to free already-free IRQ 3
      Modules linked in:
      09dadc6c:  [<081b2edb>] dump_stack+0x1c/0x20
      09dadc84:  [<080716da>] warn_slowpath_common+0x49/0x77
      09dadc9c:  [<08071772>] warn_slowpath_fmt+0x26/0x2a
      09dadcb4:  [<08094e08>] __free_irq+0x79/0x11a
      09dadce4:  [<08094ed6>] free_irq+0x2d/0x49
      09dadcf4:  [<0805b4bc>] close_one_chan+0x70/0x9c
      09dadd0c:  [<0805b833>] close_chan+0x17/0x22
      09dadd1c:  [<0805bdda>] enable_chan+0x70/0x7c
      09dadd3c:  [<0805cbb7>] line_open+0x34/0x9f
      09dadd54:  [<0805b21e>] con_open+0x13/0x35
      09dadd6c:  [<0814dc89>] tty_open+0x285/0x384
      09dadda0:  [<080b754e>] chrdev_open+0xe0/0xf9
      09daddc0:  [<080b3fb2>] __dentry_open+0xf3/0x1e2
      09dadde4:  [<080b4142>] nameidata_to_filp+0x35/0x49
      09daddfc:  [<080bd270>] do_last+0x409/0x50e
      09dade28:  [<080bea04>] do_filp_open+0x175/0x446
      09dadecc:  [<080b3d89>] do_sys_open+0x4a/0x128
      09dadf04:  [<080b3ea2>] sys_open+0x19/0x21
      09dadf28:  [<0805ab5a>] handle_syscall+0x7a/0x98
      09dadf78:  [<08068441>] userspace+0x2c9/0x370
      09dadfe0:  [<08058bb3>] fork_handler+0x53/0x5b
      09dadffc:  [<00766564>] 0x766564
      
      ---[ end trace 9ebc1094aaf4bded ]---
      
      This patch fixes the issue.
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Cc: Jeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      47562277
    • A
      Deal with missing exports for hostfs · 005a59ec
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      005a59ec
  20. 08 8月, 2010 1 次提交
    • A
      block: push down BKL into .open and .release · 6e9624b8
      Arnd Bergmann 提交于
      The open and release block_device_operations are currently
      called with the BKL held. In order to change that, we must
      first make sure that all drivers that currently rely
      on this have no regressions.
      
      This blindly pushes the BKL into all .open and .release
      operations for all block drivers to prepare for the
      next step. The drivers can subsequently replace the BKL
      with their own locks or remove it completely when it can
      be shown that it is not needed.
      
      The functions blkdev_get and blkdev_put are the only
      remaining users of the big kernel lock in the block
      layer, besides a few uses in the ioctl code, none
      of which need to serialize with blkdev_{get,put}.
      
      Most of these two functions is also under the protection
      of bdev->bd_mutex, including the actual calls to
      ->open and ->release, and the common code does not
      access any global data structures that need the BKL.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      6e9624b8
  21. 04 8月, 2010 1 次提交
  22. 03 8月, 2010 1 次提交
    • H
      um, x86: Cast to (u64 *) inside set_64bit() · bf676945
      H. Peter Anvin 提交于
      After tightening up the types passed to set_64bit(), the cast to
      (phys_t *) triggers a warning apparently because phys_t is defined as
      "unsigned long" when building on 64 bits; however, u64 is defined as
      "unsigned long long".  This is, however, a explicit cast inside a
      size-specific call, so just make the cast explicitly (u64 *).
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      LKML-Reference: <tip-69309a05@git.kernel.org>
      bf676945
  23. 27 7月, 2010 2 次提交