1. 30 10月, 2008 1 次提交
  2. 20 10月, 2008 2 次提交
    • A
      cris: use bcd2bin/bin2bcd · 4110a0d6
      Adrian Bunk 提交于
      Change cris to use the new bcd2bin/bin2bcd functions instead of the
      obsolete BCD_TO_BIN/BIN_TO_BCD macros.
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Cc: Chris Zankel <zankel@tensilica.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4110a0d6
    • M
      container freezer: implement freezer cgroup subsystem · dc52ddc0
      Matt Helsley 提交于
      This patch implements a new freezer subsystem in the control groups
      framework.  It provides a way to stop and resume execution of all tasks in
      a cgroup by writing in the cgroup filesystem.
      
      The freezer subsystem in the container filesystem defines a file named
      freezer.state.  Writing "FROZEN" to the state file will freeze all tasks
      in the cgroup.  Subsequently writing "RUNNING" will unfreeze the tasks in
      the cgroup.  Reading will return the current state.
      
      * Examples of usage :
      
         # mkdir /containers/freezer
         # mount -t cgroup -ofreezer freezer  /containers
         # mkdir /containers/0
         # echo $some_pid > /containers/0/tasks
      
      to get status of the freezer subsystem :
      
         # cat /containers/0/freezer.state
         RUNNING
      
      to freeze all tasks in the container :
      
         # echo FROZEN > /containers/0/freezer.state
         # cat /containers/0/freezer.state
         FREEZING
         # cat /containers/0/freezer.state
         FROZEN
      
      to unfreeze all tasks in the container :
      
         # echo RUNNING > /containers/0/freezer.state
         # cat /containers/0/freezer.state
         RUNNING
      
      This is the basic mechanism which should do the right thing for user space
      task in a simple scenario.
      
      It's important to note that freezing can be incomplete.  In that case we
      return EBUSY.  This means that some tasks in the cgroup are busy doing
      something that prevents us from completely freezing the cgroup at this
      time.  After EBUSY, the cgroup will remain partially frozen -- reflected
      by freezer.state reporting "FREEZING" when read.  The state will remain
      "FREEZING" until one of these things happens:
      
      	1) Userspace cancels the freezing operation by writing "RUNNING" to
      		the freezer.state file
      	2) Userspace retries the freezing operation by writing "FROZEN" to
      		the freezer.state file (writing "FREEZING" is not legal
      		and returns EIO)
      	3) The tasks that blocked the cgroup from entering the "FROZEN"
      		state disappear from the cgroup's set of tasks.
      
      [akpm@linux-foundation.org: coding-style fixes]
      [akpm@linux-foundation.org: export thaw_process]
      Signed-off-by: NCedric Le Goater <clg@fr.ibm.com>
      Signed-off-by: NMatt Helsley <matthltc@us.ibm.com>
      Acked-by: NSerge E. Hallyn <serue@us.ibm.com>
      Tested-by: NMatt Helsley <matthltc@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dc52ddc0
  3. 16 10月, 2008 1 次提交
  4. 14 10月, 2008 1 次提交
  5. 17 9月, 2008 1 次提交
  6. 09 9月, 2008 1 次提交
    • M
      kernel/cpu.c: create a CPU_STARTING cpu_chain notifier · e545a614
      Manfred Spraul 提交于
      Right now, there is no notifier that is called on a new cpu, before the new
      cpu begins processing interrupts/softirqs.
      Various kernel function would need that notification, e.g. kvm works around
      by calling smp_call_function_single(), rcu polls cpu_online_map.
      
      The patch adds a CPU_STARTING notification. It also adds a helper function
      that sends the message to all cpu_chain handlers.
      
      Tested on x86-64.
      All other archs are untested. Especially on sparc, I'm not sure if I got
      it right.
      Signed-off-by: NManfred Spraul <manfred@colorfullife.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e545a614
  7. 07 9月, 2008 1 次提交
  8. 24 8月, 2008 1 次提交
  9. 27 7月, 2008 2 次提交
  10. 26 7月, 2008 1 次提交
    • T
      inflate: refactor inflate malloc code · 2d6ffcca
      Thomas Petazzoni 提交于
      Inflate requires some dynamic memory allocation very early in the boot
      process and this is provided with a set of four functions:
      malloc/free/gzip_mark/gzip_release.
      
      The old inflate code used a mark/release strategy rather than implement
      free.  This new version instead keeps a count on the number of outstanding
      allocations and when it hits zero, it resets the malloc arena.
      
      This allows removing all the mark and release implementations and unifying
      all the malloc/free implementations.
      
      The architecture-dependent code must define two addresses:
       - free_mem_ptr, the address of the beginning of the area in which
         allocations should be made
       - free_mem_end_ptr, the address of the end of the area in which
         allocations should be made. If set to 0, then no check is made on
         the number of allocations, it just grows as much as needed
      
      The architecture-dependent code can also provide an arch_decomp_wdog()
      function call.  This function will be called several times during the
      decompression process, and allow to notify the watchdog that the system is
      still running.  If an architecture provides such a call, then it must
      define ARCH_HAS_DECOMP_WDOG so that the generic inflate code calls
      arch_decomp_wdog().
      
      Work initially done by Matt Mackall, updated to a recent version of the
      kernel and improved by me.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Mikael Starvik <mikael.starvik@axis.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Acked-by: NPaul Mundt <lethal@linux-sh.org>
      Acked-by: NYoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2d6ffcca
  11. 25 7月, 2008 2 次提交
  12. 21 7月, 2008 1 次提交
  13. 14 7月, 2008 1 次提交
  14. 01 7月, 2008 3 次提交
  15. 30 6月, 2008 3 次提交
  16. 26 6月, 2008 1 次提交
  17. 21 6月, 2008 2 次提交
  18. 19 5月, 2008 1 次提交
  19. 17 5月, 2008 1 次提交
  20. 09 5月, 2008 2 次提交
  21. 29 4月, 2008 1 次提交
  22. 28 4月, 2008 1 次提交
  23. 17 4月, 2008 1 次提交
  24. 05 3月, 2008 3 次提交
    • J
      cris: correct usage of __user for copy to and from user space in lib/usercopy and uaccess.h · 07f2402b
      Jesper Nilsson 提交于
      Function __copy_user_zeroing in arch/lib/usercopy.c had the wrong parameter
      set as __user, and in include/asm-cris/uaccess.h, it was not set at all for
      some of the calling functions.
      
      This will cut the number of warnings quite dramatically when using sparse.
      
      While we're here, remove useless CVS log and correct confusing typo.
      Signed-off-by: NJesper Nilsson <jesper.nilsson@axis.com>
      Cc: Mikael Starvik <mikael.starvik@axis.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      07f2402b
    • J
      CRIS: Import string.c (memcpy) from newlib: fixes compile error with gcc 4 · 9fe3fd03
      Jesper Nilsson 提交于
      Adrian Bunk reported another compile error with a SVN head GCC:
      
      ...
        CC      arch/cris/arch-v10/lib/string.o
      /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/string.c:138:
      error: lvalue required as increment operand
      /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/string.c:138:
      error: lvalue required as increment operand
      /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/string.c:139:
      error: lvalue required as increment operand
      ...
      
      This is due to the use of the construct:
      
      	*((long*)dst)++ = lc;
      
      Which isn't legal since casts don't return an lvalue.
      
      The solution is to import the implementation from newlib,
      which is continually autotested together with GCC mainline,
      and uses the construct:
      
      	*(long *) dst = lc; dst += 4;
      
      Since this is an import of a file from newlib, I'm not touching
      the formatting or correcting any checkpatch errors.
      
      As for the earlier fix for memset.c, even if the two files for
      CRIS v10 and CRIS v32 are identical at the moment, it might
      be possible to tweak the CRIS v32 version.
      Thus, I'm not yet folding them into the same file, at least not
      until we've done some research on it.
      Signed-off-by: NJesper Nilsson <jesper.nilsson@axis.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Adrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9fe3fd03
    • J
      CRIS v10: Include mm.h instead of vmstat.h in kernel/time.c · a1056873
      Jesper Nilsson 提交于
      Commit 2f569afd
      (CONFIG_HIGHPTE vs. sub-page page tables) introduced use of
      inc_zone_page_state and dec_zone_page_state in include/linux/mm.h.
      
      Those are defined in include/linux/vmstat.h, but after it includes
      mm.h, making it impossible to include vmstat.h since inc_zone_page_state
      and dec_zone_page_state then would be undefined.
      
      arch/cris/arch-v10/kernel/time.c does just this, which makes the
      CRIS v10 build break with the following error:
      
      ...
        CC      arch/cris/arch-v10/kernel/time.o
      In file included from include/linux/vmstat.h:7,
                       from arch/cris/arch-v10/kernel/time.c:17:
      include/linux/mm.h: In function 'pgtable_page_ctor':
      include/linux/mm.h:902: error: implicit declaration of function 'inc_zone_page_state'
      include/linux/mm.h: In function 'pgtable_page_dtor':
      include/linux/mm.h:908: error: implicit declaration of function 'dec_zone_page_state'
      make[2]: *** [arch/cris/arch-v10/kernel/time.o] Error 1
      make[1]: *** [arch/cris/arch-v10/kernel] Error 2
      make: *** [sub-make] Error 2
      ...
      
      By changing kernel/time.c to include linux/mm.h, the build succeeds.
      Signed-off-by: NJesper Nilsson <jesper.nilsson@axis.com>
      Cc: Mikael Starvik <mikael.starvik@axis.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a1056873
  25. 15 2月, 2008 1 次提交
    • J
      cris: import memset.c from newlib: fixes compile error with newer (pre4.3) gcc · 77a746ce
      Jesper Nilsson 提交于
      Adrian Bunk reported the following compile error with a SVN head GCC:
      
      ...
      CC arch/cris/arch-v10/lib/memset.o
      /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/memset.c: In function 'memset':
      /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/memset.c:164: error: lvalue required as increment operand
      /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/memset.c:165: error: lvalue required as increment operand
      /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/memset.c:166: error: lvalue required as increment operand
      /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/memset.c:167: error: lvalue required as increment operand
      /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/memset.c:185: error: lvalue required as increment operand
      /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/memset.c:189: error: lvalue required as increment operand
      /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/memset.c:192: error: lvalue required as increment operand
      ... etc ...
      
      This is due to the use of the construct:
      
      	*((long*)dst)++ = lc;
      
      Which is no longer legal since casts don't return an lvalue.
      
      The solution is to import the implementation from newlib,
      which is continually autotested together with GCC mainline,
      and uses the construct:
      
      	*(long *) dst = lc; dst += 4;
      
      With this change, the generated code actually shrinks 76 bytes
      since gcc notices that it can use autoincrement for the move
      instruction in CRIS.
      
         text    data     bss     dec     hex filename
          304       0       0     304     130 memset.old.o
         text    data     bss     dec     hex filename
          228       0       0     228      e4 memset.o
      
      Since this is an import of a file from newlib, I'm not touching
      the formatting or correcting any checkpatch errors.
      
      Note also that even if the two files for the CRIS v10 and CRIS v32
      are identical at the moment, it might be possible to tweak the
      CRIS v32 version. Thus, I'm not yet folding them into the same file,
      at least not until we've done some research on it.
      Signed-off-by: NJesper Nilsson <jesper.nilsson@axis.com>
      Cc: Mikael Starvik <mikael.starvik@axis.com>
      Cc: Adrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      77a746ce
  26. 09 2月, 2008 4 次提交
    • S
      ide: introduce HAVE_IDE · ec7748b5
      Sam Ravnborg 提交于
      To allow flexible configuration of IDE introduce HAVE_IDE.
      All archs except arm, um and s390 unconditionally select it.
      For arm the actual configuration determine if IDE is supported.
      
      This is a step towards introducing drivers/Kconfig for arm.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Acked-by: NRussell King - ARM Linux <linux@arm.linux.org.uk>
      Acked-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      ec7748b5
    • H
      avoid overflows in kernel/time.c · bdc80787
      H. Peter Anvin 提交于
      When the conversion factor between jiffies and milli- or microseconds is
      not a single multiply or divide, as for the case of HZ == 300, we currently
      do a multiply followed by a divide.  The intervening result, however, is
      subject to overflows, especially since the fraction is not simplified (for
      HZ == 300, we multiply by 300 and divide by 1000).
      
      This is exposed to the user when passing a large timeout to poll(), for
      example.
      
      This patch replaces the multiply-divide with a reciprocal multiplication on
      32-bit platforms.  When the input is an unsigned long, there is no portable
      way to do this on 64-bit platforms there is no portable way to do this
      since it requires a 128-bit intermediate result (which gcc does support on
      64-bit platforms but may generate libgcc calls, e.g.  on 64-bit s390), but
      since the output is a 32-bit integer in the cases affected, just simplify
      the multiply-divide (*3/10 instead of *300/1000).
      
      The reciprocal multiply used can have off-by-one errors in the upper half
      of the valid output range.  This could be avoided at the expense of having
      to deal with a potential 65-bit intermediate result.  Since the intent is
      to avoid overflow problems and most of the other time conversions are only
      semiexact, the off-by-one errors were considered an acceptable tradeoff.
      
      At Ralf Baechle's suggestion, this version uses a Perl script to compute
      the necessary constants.  We already have dependencies on Perl for kernel
      compiles.  This does, however, require the Perl module Math::BigInt, which
      is included in the standard Perl distribution starting with version 5.8.0.
      In order to support older versions of Perl, include a table of canned
      constants in the script itself, and structure the script so that
      Math::BigInt isn't required if pulling values from said table.
      
      Running the script requires that the HZ value is available from the
      Makefile.  Thus, this patch also adds the Kconfig variable CONFIG_HZ to the
      architectures which didn't already have it (alpha, cris, frv, h8300, m32r,
      m68k, m68knommu, sparc, v850, and xtensa.) It does *not* touch the sh or
      sh64 architectures, since Paul Mundt has dealt with those separately in the
      sh tree.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>,
      Cc: Sam Ravnborg <sam@ravnborg.org>,
      Cc: Paul Mundt <lethal@linux-sh.org>,
      Cc: Richard Henderson <rth@twiddle.net>,
      Cc: Michael Starvik <starvik@axis.com>,
      Cc: David Howells <dhowells@redhat.com>,
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>,
      Cc: Hirokazu Takata <takata@linux-m32r.org>,
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
      Cc: Roman Zippel <zippel@linux-m68k.org>,
      Cc: William L. Irwin <sparclinux@vger.kernel.org>,
      Cc: Chris Zankel <chris@zankel.net>,
      Cc: H. Peter Anvin <hpa@zytor.com>,
      Cc: Jan Engelhardt <jengelh@computergmbh.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bdc80787
    • J
    • J
      CRIS v32: Change drivers/i2c.c locking. · 69b06c15
      Jesper Nilsson 提交于
      - Change spin_lock + local_irq_save into spin_lock_irqsave
      - Change spin_unlock + local_irq_restore into spin_unlock_irqrestore
      - Return ENOTTY if ioctl is not recognized as a cris ioctl.
      - Make init functions static.
      69b06c15