1. 12 7月, 2011 1 次提交
    • B
      powerpc/mm: Fix memory_block_size_bytes() for non-pseries · 770e1ac5
      Benjamin Herrenschmidt 提交于
      Just compiling pseries in the kernel causes it to override
      memory_block_size_bytes() regardless of what is the runtime
      platform.
      
      This cleans up the implementation of that function, fixing
      a bug or two while at it, so that it's harmless (and potentially
      useful) for other platforms. Without this, bugs in that code
      would trigger a WARN_ON() in drivers/base/memory.c when
      booting some different platforms.
      
      If/when we have another platform supporting memory hotplug we
      might want to either move that out to a generic place or
      make it a ppc_md. callback.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      770e1ac5
  2. 29 6月, 2011 3 次提交
  3. 28 6月, 2011 1 次提交
    • K
      Fix node_start/end_pfn() definition for mm/page_cgroup.c · c6830c22
      KAMEZAWA Hiroyuki 提交于
      commit 21a3c964 uses node_start/end_pfn(nid) for detection start/end
      of nodes. But, it's not defined in linux/mmzone.h but defined in
      /arch/???/include/mmzone.h which is included only under
      CONFIG_NEED_MULTIPLE_NODES=y.
      
      Then, we see
        mm/page_cgroup.c: In function 'page_cgroup_init':
        mm/page_cgroup.c:308: error: implicit declaration of function 'node_start_pfn'
        mm/page_cgroup.c:309: error: implicit declaration of function 'node_end_pfn'
      
      So, fixiing page_cgroup.c is an idea...
      
      But node_start_pfn()/node_end_pfn() is a very generic macro and
      should be implemented in the same manner for all archs.
      (m32r has different implementation...)
      
      This patch removes definitions of node_start/end_pfn() in each archs
      and defines a unified one in linux/mmzone.h. It's not under
      CONFIG_NEED_MULTIPLE_NODES, now.
      
      A result of macro expansion is here (mm/page_cgroup.c)
      
      for !NUMA
       start_pfn = ((&contig_page_data)->node_start_pfn);
        end_pfn = ({ pg_data_t *__pgdat = (&contig_page_data); __pgdat->node_start_pfn + __pgdat->node_spanned_pages;});
      
      for NUMA (x86-64)
        start_pfn = ((node_data[nid])->node_start_pfn);
        end_pfn = ({ pg_data_t *__pgdat = (node_data[nid]); __pgdat->node_start_pfn + __pgdat->node_spanned_pages;});
      
      Changelog:
       - fixed to avoid using "nid" twice in node_end_pfn() macro.
      Reported-and-acked-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Reported-and-tested-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NMel Gorman <mgorman@suse.de>
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c6830c22
  4. 22 6月, 2011 2 次提交
    • S
      powerpc/e500: fix breakage with fsl_rio_mcheck_exception · 82a9a480
      Scott Wood 提交于
      The wrong MCSR bit was being used on e500mc.  MCSR_BUS_RBERR only exists
      on e500v1/v2.  Use MCSR_LD on e500mc, and remove all MCSR checking
      in fsl_rio_mcheck_exception as we now no longer call that function
      if the appropriate bit in MCSR is not set.
      
      If RIO support was enabled at compile-time, but was never probed, just
      return from fsl_rio_mcheck_exception rather than dereference a NULL
      pointer.
      
      TODO: There is still a remaining, though comparitively minor, issue in
      that this recovery mechanism will falsely engage if there's an unrelated
      MCSR_LD event at the same time as a RIO error.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      82a9a480
    • T
      powerpc/p1022ds: fix audio-related properties in the device tree · f3fed682
      Timur Tabi 提交于
      On the Freescale P1022DS reference board, the SSI audio controller is
      connected in "asynchronous" mode to the codec's clocks, so the device tree
      needs an "fsl,ssi-asynchronous" property.
      
      Also remove the clock-frequency property from the wm8776 node, because
      the clock is enabled only if U-Boot enables it, and U-Boot will set the
      property if the clock is enabled.  A future version of the P1022DS audio
      driver will configure the clock itself, but for now, the driver should
      not be told that the clock is running when it isn't.
      
      Also fix the FIFO depth to 15, instead of 16.
      Signed-off-by: NTimur Tabi <timur@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      f3fed682
  5. 16 6月, 2011 1 次提交
  6. 09 6月, 2011 2 次提交
    • B
      powerpc: Force page alignment for initrd reserved memory · 307cfe71
      Benjamin Herrenschmidt 提交于
      When using 64K pages with a separate cpio rootfs, U-Boot will align
      the rootfs on a 4K page boundary. When the memory is reserved, and
      subsequent early memblock_alloc is called, it will allocate memory
      between the 64K page alignment and reserved memory. When the reserved
      memory is subsequently freed, it is done so by pages, causing the
      early memblock_alloc requests to be re-used, which in my case, caused
      the device-tree to be clobbered.
      
      This patch forces the reserved memory for initrd to be kernel page
      aligned, and will move the device tree if it overlaps with the range
      extension of initrd. This patch will also consolidate the identical
      function free_initrd_mem() from mm/init_32.c, init_64.c to mm/mem.c,
      and adds the same range extension when freeing initrd. free_initrd_mem()
      is also moved to the __init section.
      
      Many thanks to Milton Miller for his input on this patch.
      
      [BenH: Fixed build without CONFIG_BLK_DEV_INITRD]
      Signed-off-by: NDave Carroll <dcarroll@astekcorp.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      307cfe71
    • W
      dtc/powerpc: remove obsolete .gitignore entries · c49f8789
      Wolfram Sang 提交于
      dtc was moved and .gitignores have been added to the new location. So, we can
      delete the old, forgotten ones.
      Signed-off-by: NWolfram Sang <w.sang@pengutronix.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      c49f8789
  7. 03 6月, 2011 3 次提交
  8. 31 5月, 2011 1 次提交
  9. 29 5月, 2011 1 次提交
    • E
      ns: Wire up the setns system call · 7b21fddd
      Eric W. Biederman 提交于
      32bit and 64bit on x86 are tested and working.  The rest I have looked
      at closely and I can't find any problems.
      
      setns is an easy system call to wire up.  It just takes two ints so I
      don't expect any weird architecture porting problems.
      
      While doing this I have noticed that we have some architectures that are
      very slow to get new system calls.  cris seems to be the slowest where
      the last system calls wired up were preadv and pwritev.  avr32 is weird
      in that recvmmsg was wired up but never declared in unistd.h.  frv is
      behind with perf_event_open being the last syscall wired up.  On h8300
      the last system call wired up was epoll_wait.  On m32r the last system
      call wired up was fallocate.  mn10300 has recvmmsg as the last system
      call wired up.  The rest seem to at least have syncfs wired up which was
      new in the 2.6.39.
      
      v2: Most of the architecture support added by Daniel Lezcano <dlezcano@fr.ibm.com>
      v3: ported to v2.6.36-rc4 by: Eric W. Biederman <ebiederm@xmission.com>
      v4: Moved wiring up of the system call to another patch
      v5: ported to v2.6.39-rc6
      v6: rebased onto parisc-next and net-next to avoid syscall  conflicts.
      v7: ported to Linus's latest post 2.6.39 tree.
      
      >  arch/blackfin/include/asm/unistd.h     |    3 ++-
      >  arch/blackfin/mach-common/entry.S      |    1 +
      Acked-by: NMike Frysinger <vapier@gentoo.org>
      
      Oh - ia64 wiring looks good.
      Acked-by: NTony Luck <tony.luck@intel.com>
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7b21fddd
  10. 27 5月, 2011 2 次提交
  11. 26 5月, 2011 11 次提交
    • R
      powerpc/4xx: Adding PCIe MSI support · 3fb79338
      Rupjyoti Sarmah 提交于
      This patch adds MSI support for 440SPe, 460Ex, 460Sx and 405Ex.
      Signed-off-by: NRupjyoti Sarmah <rsarmah@apm.com>
      Signed-off-by: NTirumala R Marri <tmarri@apm.com>
      Acked-by: NJosh Boyer <jwboyer@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3fb79338
    • M
      powerpc: Fix irq_free_virt by adjusting bounds before loop · 4dd60290
      Milton Miller 提交于
      Instead of looping over each irq and checking against the irq array
      bounds, adjust the bounds before looping.
      
      The old code will not free any irq if the irq + count is above
      irq_virq_count because the test in the loop is testing irq + count
      instead of irq + i.
      
      This code checks the limits to avoid unsigned integer overflows.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      4dd60290
    • M
      powerpc/irq: Protect irq_radix_revmap_lookup against irq_free_virt · 9b788251
      Milton Miller 提交于
      The radix-tree code uses call_rcu when freeing internal elements.
      We must protect against the elements being freed while we traverse
      the tree, even if the returned pointer will still be valid.
      
      While preparing a patch to expand the context in which
      irq_radix_revmap_lookup will be called, I realized that the
      radix tree was not locked.
      
      When asked
      
          For a normal call_rcu usage, is it allowed to read the structure in
          irq_enter / irq_exit, without additional rcu_read_lock?  Could an
          element freed with call_rcu advance with the cpu still between
          irq_enter/irq_exit (and irq_disabled())?
      
      Paul McKenney replied:
      
          Absolutely illegal to do so. OK for call_rcu_sched(), but a
          flaming bug for call_rcu().
      
          And thank you very much for finding this!!!
      
      Further analysis:
      
      In the current CONFIG_TREE_RCU implementation. CONFIG_TREE_PREEMPT_RCU
      (and CONFIG_TINY_PREEMPT_RCU) uses explicit counters.
      
      These counters are reflected from per-CPU to global in the
      scheduling-clock-interrupt handler, so disabling irq does prevent the
      grace period from completing. But there are real-time implementations
      (such as the one use by the Concurrent guys) where disabling irq
      does -not- prevent the grace period from completing.
      
      While an alternative fix would be to switch radix-tree to rcu_sched, I
      don't want to audit the other users of radix trees (nor put alternative
      freeing in the library).  The normal overhead for rcu_read_lock and
      unlock are a local counter increment and decrement.
      
      This does not show up in the rcu lockdep because in 2.6.34 commit
      2676a58c (radix-tree: Disable RCU lockdep checking in radix tree)
      deemed it too hard to pass the condition of the protecting lock
      to the library.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Reviewed-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      9b788251
    • M
      powerpc/irq: Check desc in handle_one_irq and expand generic_handle_irq · 2e455257
      Milton Miller 提交于
      Look up the descriptor and check that it is found in handle_one_irq
      before checking if we are on the irq stack, and call the handler
      directly using the descriptor if we are on the stack.
      
      We need check irq_to_desc finds the descriptor to avoid a NULL
      pointer dereference.  It could have failed because the number from
      ppc_md.get_irq was above NR_IRQS, or various exceptional conditions
      with sparse irqs (eg race conditions while freeing an irq if its was
      not shutdown in the controller).
      
      fe12bc2c (genirq: Uninline and sanity check generic_handle_irq())
      moved generic_handle_irq out of line to allow its use by interrupt
      controllers in modules.  However, handle_one_irq is core arch code.
      It already knows the details of struct irq_desc and handling irqs in
      the nested irq case.  This will avoid the extra stack frame to return
      the value we don't check.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      2e455257
    • M
      powerpc/irq: Always free duplicate IRQ_LEGACY hosts · 3d1b5e20
      Milton Miller 提交于
      Since kmem caches are allocated before init_IRQ as noted in 3af259d1
      (powerpc: Radix trees are available before init_IRQ), we now call
      kmalloc in all cases and can can always call kfree if we are asked
      to allocate a duplicate or conflicting IRQ_HOST_MAP_LEGACY host.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3d1b5e20
    • M
      powerpc/irq: Remove stale and misleading comment · 8142f032
      Milton Miller 提交于
      The comment claims we will call host->ops->map() to update the flags if
      we find a previously established mapping, but we never did.  We used
      to call remap, but that call was removed in da051980 (powerpc: Remove
      irq_host_ops->remap hook).
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8142f032
    • M
      powerpc/cell: Rename ipi functions to match current abstractions · d5a1c193
      Milton Miller 提交于
      Rename functions and arguments to reflect current usage.  iic_cause_ipi
      becomes iic_message_pass and iic_ipi_to_irq becomes iic_msg_to_irq,
      and iic_request_ipi now takes a message (msg) instead of an ipi number.
      Also mesg is renamed to msg.
      
      Commit f1072939 (powerpc: Remove checks for MSG_ALL and
      MSG_ALL_BUT_SELF) connected the smp_message_pass hook for cell to the
      underlying iic_cause_IPI, a platform unique name.  Later 23d72bfd
      (powerpc: Consolidate ipi message mux and demux) added a cause_ipi
      hook to the smp_ops, also used in message passing, but for controllers
      that can not send 4 unique messages and require multiplexing.  It is
      even more confusing that the both take two arguments, but one is the
      small message ordinal and the other is an opaque long data associated
      with the cpu.
      
      Since cell iic maps messages one to one to ipi irqs, rename the
      function and argument to translate from ipi to message.  Also make it
      clear that iic_request_ipi takes a message number as the argument
      for which ipi to create and request.
      
      No functionional change, just renames to avoid future confusion.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      d5a1c193
    • M
      powerpc/cell: Use common smp ipi actions · 7ef71d75
      Milton Miller 提交于
      The cell iic interrupt controller has enough software caused interrupts
      to use a unique interrupt for each of the 4 messages powerpc uses.
      This means each interrupt gets its own irq action/data combination.
      
      Use the seperate, optimized, arch common ipi action functions
      registered via the helper smp_request_message_ipi instead passing the
      message as action data to a single action that then demultipexes to
      the required acton via a switch statement.
      
      smp_request_message_ipi will register the action as IRQF_PER_CPU
      and IRQF_DISABLED, and WARN if the allocation fails for some reason,
      so no need to print on that failure.  It will return positive if
      the message will not be used by the kernel, in which case we can
      free the virq.
      
      In addition to elimiating inefficient code, this also corrects the
      error that a kernel built with kexec but without a debugger would
      not register the ipi for kdump to notify the other cpus of a crash.
      
      This also restores the debugger action to be static to kernel/smp.c.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7ef71d75
    • B
      powerpc/pseries: Update MAX_HCALL_OPCODE to reflect page coalescing · ca193150
      Brian King 提交于
      When page coalescing support was added recently, the MAX_HCALL_OPCODE
      define was not updated for the newly added H_GET_MPP_X hcall.
      Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ca193150
    • E
      powerpc/oprofile: Handle events that raise an exception without overflowing · ad5d5292
      Eric B Munson 提交于
      Commit 0837e324 fixes a situation on POWER7
      where events can roll back if a specualtive event doesn't actually complete.
      This can raise a performance monitor exception.  We need to catch this to ensure
      that we reset the PMC.  In all cases the PMC will be less than 256 cycles from
      overflow.
      
      This patch lifts Anton's fix for the problem in perf and applies it to oprofile
      as well.
      Signed-off-by: NEric B Munson <emunson@mgebm.net>
      Cc: <stable@kernel.org> # as far back as it applies cleanly
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ad5d5292
    • I
      powerpc/ftrace: Implement raw syscall tracepoints on PowerPC · 02424d89
      Ian Munsie 提交于
      This patch implements the raw syscall tracepoints on PowerPC and exports
      them for ftrace syscalls to use.
      
      To minimise reworking existing code, I slightly re-ordered the thread
      info flags such that the new TIF_SYSCALL_TRACEPOINT bit would still fit
      within the 16 bits of the andi. instruction's UI field. The instructions
      in question are in /arch/powerpc/kernel/entry_{32,64}.S to and the
      _TIF_SYSCALL_T_OR_A with the thread flags to see if system call tracing
      is enabled.
      
      In the case of 64bit PowerPC, arch_syscall_addr and
      arch_syscall_match_sym_name are overridden to allow ftrace syscalls to
      work given the unusual system call table structure and symbol names that
      start with a period.
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      02424d89
  12. 25 5月, 2011 5 次提交
  13. 24 5月, 2011 2 次提交
  14. 22 5月, 2011 5 次提交