1. 01 7月, 2006 2 次提交
  2. 30 6月, 2006 1 次提交
    • I
      [PATCH] genirq: rename desc->handler to desc->chip · d1bef4ed
      Ingo Molnar 提交于
      This patch-queue improves the generic IRQ layer to be truly generic, by adding
      various abstractions and features to it, without impacting existing
      functionality.
      
      While the queue can be best described as "fix and improve everything in the
      generic IRQ layer that we could think of", and thus it consists of many
      smaller features and lots of cleanups, the one feature that stands out most is
      the new 'irq chip' abstraction.
      
      The irq-chip abstraction is about describing and coding and IRQ controller
      driver by mapping its raw hardware capabilities [and quirks, if needed] in a
      straightforward way, without having to think about "IRQ flow"
      (level/edge/etc.) type of details.
      
      This stands in contrast with the current 'irq-type' model of genirq
      architectures, which 'mixes' raw hardware capabilities with 'flow' details.
      The patchset supports both types of irq controller designs at once, and
      converts i386 and x86_64 to the new irq-chip design.
      
      As a bonus side-effect of the irq-chip approach, chained interrupt controllers
      (master/slave PIC constructs, etc.) are now supported by design as well.
      
      The end result of this patchset intends to be simpler architecture-level code
      and more consolidation between architectures.
      
      We reused many bits of code and many concepts from Russell King's ARM IRQ
      layer, the merging of which was one of the motivations for this patchset.
      
      This patch:
      
      rename desc->handler to desc->chip.
      
      Originally i did not want to do this, because it's a big patch.  But having
      both "desc->handler", "desc->handle_irq" and "action->handler" caused a
      large degree of confusion and made the code appear alot less clean than it
      truly is.
      
      I have also attempted a dual approach as well by introducing a
      desc->chip alias - but that just wasnt robust enough and broke
      frequently.
      
      So lets get over with this quickly.  The conversion was done automatically
      via scripts and converts all the code in the kernel.
      
      This renaming patch is the first one amongst the patches, so that the
      remaining patches can stay flexible and can be merged and split up
      without having some big monolithic patch act as a merge barrier.
      
      [akpm@osdl.org: build fix]
      [akpm@osdl.org: another build fix]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      d1bef4ed
  3. 28 6月, 2006 1 次提交
    • K
      [PATCH] node hotplug: register cpu: remove node struct · 76b67ed9
      KAMEZAWA Hiroyuki 提交于
      With Goto-san's patch, we can add new pgdat/node at runtime.  I'm now
      considering node-hot-add with cpu + memory on ACPI.
      
      I found acpi container, which describes node, could evaluate cpu before
      memory. This means cpu-hot-add occurs before memory hot add.
      
      In most part, cpu-hot-add doesn't depend on node hot add.  But register_cpu(),
      which creates symbolic link from node to cpu, requires that node should be
      onlined before register_cpu().  When a node is onlined, its pgdat should be
      there.
      
      This patch-set holds off creating symbolic link from node to cpu
      until node is onlined.
      
      This removes node arguments from register_cpu().
      
      Now, register_cpu() requires 'struct node' as its argument.  But the array of
      struct node is now unified in driver/base/node.c now (By Goto's node hotplug
      patch).  We can get struct node in generic way.  So, this argument is not
      necessary now.
      
      This patch also guarantees add cpu under node only when node is onlined.  It
      is necessary for node-hot-add vs.  cpu-hot-add patch following this.
      
      Moreover, register_cpu calculates cpu->node_id by cpu_to_node() without regard
      to its 'struct node *root' argument.  This patch removes it.
      
      Also modify callers of register_cpu()/unregister_cpu, whose args are changed
      by register-cpu-remove-node-struct patch.
      
      [Brice.Goglin@ens-lyon.org: fix it]
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Yasunori Goto <y-goto@jp.fujitsu.com>
      Cc: Ashok Raj <ashok.raj@intel.com>
      Cc: Dave Hansen <haveblue@us.ibm.com>
      Signed-off-by: NBrice Goglin <Brice.Goglin@ens-lyon.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      76b67ed9
  4. 20 4月, 2006 3 次提交
  5. 11 4月, 2006 5 次提交
    • K
      [PATCH] No arch-specific strpbrk implementations · 894b5779
      Kyle McMartin 提交于
      While cleaning up parisc_ksyms.c earlier, I noticed that strpbrk wasn't
      being exported from lib/string.c.  Investigating further, I noticed a
      changeset that removed its export and added it to _ksyms.c on a few more
      architectures.  The justification was that "other arches do it."
      
      I think this is wrong, since no architecture currently defines
      __HAVE_ARCH_STRPBRK, there's no reason for any of them to be exporting it
      themselves.  Therefore, consolidate the export to lib/string.c.
      Signed-off-by: NKyle McMartin <kyle@parisc-linux.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      894b5779
    • Y
      [PATCH] Configurable NODES_SHIFT · c80d79d7
      Yasunori Goto 提交于
      Current implementations define NODES_SHIFT in include/asm-xxx/numnodes.h for
      each arch.  Its definition is sometimes configurable.  Indeed, ia64 defines 5
      NODES_SHIFT values in the current git tree.  But it looks a bit messy.
      
      SGI-SN2(ia64) system requires 1024 nodes, and the number of nodes already has
      been changeable by config.  Suitable node's number may be changed in the
      future even if it is other architecture.  So, I wrote configurable node's
      number.
      
      This patch set defines just default value for each arch which needs multi
      nodes except ia64.  But, it is easy to change to configurable if necessary.
      
      On ia64 the number of nodes can be already configured in generic ia64 and SN2
      config.  But, NODES_SHIFT is defined for DIG64 and HP'S machine too.  So, I
      changed it so that all platforms can be configured via CONFIG_NODES_SHIFT.  It
      would be simpler.
      
      See also: http://marc.theaimsgroup.com/?l=linux-kernel&m=114358010523896&w=2Signed-off-by: NYasunori Goto <y-goto@jp.fujitsu.com>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Jack Steiner <steiner@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      c80d79d7
    • H
      [PATCH] m32r: Remove symbols exported twice · 73830056
      Hirokazu Takata 提交于
      Remove multi-exported symbols from arch/m32r/kernel/m32r_ksyms.c.
      
      WARNING: vmlinux: 'enable_irq' exported twice. Previous export was in vmlinux
      WARNING: vmlinux: 'disable_irq' exported twice. Previous export was in vmlinux
      WARNING: vmlinux: 'disable_irq_nosync' exported twice. Previous export was in vmlinux
      WARNING: vmlinux: 'synchronize_irq' exported twice. Previous export was in vmlinux
      WARNING: vmlinux: 'memchr' exported twice. Previous export was in vmlinux
      WARNING: vmlinux: 'strstr' exported twice. Previous export was in vmlinux
      WARNING: vmlinux: 'memscan' exported twice. Previous export was in vmlinux
      WARNING: vmlinux: 'memcmp' exported twice. Previous export was in vmlinux
      WARNING: vmlinux: 'memmove' exported twice. Previous export was in vmlinux
      WARNING: vmlinux: 'strnlen' exported twice. Previous export was in vmlinux
      WARNING: vmlinux: 'strchr' exported twice. Previous export was in vmlinux
      WARNING: vmlinux: 'strncmp' exported twice. Previous export was in vmlinux
      WARNING: vmlinux: 'strcmp' exported twice. Previous export was in vmlinux
      WARNING: vmlinux: 'strncat' exported twice. Previous export was in vmlinux
      WARNING: vmlinux: 'strcat' exported twice. Previous export was in vmlinux
      WARNING: vmlinux: 'strncpy' exported twice. Previous export was in vmlinux
      WARNING: vmlinux: 'strcpy' exported twice. Previous export was in vmlinux
      Signed-off-by: NHirokazu Takata <takata@linux-m32r.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      73830056
    • H
      [PATCH] m32r: security fix of {get,put}_user macros · 04dfd0de
      Hirokazu Takata 提交于
      Update {get,put}_user macros for m32r kernel.
      - Modify get_user to use __get_user_asm macro, instead of __get_user_x macro.
      - Remove arch/m32r/lib/{get,put}user.S.
      - Some cosmetic updates.
      
      I would like to thank NIIBE Yutaka for his reporting about the m32r kernel's
      security problem in {get,put}_user macros.
      
      There were no address checking for user space access in {get,put}_user macros.
       ;-)
      Signed-off-by: NHirokazu Takata <takata@linux-m32r.org>
      Cc: NIIBE Yutaka <gniibe@fsij.org>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      04dfd0de
    • H
      [PATCH] m32r: Fix cpu_possible_map and cpu_present_map initialization for SMP kernel · 7c1c4e54
      Hirokazu Takata 提交于
      This patch fixes a boot problem of the m32r SMP kernel 2.6.16-rc1-mm3 or
      later.
      
      In this patch, cpu_possible_map is statically initialized, and cpu_present_map
      is also copied from cpu_possible_map in smp_prepare_cpus(), because the m32r
      architecture has not supported CPU hotplug yet.
      Signed-off-by: NHayato Fujiwara <fujiwara.hayato@renesas.com>
      Signed-off-by: NHirokazu Takata <takata@linux-m32r.org>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      7c1c4e54
  6. 28 3月, 2006 3 次提交
  7. 27 3月, 2006 1 次提交
    • A
      [PATCH] bitops: m32r: use generic bitops · 6d9f937b
      Akinobu Mita 提交于
      - remove __{,test_and_}{set,clear,change}_bit() and test_bit()
      - remove ffz()
      - remove find_{next,first}{,_zero}_bit()
      - remove __ffs()
      - remove generic_fls()
      - remove generic_fls64()
      - remove sched_find_first_bit()
      - remove generic_ffs()
      - remove generic_hweight{32,16,8}()
      - remove ext2_{set,clear,test,find_first_zero,find_next_zero}_bit()
      - remove ext2_{set,clear}_bit_atomic()
      - remove minix_{test,set,test_and_clear,test,find_first_zero}_bit()
      Signed-off-by: NAkinobu Mita <mita@miraclelinux.com>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      6d9f937b
  8. 26 3月, 2006 1 次提交
  9. 23 3月, 2006 1 次提交
    • A
      [PATCH] more for_each_cpu() conversions · 394e3902
      Andrew Morton 提交于
      When we stop allocating percpu memory for not-possible CPUs we must not touch
      the percpu data for not-possible CPUs at all.  The correct way of doing this
      is to test cpu_possible() or to use for_each_cpu().
      
      This patch is a kernel-wide sweep of all instances of NR_CPUS.  I found very
      few instances of this bug, if any.  But the patch converts lots of open-coded
      test to use the preferred helper macros.
      
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: David Howells <dhowells@redhat.com>
      Acked-by: NKyle McMartin <kyle@parisc-linux.org>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: William Lee Irwin III <wli@holomorphy.com>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Christian Zankel <chris@zankel.net>
      Cc: Philippe Elie <phil.el@wanadoo.fr>
      Cc: Nathan Scott <nathans@sgi.com>
      Cc: Jens Axboe <axboe@suse.de>
      Cc: Eric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      394e3902
  10. 22 3月, 2006 1 次提交
  11. 06 3月, 2006 1 次提交
  12. 25 2月, 2006 2 次提交
  13. 21 2月, 2006 1 次提交
    • H
      [PATCH] m32r: update sys_tas() routine · cf535ea5
      Hirokazu Takata 提交于
      This patch updates and fixes sys_tas() routine for m32r.
      
      In the previous implementation, a lockup rarely caused at sys_tas()
      routine in SMP environment.
      
      > > The problem is that touching *addr will generate an oops if that page isn't
      > > paged in.  If we convert it to use get_user() then that's an improvement,
      > > but we must not run get_user() under spinlock or local_irq_disable().
      
      I rewrote sys_tas() routine by using "lock -> unlock" instructions, and
      utilizing the m32r's interrupt handling characteristics; the m32r processor
      can accept interrupts only at the 32-bit instruction boundary.  So, the
      "unlock" instruction can be executed continuously after the "lock"
      instruction execution without any interruptions.
      
      In addition, to solve such a page_fault problem, I use a fixup code like
      get_user().
      
      And, as for the kernel lockup problem, we found that a calling
      do_page_fault() routine with disabling interrupts might cause a lockup at
      flush_tlb_others(), because we checked a completion of IPI handler's
      operations in a spin-locked critical section.
      
      Therefore, by using "lock -> unlock" code, we can implement the sys_tas()
      rouitine without disabling interrupts explicitly, then no lockups would
      happen at flush_tlb_others(), I hope.
      
      Compile check and some working test in SMP environment have done.
      Signed-off-by: NHirokazu Takata <takata@linux-m32r.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      cf535ea5
  14. 08 2月, 2006 1 次提交
  15. 13 1月, 2006 1 次提交
  16. 11 1月, 2006 2 次提交
  17. 09 1月, 2006 2 次提交
    • E
      [PATCH] Don't attempt to power off if power off is not implemented · 5e38291d
      Eric W. Biederman 提交于
      The problem.  It is expected that /sbin/halt -p works exactly like
      /sbin/halt, when the kernel does not implement power off functionality.
      
      The kernel can do a lot of work in the reboot notifiers and in
      device_shutdown before we even get to machine_power_off.  Some of that
      shutdown is not safe if you are leaving the power on, and it definitely
      gets in the way of using sysrq or pressing ctrl-alt-del.  Since the
      shutdown happens in generic code there is no way to fix this in
      architecture specific code :(
      
      Some machines are kernel oopsing today because of this.
      
      The simple solution is to turn LINUX_REBOOT_CMD_POWER_OFF into
      LINUX_REBOOT_CMD_HALT if power_off functionality is not implemented.
      
      This has the unfortunate side effect of disabling the power off
      functionality on architectures that leave pm_power_off to null and still
      implement something in machine_power_off.  And it will break the build on
      some architectures that don't have a pm_power_off variable at all.
      
      On both counts I say tough.
      
      For architectures like alpha that don't implement the pm_power_off variable
      pm_power_off is declared in linux/pm.h and it is a generic part of our
      power management code, and all architectures should implement it.
      
      For architectures like parisc that have a default power off method in
      machine_power_off if pm_power_off is not implemented or fails.  It is easy
      enough to set the pm_power_off variable.  And nothing bad happens there,
      the machines just stop powering off.
      
      The current semantics are impossible without a flag at the top level so we
      can avoid the problem code if a power off is not implemented.  pm_power_off
      is as good a flag as any with the bonus that it works without modification
      on at least x86, x86_64, powerpc, and ppc today.
      
      Andrew can you pick this up and put this in the mm tree.  Kernels that
      don't compile or don't power off seem saner than kernels that oops or
      panic.  Until we get the arch specific patches for the problem
      architectures this probably isn't smart to push into the stable kernel.
      Unfortunately I don't have the time at the moment to walk through every
      architecture and make them work.  And even if I did I couldn't test it :(
      
      From: Hirokazu Takata <takata@linux-m32r.org>
      
          Add pm_power_off() for build fix of arch/m32r/kernel/process.c.
      
      From: Miklos Szeredi <miklos@szeredi.hu>
      
          UML build fix
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NHayato Fujiwara <fujiwara@linux-m32r.org>
      Signed-off-by: NHirokazu Takata <takata@linux-m32r.org>
      Signed-off-by: NMiklos Szeredi <miklos@szeredi.hu>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      5e38291d
    • C
      [PATCH] use ptrace_get_task_struct in various places · 6b9c7ed8
      Christoph Hellwig 提交于
      The ptrace_get_task_struct() helper that I added as part of the ptrace
      consolidation is useful in variety of places that currently opencode it.
      Switch them to the common helpers.
      
      Add a ptrace_traceme() helper that needs to be explicitly called, and simplify
      the ptrace_get_task_struct() interface.  We don't need the request argument
      now, and we return the task_struct directly, using ERR_PTR() for error
      returns.  It's a bit more code in the callers, but we have two sane routines
      that do one thing well now.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      6b9c7ed8
  18. 07 1月, 2006 5 次提交
  19. 29 11月, 2005 2 次提交
    • H
      [PATCH] m32r: M3A-2170(Mappi-III) IDE support · ad09d583
      Hirokazu Takata 提交于
      This patch is for supporting IDE interface for M3A-2170(Mappi-III) board.
      Signed-off-by: NMamoru Sakugawa <sakugawa@linux-m32r.org>
      Signed-off-by: NHirokazu Takata <takata@linux-m32r.org>
      Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      ad09d583
    • H
      [PATCH] m32r: Fix sys_tas() syscall · 91f4ab05
      Hirokazu Takata 提交于
      This patch fixes a deadlock problem of the m32r SMP kernel.
      
      In the m32r kernel, sys_tas() system call is provided as a test-and-set
      function for userspace, for backward compatibility.
      
      In some multi-threading application program, deadlocks were rarely caused
      at sys_tas() funcion.  Such a deadlock was caused due to a collision of
      __pthread_lock() and __pthread_unlock() operations.
      
      The "tas" syscall is repeatedly called by pthread_mutex_lock() to get a
      lock, while a lock variable's value is not 0.  On the other hand,
      pthead_mutex_unlock() sets the lock variable to 0 for unlocking.
      
      In the previous implementation of sys_tas() routine, there was a
      possibility that a unlock operation was ignored in the following case:
      
      - Assume a lock variable (*addr) was equal to 1 before sys_tas() execution.
      - __pthread_unlock() operation is executed by the other processor
        and the lock variable (*addr) is set to 0, between a read operation
        ("oldval = *addr;") and the following write operation ("*addr = 1;")
        during a execution of sys_tas().
      
      In this case, the following write operation ("*addr = 1;") overwrites the
      __pthread_unlock() result, and sys_tas() fails to get a lock in the next
      turn and after that.
      
      According to the attatched patch, sys_tas() returns 0 value in the next
      turn and deadlocks never happen.
      Signed-off-by: NHitoshi Yamamoto <Yamamoto.Hitoshi@ap.MitsubishiElectric.co.jp>
      Signed-off-by: NHirokazu Takata <takata@linux-m32r.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      91f4ab05
  20. 09 11月, 2005 1 次提交
    • N
      [PATCH] sched: disable preempt in idle tasks · 5bfb5d69
      Nick Piggin 提交于
      Run idle threads with preempt disabled.
      
      Also corrected a bugs in arm26's cpu_idle (make it actually call schedule()).
      How did it ever work before?
      
      Might fix the CPU hotplugging hang which Nigel Cunningham noted.
      
      We think the bug hits if the idle thread is preempted after checking
      need_resched() and before going to sleep, then the CPU offlined.
      
      After calling stop_machine_run, the CPU eventually returns from preemption and
      into the idle thread and goes to sleep.  The CPU will continue executing
      previous idle and have no chance to call play_dead.
      
      By disabling preemption until we are ready to explicitly schedule, this bug is
      fixed and the idle threads generally become more robust.
      
      From: alexs <ashepard@u.washington.edu>
      
        PPC build fix
      
      From: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
      
        MIPS build fix
      Signed-off-by: NNick Piggin <npiggin@suse.de>
      Signed-off-by: NYoichi Yuasa <yuasa@hh.iij4u.or.jp>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      5bfb5d69
  21. 31 10月, 2005 3 次提交