1. 29 6月, 2011 2 次提交
  2. 20 6月, 2011 1 次提交
  3. 19 5月, 2011 10 次提交
    • M
      powerpc/pseries/iommu: Cleanup ddw naming · b73a635f
      Milton Miller 提交于
      When using a property refering to the availibily of dynamic dma windows
      call it ddw_avail not ddr_avail.
      
      dupe_ddw_if_already_created does not dupilcate anything, it only finds
      and reuses the windows we already created, so rename it to
      find_existing_ddw.  Also, it does not need the pci device node, so
      remove that argument.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NNishanth Aravamudan <nacc@us.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      b73a635f
    • M
      powerpc/pseries/iommu: Find windows after kexec during boot · c8566780
      Milton Miller 提交于
      Move the discovery of windows previously setup from when the pci driver
      calls set_dma_mask to an arch_initcall.
      
      When kexecing into a kernel with dynamic dma windows allocated, we need
      to find the windows early so that memory hot remove will be able to
      delete the tces mapping the to be removed memory and memory hotplug add
      will map the new memory into the window.  We should not wait for the
      driver to be loaded and the device to be probed.  The iommu init hooks
      are before kmalloc is setup, so defer to arch_initcall.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NNishanth Aravamudan <nacc@us.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      c8566780
    • M
      powerpc/pseries/iommu: Remove ddw property when destroying window · 2573f684
      Milton Miller 提交于
      If we destroy the window, we need to remove the property recording that
      we setup the window.  Otherwise the next kernel we kexec will be
      confused.
      
      Also we should remove the property if even if we don't find the
      ibm,ddw-applicable window or if one of the property sizes is unexpected;
      presumably these came from a prior kernel via kexec, and we will not be
      maintaining the window with respect to memory hotplug.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NNishanth Aravamudan <nacc@us.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      2573f684
    • M
      powerpc/pseries/iommu: Add additional checks when changing iommu mask · 64ac822f
      Milton Miller 提交于
      Do not check dma supported until we have chosen the right dma ops.
      Check that the device is pci before treating it as such.
      
      Check the mask is supported by the selected dma ops before
      committing it.
      
      We only need to set iommu ops if it is not the current ops; this
      avoids searching the tree for the iommu table unnecessarily.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NNishanth Aravamudan <nacc@us.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      64ac822f
    • N
      powerpc/pseries/iommu: Use correct return type in dupe_ddw_if_already_created · 23a6c484
      Nishanth Aravamudan 提交于
      Otherwise we get silent truncations.
      Signed-off-by: NNishanth Aravamudan <nacc@us.ibm.com>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: Milton Miller <miltonm@bga.com>
      Cc: linuxppc-dev@ozlabs.org
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      23a6c484
    • M
      powerpc: Consolidate ipi message mux and demux · 23d72bfd
      Milton Miller 提交于
      Consolidate the mux and demux of ipi messages into smp.c and call
      a new smp_ops callback to actually trigger the ipi.
      
      The powerpc architecture code is optimised for having 4 distinct
      ipi triggers, which are mapped to 4 distinct messages (ipi many, ipi
      single, scheduler ipi, and enter debugger).  However, several interrupt
      controllers only provide a single software triggered interrupt that
      can be delivered to each cpu.  To resolve this limitation, each smp_ops
      implementation created a per-cpu variable that is manipulated with atomic
      bitops.  Since these lines will be contended they are optimialy marked as
      shared_aligned and take a full cache line for each cpu.  Distro kernels
      may have 2 or 3 of these in their config, each taking per-cpu space
      even though at most one will be in use.
      
      This consolidation removes smp_message_recv and replaces the single call
      actions cases with direct calls from the common message recognition loop.
      The complicated debugger ipi case with its muxed crash handling code is
      moved to debug_ipi_action which is now called from the demux code (instead
      of the multi-message action calling smp_message_recv).
      
      I put a call to reschedule_action to increase the likelyhood of correctly
      merging the anticipated scheduler_ipi() hook coming from the scheduler
      tree; that single required call can be inlined later.
      
      The actual message decode is a copy of the old pseries xics code with its
      memory barriers and cache line spacing, augmented with a per-cpu unsigned
      long based on the book-e doorbell code.  The optional data is set via a
      callback from the implementation and is passed to the new cause-ipi hook
      along with the logical cpu number.  While currently only the doorbell
      implemntation uses this data it should be almost zero cost to retrieve and
      pass it -- it adds a single register load for the argument from the same
      cache line to which we just completed a store and the register is dead
      on return from the call.  I extended the data element from unsigned int
      to unsigned long in case some other code wanted to associate a pointer.
      
      The doorbell check_self is replaced by a call to smp_muxed_ipi_resend,
      conditioned on the CPU_DBELL feature.  The ifdef guard could be relaxed
      to CONFIG_SMP but I left it with BOOKE for now.
      
      Also, the doorbell interrupt vector for book-e was not calling irq_enter
      and irq_exit, which throws off cpu accounting and causes code to not
      realize it is running in interrupt context.  Add the missing calls.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      23d72bfd
    • A
      powerpc/pseries: Print corrupt r3 in FWNMI code · f0e939ae
      Anton Blanchard 提交于
      I have a report of an FWNMI with an r3 value that we think is
      corrupt, but since we don't print r3 we have no idea what was
      wrong with it.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      f0e939ae
    • N
      pseries/iommu: Restore iommu table pointer when restoring iommu ops · eb0dd411
      Nishanth Aravamudan 提交于
      When we swtich to direct dma ops, we set the dma data union to have the
      dma offset.  When we switch back to iommu table ops because of a later
      dma_set_mask, we need to restore the iommu table pointer. Without this
      change, crashes have been observed on kexec where (for reasons still
      being investigated) we fall back to a 32-bit dma mask on a particular
      device and then panic because the table pointer is not valid.
      
      The easiset way to find this value is to call
      pci_dma_dev_setup_pSeriesLP which will search up the pci tree until it
      finds the node with the table.
      Signed-off-by: NNishanth Aravamudan <nacc@us.ibm.com>
      Cc: Milton Miller <miltonm@bga.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      eb0dd411
    • N
      powerpc: Ensure dtl buffers do not cross 4k boundary · af442a1b
      Nishanth Aravamudan 提交于
      Future releases of fimrware will enforce a requirement that DTL buffers
      do not cross a 4k boundary. Commit
      127493d5 satisfies this requirement for
      CONFIG_VIRT_CPU_ACCOUNTING=y kernels, but if !CONFIG_VIRT_CPU_ACCOUNTING
      && CONFIG_DTL=y, the current code will fail at dtl registration time.
      Fix this by making the kmem cache from
      127493d5 visible outside of setup.c and
      using the same cache in both dtl.c and setup.c. This requires a bit of
      reorganization to ensure ordering of the kmem cache and buffer
      allocations.
      
      Note: Since firmware now limits the size of the buffer, I made
      dtl_buf_entries read-only in debugfs.
      
      Tested with upcoming firmware with the 4 combinations of
      CONFIG_VIRT_CPU_ACCOUNTING and CONFIG_DTL.
      Signed-off-by: NNishanth Aravamudan <nacc@us.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      af442a1b
    • N
      powerpc: Fix kexec with dynamic dma windows · 76730334
      Nishanth Aravamudan 提交于
      When we kexec we look for a particular property added by the first
      kernel, "linux,direct64-ddr-window-info", per-device where we already
      have set up dynamic dma windows. The current code, though, wasn't
      initializing the size of this property and thus when we kexec'd, we
      would find the property but read uninitialized memory resulting in
      garbage ddw values for the kexec'd kernel and panics. Fix this by
      setting the size at enable_ddw() time and ensuring that the size of the
      found property is valid at dupe_ddw_if_kexec() time.
      Signed-off-by: NNishanth Aravamudan <nacc@us.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      76730334
  4. 06 5月, 2011 2 次提交
    • R
      powerpc/eeh: Display eeh error location for bus and device · 82578e19
      Richard A Lary 提交于
        For adapters which have devices under a PCIe switch/bridge it is informative
        to display information for both the PCIe switch/bridge and the device on
        which the bus error was detected.
      
        rebased to powerpc-next
      Signed-off-by: NRichard A Lary <rlary@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      82578e19
    • T
      powerpc/pseries: Add support for IO event interrupts · 77eafe10
      Tseng-Hui (Frank) Lin 提交于
      This patch adds support for handling IO Event interrupts which come
      through at the /event-sources/ibm,io-events device tree node.
      
      The interrupts come through ibm,io-events device tree node are generated
      by the firmware to report IO events. The firmware uses the same interrupt
      to report multiple types of events for multiple devices. Each device may
      have its own event handler. This patch implements a plateform interrupt
      handler that is triggered by the IO event interrupts come through
      ibm,io-events device tree node, pull in the IO events from RTAS and call
      device event handlers registered in the notifier list.
      
      Device event handlers are expected to use atomic_notifier_chain_register()
      and atomic_notifier_chain_unregister() to register/unregister their
      event handler in pseries_ioei_notifier_list list with IO event interrupt.
      Device event handlers are responsible to identify if the event belongs
      to the device event handler. The device event handle should return NOTIFY_OK
      after the event is handled if the event belongs to the device event handler,
      or NOTIFY_DONE otherwise.
      Signed-off-by: NTseng-Hui (Frank) Lin <thlin@us.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      77eafe10
  5. 04 5月, 2011 5 次提交
  6. 27 4月, 2011 2 次提交
  7. 20 4月, 2011 2 次提交
  8. 18 4月, 2011 1 次提交
    • N
      powerpc/pseries: Use a kmem cache for DTL buffers · 127493d5
      Nishanth Aravamudan 提交于
      PAPR specifies that DTL buffers can not cross AMS environments (aka CMO
      in the PAPR) and can not cross a memory entitlement granule boundary
      (4k). This is found in section 14.11.3.2 H_REGISTER_VPA of the PAPR.
      kmalloc does not guarantee an alignment of the allocation, though,
      beyond 8 bytes (at least in my understanding). Create a special kmem
      cache for DTL buffers with the alignment requirement.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      127493d5
  9. 05 4月, 2011 2 次提交
  10. 01 4月, 2011 1 次提交
    • B
      powerpc/smp: soft-replugged CPUs must go back to start_secondary · fa3f82c8
      Benjamin Herrenschmidt 提交于
      Various thing are torn down when a CPU is hot-unplugged. That CPU
      is expected to go back to start_secondary when re-plugged to re
      initialize everything, such as clock sources, maps, ...
      
      Some implementations just return from cpu_die() callback
      in the idle loop when the CPU is "re-plugged". This is not enough.
      
      We fix it using a little asm trampoline which resets the stack
      and calls back into start_secondary as if we were all fresh from
      boot. The trampoline already existed on ppc64, but we add it for
      ppc32
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      fa3f82c8
  11. 31 3月, 2011 1 次提交
  12. 30 3月, 2011 4 次提交
  13. 29 3月, 2011 2 次提交
  14. 11 3月, 2011 1 次提交
  15. 10 3月, 2011 1 次提交
  16. 04 3月, 2011 3 次提交