1. 05 8月, 2011 1 次提交
  2. 27 7月, 2011 1 次提交
  3. 19 7月, 2011 1 次提交
  4. 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
  5. 29 6月, 2011 4 次提交
    • B
      powerpc/pseries: Re-implement HVSI as part of hvc_vio · 4d2bb3f5
      Benjamin Herrenschmidt 提交于
      On pseries machines, consoles are provided by the hypervisor using
      a low level get_chars/put_chars type interface. However, this is
      really just a transport to the service processor which implements
      them either as "raw" console (networked consoles, HMC, ...) or as
      "hvsi" serial ports.
      
      The later is a simple packet protocol on top of the raw character
      interface that is supposed to convey additional "serial port" style
      semantics. In practice however, all it does is provide a way to
      read the CD line and set/clear our DTR line, that's it.
      
      We currently implement the "raw" protocol as an hvc console backend
      (/dev/hvcN) and the "hvsi" protocol using a separate tty driver
      (/dev/hvsi0).
      
      However this is quite impractical. The arbitrary difference between
      the two type of devices has been a major source of user (and distro)
      confusion. Additionally, there's an additional mini -hvsi implementation
      in the pseries platform code for our low level debug console and early
      boot kernel messages, which means code duplication, though that low
      level variant is impractical as it's incapable of doing the initial
      protocol negociation to establish the link to the FSP.
      
      This essentially replaces the dedicated hvsi driver and the platform
      udbg code completely by extending the existing hvc_vio backend used
      in "raw" mode so that:
      
       - It now supports HVSI as well
       - We add support for hvc backend providing tiocm{get,set}
       - It also provides a udbg interface for early debug and boot console
      
      This is overall less code, though this will only be obvious once we
      remove the old "hvsi" driver, which is still available for now. When
      the old driver is enabled, the new code still kicks in for the low
      level udbg console, replacing the old mini implementation in the platform
      code, it just doesn't provide the higher level "hvc" interface.
      
      In addition to producing generally simler code, this has several benefits
      over our current situation:
      
       - The user/distro only has to deal with /dev/hvcN for the hypervisor
      console, avoiding all sort of confusion that has plagued us in the past
      
       - The tty, kernel and low level debug console all use the same code
      base which supports the full protocol establishment process, thus the
      console is now available much earlier than it used to be with the
      old HVSI driver. The kernel console works much earlier and udbg is
      available much earlier too. Hackers can enable a hard coded very-early
      debug console as well that works with HVSI (previously that was only
      supported for the "raw" mode).
      
      I've tried to keep the same semantics as hvsi relative to how I react
      to things like CD changes, with some subtle differences though:
      
       - I clear DTR on close if HUPCL is set
      
       - Current hvsi triggers a hangup if it detects a up->down transition
         on CD (you can still open a console with CD down). My new implementation
         triggers a hangup if the link to the FSP is severed, and severs it upon
         detecting a up->down transition on CD.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      4d2bb3f5
    • B
      powerpc/udbg: Register udbg console generically · dd2e356a
      Benjamin Herrenschmidt 提交于
      When CONFIG_PPC_EARLY_DEBUG is set, call register_early_udbg_console()
      early from generic code.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      dd2e356a
    • A
      powerpc/pseries: Improve error code on reconfiguration notifier failure · de2780a3
      Akinobu Mita 提交于
      Reconfiguration notifier call for device node may fail by several reasons,
      but it always assumes kmalloc failures.
      
      This enables reconfiguration notifier call chain to get the actual error
      code rather than -ENOMEM by converting all reconfiguration notifier calls
      to return encapsulate error code with notifier_from_errno().
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      de2780a3
    • A
      powerpc/pseries: Introduce pSeries_reconfig_notify() · 3aef19f0
      Akinobu Mita 提交于
      This introduces pSeries_reconfig_notify() as a just wrapper of
      blocking_notifier_call_chain() for pSeries_reconfig_chain.
      
      This is a preparation to improvement of error code on reconfiguration
      notifier failure.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3aef19f0
  6. 20 6月, 2011 2 次提交
  7. 09 6月, 2011 1 次提交
  8. 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
  9. 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
  10. 04 5月, 2011 5 次提交
  11. 27 4月, 2011 2 次提交
  12. 20 4月, 2011 2 次提交
  13. 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
  14. 05 4月, 2011 2 次提交
  15. 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
  16. 31 3月, 2011 1 次提交
  17. 30 3月, 2011 3 次提交