1. 17 12月, 2015 1 次提交
  2. 07 9月, 2015 2 次提交
    • N
      powerpc/powernv/pci-ioda: fix kdump with non-power-of-2 crashkernel= · fa144869
      Nishanth Aravamudan 提交于
      The 32-bit TCE table initialization relies on the DMA window having a
      size equal to a power of 2 (and checks for it explicitly). But
      crashkernel= has no constraint that requires a power-of-2 be specified.
      This causes the kdump kernel to fail to boot as none of the PCI devices
      (including the disk controller) are successfully initialized.
      
      After this change, the PCI devices successfully set up the 32-bit TCE
      table and kdump succeeds.
      
      Fixes: aca6913f ("powerpc/powernv/ioda2: Introduce helpers to allocate TCE pages")
      Signed-off-by: NNishanth Aravamudan <nacc@linux.vnet.ibm.com>
      Cc: stable@vger.kernel.org # 4.2
      Tested-by: NJan Stancek <jstancek@redhat.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      fa144869
    • N
      powerpc/powernv/pci-ioda: fix 32-bit TCE table init in kdump kernel · bb005455
      Nishanth Aravamudan 提交于
      When attempting to kdump with the 4.2 kernel, we see for each PCI
      device:
      
       pci 0003:01     : [PE# 000] Assign DMA32 space
       pci 0003:01     : [PE# 000] Setting up 32-bit TCE table at 0..80000000
       pci 0003:01     : [PE# 000] Failed to create 32-bit TCE table, err -22
       PCI: Domain 0004 has 8 available 32-bit DMA segments
       PCI: 4 PE# for a total weight of 70
       pci 0004:01     : [PE# 002] Assign DMA32 space
       pci 0004:01     : [PE# 002] Setting up 32-bit TCE table at 0..80000000
       pci 0004:01     : [PE# 002] Failed to create 32-bit TCE table, err -22
       pci 0004:0d     : [PE# 005] Assign DMA32 space
       pci 0004:0d     : [PE# 005] Setting up 32-bit TCE table at 0..80000000
       pci 0004:0d     : [PE# 005] Failed to create 32-bit TCE table, err -22
       pci 0004:0e     : [PE# 006] Assign DMA32 space
       pci 0004:0e     : [PE# 006] Setting up 32-bit TCE table at 0..80000000
       pci 0004:0e     : [PE# 006] Failed to create 32-bit TCE table, err -22
       pci 0004:10     : [PE# 008] Assign DMA32 space
       pci 0004:10     : [PE# 008] Setting up 32-bit TCE table at 0..80000000
       pci 0004:10     : [PE# 008] Failed to create 32-bit TCE table, err -22
      
      and eventually the kdump kernel fails to boot as none of the PCI devices
      (including the disk controller) are successfully initialized.
      
      The EINVAL response is because the DMA window (the 2GB base window) is
      larger than the kdump kernel's reserved memory (crashkernel=, in this
      case specified to be 1024M). The check in question,
      
       if ((window_size > memory_hotplug_max()) || !is_power_of_2(window_size))
      
      is a valid sanity check for pnv_pci_ioda2_table_alloc_pages(), so adjust
      the caller to pass in a smaller window size if our maximum memory value
      is smaller than the DMA window.
      
      After this change, the PCI devices successfully set up the 32-bit TCE
      table and kdump succeeds.
      
      The problem was seen on a Firestone machine originally.
      
      Fixes: aca6913f ("powerpc/powernv/ioda2: Introduce helpers to allocate TCE pages")
      Cc: stable@vger.kernel.org # 4.2
      Signed-off-by: NNishanth Aravamudan <nacc@linux.vnet.ibm.com>
      Reviewed-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      [mpe: Coding style pedantry, use u64, change the indentation]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      bb005455
  3. 27 8月, 2015 1 次提交
  4. 20 8月, 2015 1 次提交
  5. 18 8月, 2015 1 次提交
    • A
      powerpc/powernv: move dma_get_required_mask from pnv_phb to pci_controller_ops · 53522982
      Andrew Donnellan 提交于
      Simplify the dma_get_required_mask call chain by moving it from pnv_phb to
      pci_controller_ops, similar to commit 763d2d8d ("powerpc/powernv:
      Move dma_set_mask from pnv_phb to pci_controller_ops").
      
      Previous call chain:
      
        0) call dma_get_required_mask() (kernel/dma.c)
        1) call ppc_md.dma_get_required_mask, if it exists. On powernv, that
           points to pnv_dma_get_required_mask() (platforms/powernv/setup.c)
        2) device is PCI, therefore call pnv_pci_dma_get_required_mask()
           (platforms/powernv/pci.c)
        3) call phb->dma_get_required_mask if it exists
        4) it only exists in the ioda case, where it points to
             pnv_pci_ioda_dma_get_required_mask() (platforms/powernv/pci-ioda.c)
      
      New call chain:
      
        0) call dma_get_required_mask() (kernel/dma.c)
        1) device is PCI, therefore call pci_controller_ops.dma_get_required_mask
           if it exists
        2) in the ioda case, that points to pnv_pci_ioda_dma_get_required_mask()
           (platforms/powernv/pci-ioda.c)
      
      In the p5ioc2 case, the call chain remains the same -
      dma_get_required_mask() does not find either a ppc_md call or
      pci_controller_ops call, so it calls __dma_get_required_mask().
      Signed-off-by: NAndrew Donnellan <andrew.donnellan@au1.ibm.com>
      Reviewed-by: NDaniel Axtens <dja@axtens.net>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      53522982
  6. 23 7月, 2015 1 次提交
  7. 13 7月, 2015 7 次提交
  8. 19 6月, 2015 1 次提交
    • A
      powerpc/powernv: Fix wrong IOMMU table in pnv_ioda_setup_bus_dma() · 5c89a87d
      Alexey Kardashevskiy 提交于
      When pnv_pci_ioda_fixup() is called during PHB fixup time, each PE in
      the sorted list of PEs (phb::pe_dma_list) is iterated to setup the PE's
      DMA32 space by pnv_ioda_setup_bus_dma() if the PE's DMA32 weight is bigger
      than zero. The function also assigns all the subordinate PCI devices of
      the PE's primary bus with the PE's DMA32 IOMMU table. It causes the PCI
      devicess in the child PEs, which don't have DMA weight, receives wrong
      IOMMU table and then IOMMU group.
      
      The patch fixes above issue by more check on the PE's coverage and don't
      assign IOMMU table to those PCI devices, which belong to the child PEs.
      The problem was found on Firestone platform initially.
      Suggested-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      5c89a87d
  9. 18 6月, 2015 1 次提交
  10. 11 6月, 2015 20 次提交
  11. 03 6月, 2015 2 次提交
  12. 02 6月, 2015 2 次提交
    • D
      powerpc/powernv: Move dma_set_mask() from pnv_phb to pci_controller_ops · 763d2d8d
      Daniel Axtens 提交于
      Previously, dma_set_mask() on powernv was convoluted:
       0) Call dma_set_mask() (a/p/kernel/dma.c)
       1) In dma_set_mask(), ppc_md.dma_set_mask() exists, so call it.
       2) On powernv, that function pointer is pnv_dma_set_mask().
          In pnv_dma_set_mask(), the device is pci, so call pnv_pci_dma_set_mask().
       3) In pnv_pci_dma_set_mask(), call pnv_phb->set_dma_mask() if it exists.
       4) It only exists in the ioda case, where it points to
          pnv_pci_ioda_dma_set_mask(), which is the final function.
      
      So the call chain is:
       dma_set_mask() ->
        pnv_dma_set_mask() ->
         pnv_pci_dma_set_mask() ->
          pnv_pci_ioda_dma_set_mask()
      
      Both ppc_md and pnv_phb function pointers are used.
      
      Rip out the ppc_md call, pnv_dma_set_mask() and pnv_pci_dma_set_mask().
      
      Instead:
       0) Call dma_set_mask() (a/p/kernel/dma.c)
       1) In dma_set_mask(), the device is pci, and pci_controller_ops.dma_set_mask()
          exists, so call pci_controller_ops.dma_set_mask()
       2) In the ioda case, that points to pnv_pci_ioda_dma_set_mask().
      
      The new call chain is
       dma_set_mask() ->
        pnv_pci_ioda_dma_set_mask()
      
      Now only the pci_controller_ops function pointer is used.
      
      The fallback paths for p5ioc2 are the same.
      
      Previously, pnv_pci_dma_set_mask() would find no pnv_phb->set_dma_mask()
      function, to it would call __set_dma_mask().
      
      Now, dma_set_mask() finds no ppc_md call or pci_controller_ops call,
      so it calls __set_dma_mask().
      Signed-off-by: NDaniel Axtens <dja@axtens.net>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      763d2d8d
    • D
      powerpc/powernv: Specialise pci_controller_ops for each controller type · 92ae0353
      Daniel Axtens 提交于
      Remove powernv generic PCI controller operations. Replace it with
      controller ops for each of the two supported PHBs.
      
      As an added bonus, make the two new structs const, which will help
      guard against bugs such as the one introduced in 65ebf4b6
      ("powerpc/powernv: Move controller ops from ppc_md to controller_ops")
      Signed-off-by: NDaniel Axtens <dja@axtens.net>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      92ae0353