1. 06 8月, 2015 1 次提交
  2. 13 7月, 2015 1 次提交
  3. 03 6月, 2015 4 次提交
  4. 22 1月, 2015 1 次提交
    • I
      cxl: Add tracepoints · 9bcf28cd
      Ian Munsie 提交于
      This patch adds tracepoints throughout the cxl driver, which can provide
      insight into:
      
      - Context lifetimes
      - Commands sent to the PSL and AFU and their completion status
      - Segment and page table misses and their resolution
      - PSL and AFU interrupts
      - slbia calls from the powerpc copro_fault code
      
      These tracepoints are mostly intended to aid in debugging (particularly
      for new AFU designs), and may be useful standalone or in conjunction
      with hardware traces collected by the PSL (read out via the trace
      interface in debugfs) and AFUs.
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      9bcf28cd
  5. 29 12月, 2014 1 次提交
    • I
      cxl: Disable SPAP register when freeing SPA · db7933f3
      Ian Munsie 提交于
      When we deactivate the AFU directed mode we free the scheduled process
      area, but did not clear the register in the hardware that has a pointer
      to it.
      
      This should be fine since we will have already cleared out every context
      and we won't do anything that would cause the hardware to access it
      until after we have allocated a new one, but just to be safe this patch
      clears out the register when we free the page.
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      db7933f3
  6. 12 12月, 2014 2 次提交
    • I
      cxl: Add timeout to process element commands · a98e6e9f
      Ian Munsie 提交于
      In the event that something goes wrong in the hardware and it is unable
      to complete a process element comment we would end up polling forever,
      effectively making the associated process unkillable.
      
      This patch adds a timeout to the process element command code path, so
      that we will give up if the hardware does not respond in a reasonable
      time.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      a98e6e9f
    • I
      cxl: Change contexts_lock to a mutex to fix sleep while atomic bug · ee41d11d
      Ian Munsie 提交于
      We had a known sleep while atomic bug if a CXL device was forcefully
      unbound while it was in use. This could occur as a result of EEH, or
      manually induced with something like this while the device was in use:
      
      echo 0000:01:00.0 > /sys/bus/pci/drivers/cxl-pci/unbind
      
      The issue was that in this code path we iterated over each context and
      forcefully detached it with the contexts_lock spin lock held, however
      the detach also needed to take the spu_mutex, and call schedule.
      
      This patch changes the contexts_lock to a mutex so that we are not in
      atomic context while doing the detach, thereby avoiding the sleep while
      atomic.
      
      Also delete the related TODO comment, which suggested an alternate
      solution which turned out to not be workable.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      ee41d11d
  7. 27 11月, 2014 1 次提交
    • I
      CXL: Return error to PSL if IRQ demultiplexing fails & print clearer warning · 27bbcef2
      Ian Munsie 提交于
      If an AFU has a hardware bug that causes it to acknowledge a context
      terminate or remove while that context has outstanding transactions, it
      is possible for the kernel to receive an interrupt for that context
      after we have removed it from the context list.
      
      The kernel will not be able to demultiplex the interrupt (or worse - if
      we have already reallocated the process handle we could mis-attribute it
      to the new context), and printed a big scary warning.
      
      It did not acknowledge the interrupt, which would effectively halt
      further translation fault processing on the PSL.
      
      This patch makes the warning clearer about the likely cause of the issue
      (i.e. hardware bug) to make it obvious to future AFU designers of what
      needs to be fixed. It also prints out the process handle which can then
      be matched up with hardware and software traces for debugging.
      
      It also acknowledges the interrupt to the PSL with either an address
      error or acknowledge, so that the PSL can continue with other
      translations.
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      27bbcef2
  8. 18 11月, 2014 1 次提交
    • I
      cxl: Return error to PSL if IRQ demultiplexing fails & print clearer warning · bc78b05b
      Ian Munsie 提交于
      If an AFU has a hardware bug that causes it to acknowledge a context
      terminate or remove while that context has outstanding transactions, it
      is possible for the kernel to receive an interrupt for that context
      after we have removed it from the context list.
      
      The kernel will not be able to demultiplex the interrupt (or worse - if
      we have already reallocated the process handle we could mis-attribute it
      to the new context), and printed a big scary warning.
      
      It did not acknowledge the interrupt, which would effectively halt
      further translation fault processing on the PSL.
      
      This patch makes the warning clearer about the likely cause of the issue
      (i.e. hardware bug) to make it obvious to future AFU designers of what
      needs to be fixed. It also prints out the process handle which can then
      be matched up with hardware and software traces for debugging.
      
      It also acknowledges the interrupt to the PSL with either an address
      error or acknowledge, so that the PSL can continue with other
      translations.
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      bc78b05b
  9. 28 10月, 2014 1 次提交
    • I
      cxl: Disable secondary hash in segment table · 5100a9d6
      Ian Munsie 提交于
      This patch simplifies the process of finding a free segment table entry
      by disabling the secondary hash. This reduces the number of possible
      entries in the segment table for a given address from 16 to 8.
      
      Due to the large segment sizes we use it is extremely unlikely that the
      secondary hash would ever have been used in practice, so this should not
      have any negative impacts and may even improve performance due to the
      reduced number of comparisons that software & hardware need to perform.
      
      This patch clears the SC bit in the hardware's state register
      (CXL_PSL_SR_An) to disable the secondary hash in the hardware since we
      can no longer fill out entries using it.
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Reviewed-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      5100a9d6
  10. 08 10月, 2014 1 次提交
    • I
      cxl: Driver code for powernv PCIe based cards for userspace access · f204e0b8
      Ian Munsie 提交于
      This is the core of the cxl driver.
      
      It adds support for using cxl cards in the powernv environment only (ie POWER8
      bare metal). It allows access to cxl accelerators by userspace using the
      /dev/cxl/afuM.N char devices.
      
      The kernel driver has no knowledge of the function implemented by the
      accelerator. It provides services to userspace via the /dev/cxl/afuM.N
      devices. When a program opens this device and runs the start work IOCTL, the
      accelerator will have coherent access to that processes memory using the same
      virtual addresses. That process may mmap the device to access any MMIO space
      the accelerator provides.  Also, reads on the device will allow interrupts to
      be received. These services are further documented in a later patch in
      Documentation/powerpc/cxl.txt.
      
      Documentation of the cxl hardware architecture and userspace API is provided in
      subsequent patches.
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      f204e0b8