1. 09 3月, 2016 19 次提交
  2. 29 2月, 2016 1 次提交
  3. 08 2月, 2016 1 次提交
  4. 06 2月, 2016 1 次提交
    • B
      PCI: Remove includes of asm/pci-bridge.h · 952bbcb0
      Bjorn Helgaas 提交于
      Drivers should include asm/pci-bridge.h only when they need the arch-
      specific things provided there.  Outside of the arch/ directories, the only
      drivers that actually need things provided by asm/pci-bridge.h are the
      powerpc RPA hotplug drivers in drivers/pci/hotplug/rpa*.
      
      Remove the includes of asm/pci-bridge.h from the other drivers, adding an
      include of linux/pci.h if necessary.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      952bbcb0
  5. 11 1月, 2016 3 次提交
  6. 05 1月, 2016 1 次提交
  7. 08 12月, 2015 1 次提交
  8. 24 11月, 2015 2 次提交
    • A
      cxl: use correct operator when writing pcie config space values · 48f0f6b7
      Andrew Donnellan 提交于
      When writing a value to config space, cxl_pcie_write_config() calls
      cxl_pcie_config_info() to obtain a mask and shift value, shifts the new
      value accordingly, then uses the mask to combine the shifted value with the
      existing value at the address as part of a read-modify-write pattern.
      
      Currently, we use a logical OR operator rather than a bitwise OR operator,
      which means any use of this function results in an incorrect value being
      written. Replace the logical OR operator with a bitwise OR operator so the
      value is written correctly.
      Reported-by: NMichael Ellerman <mpe@ellerman.id.au>
      Cc: stable@vger.kernel.org
      Fixes: 6f7f0b3d ("cxl: Add AFU virtual PHB and kernel API")
      Signed-off-by: NAndrew Donnellan <andrew.donnellan@au1.ibm.com>
      Acked-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      48f0f6b7
    • V
      cxl: Fix possible idr warning when contexts are released · 1b5df59e
      Vaibhav Jain 提交于
      An idr warning is reported when a context is release after the capi card
      is unbound from the cxl driver via sysfs. Below are the steps to
      reproduce:
      
      1. Create multiple afu contexts in an user-space application using libcxl.
      2. Unbind capi card from cxl using command of form
         echo <capi-card-pci-addr> > /sys/bus/pci/drivers/cxl-pci/unbind
      3. Exit/kill the application owning afu contexts.
      
      After above steps a warning message is usually seen in the kernel logs
      of the form "idr_remove called for id=<context-id> which is not
      allocated."
      
      This is caused by the function cxl_release_afu which destroys the
      contexts_idr table. So when a context is release no entry for context pe
      is found in the contexts_idr table and idr code prints this warning.
      
      This patch fixes this issue by increasing & decreasing the ref-count on
      the afu device when a context is initialized or when its freed
      respectively. This prevents the afu from being released until all the
      afu contexts have been released. The patch introduces two new functions
      namely cxl_afu_get/put that manage the ref-count on the afu device.
      
      Also the patch removes code inside cxl_dev_context_init that increases ref
      on the afu device as its guaranteed to be alive during this function.
      Reported-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NVaibhav Jain <vaibhav@linux.vnet.ibm.com>
      Acked-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      1b5df59e
  9. 15 10月, 2015 1 次提交
  10. 07 10月, 2015 1 次提交
    • C
      cxl: Fix number of allocated pages in SPA · 4108efb0
      Christophe Lombard 提交于
      The scheduled process area is currently allocated before assigning the
      correct maximum processes to the AFU, which will mean we only ever
      allocate a fixed number of pages for the scheduled process area. This
      will limit us to 958 processes with 2 x 64K pages. If we try to use more
      processes than that we'd probably overrun the buffer and corrupt memory
      or crash.
      
      AFUs that require three or more interrupts per process will not be
      affected as they are already limited to less processes than that, but we
      could hit it on an AFU that requires 0, 1 or 2 interrupts per process,
      or when using 4K pages.
      
      This patch moves the initialisation of the num_procs to before the SPA
      allocation so that enough pages will be allocated for the number of
      processes that the AFU supports.
      Signed-off-by: NChristophe Lombard <clombard@linux.vnet.ibm.com>
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Cc: <stable@vger.kernel.org> # 3.18+
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      4108efb0
  11. 06 10月, 2015 1 次提交
  12. 01 10月, 2015 3 次提交
  13. 23 9月, 2015 1 次提交
  14. 15 9月, 2015 2 次提交
    • I
      cxl: Fix build failure due to -Wunused-variable behaviour change · 2cd55c68
      Ian Munsie 提交于
      A recent change in gcc caused this build failure:
      
      /var/lib/jenkins/workspace/gcc_kernel_build/linux/drivers/misc/cxl/cxl.h:72:27:
      error: ‘CXL_PSL_DLCNTL’ defined but not used [-Werror=unused-const-variable]
       static const cxl_p1_reg_t CXL_PSL_DLCNTL  = {0x0060};
      
      Because of this gcc commit:
      
      Commit 1bca8cbd0c68366f07277f98ce6963e10c2aa617 by mark
      PR28901 -Wunused-variable ignores unused const initialised variables in C
      12 years ago it was decided that -Wunused-variable shouldn't warn about
      static const variables because some code used const static char rcsid[]
      strings which were never used but wanted in the code anyway. But as the
      bug points out this hides some real bugs. These days the usage of
      rcsids is not very popular anymore. So this patch changes the default
      to warn about unused static const variables in C with
      -Wunused-variable. And it adds a new option -Wno-unused-const-variable
      to turn this warning off. For C++ this new warning is off by default,
      since const variables can be used as #defines in C++. New testcases for
      the new defaults in C and C++ are included testing the new warning and
      suppressing it with an unused attribute or using
      -Wno-unused-const-variable. gcc/ChangeLog
      
      The cxl driver uses static consts in place of #defines in some cases
      for type safety, so this change causes the driver to fail to build on
      new copilers as these constants are not all used in every file that
      imports the header. Suppress the warning for this driver to return to
      the old behaviour of -Wunused-variable.
      Reported-by: NAnton Blanchard <anton@au1.ibm.com>
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      2cd55c68
    • D
      cxl: Fix unbalanced pci_dev_get in cxl_probe · 2925c2fd
      Daniel Axtens 提交于
      Currently the first thing we do in cxl_probe is to grab a reference
      on the pci device. Later on, we call device_register on our adapter.
      In our remove path, we call device_unregister, but we never call
      pci_dev_put. We therefore leak the device every time we do a
      reflash.
      
      device_register/unregister is sufficient to hold the reference.
      Therefore, drop the call to pci_dev_get.
      
      Here's why this is safe.
      The proposed cxl_probe(pdev) calls cxl_adapter_init:
          a) init calls cxl_adapter_alloc, which creates a struct cxl,
             conventionally called adapter. This struct contains a
             device entry, adapter->dev.
      
          b) init calls cxl_configure_adapter, where we set
             adapter->dev.parent = &dev->dev (here dev is the pci dev)
      
      So at this point, the cxl adapter's device's parent is the PCI
      device that I want to be refcounted properly.
      
          c) init calls cxl_register_adapter
             *) cxl_register_adapter calls device_register(&adapter->dev)
      
      So now we're in device_register, where dev is the adapter device, and
      we want to know if the PCI device is safe after we return.
      
      device_register(&adapter->dev) calls device_initialize() and then
      device_add().
      
      device_add() does a get_device(). device_add() also explicitly grabs
      the device's parent, and calls get_device() on it:
      
               parent = get_device(dev->parent);
      
      So therefore, device_register() takes a lock on the parent PCI dev,
      which is what pci_dev_get() was guarding. pci_dev_get() can therefore
      be safely removed.
      
      Fixes: f204e0b8 ("cxl: Driver code for powernv PCIe based cards for userspace access")
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Axtens <dja@axtens.net>
      Acked-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      2925c2fd
  15. 07 9月, 2015 1 次提交
  16. 30 8月, 2015 1 次提交