]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'next-sriov' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/power...
authorMichael Ellerman <mpe@ellerman.id.au>
Mon, 13 Apr 2015 23:29:23 +0000 (09:29 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 13 Apr 2015 23:29:23 +0000 (09:29 +1000)
Merge Richard's work to support SR-IOV on PowerNV. All generic PCI
patches acked by Bjorn.

Some minor conflicts with Daniel's pci_controller_ops work.

Conflicts:
arch/powerpc/include/asm/machdep.h
arch/powerpc/platforms/powernv/pci-ioda.c

1  2 
arch/powerpc/include/asm/iommu.h
arch/powerpc/include/asm/machdep.h
arch/powerpc/include/asm/pci-bridge.h
arch/powerpc/kernel/pci-common.c
arch/powerpc/platforms/powernv/pci-ioda.c
arch/powerpc/platforms/powernv/pci.c

Simple merge
index 5c19ac527a8edf71aaf3d1904538c8b62291e794,1b268044f29003b6f522bc6a98cbd11f0fd5b9a5..ef8899432ae72dd0f91359cfba7e74d3c162b620
@@@ -236,6 -240,21 +236,11 @@@ struct machdep_calls 
        /* Called after scan and before resource survey */
        void (*pcibios_fixup_phb)(struct pci_controller *hose);
  
 -      /* Called during PCI resource reassignment */
 -      resource_size_t (*pcibios_window_alignment)(struct pci_bus *, unsigned long type);
 -
 -      /* Reset the secondary bus of bridge */
 -      void  (*pcibios_reset_secondary_bus)(struct pci_dev *dev);
 -
+ #ifdef CONFIG_PCI_IOV
+       void (*pcibios_fixup_sriov)(struct pci_dev *pdev);
+       resource_size_t (*pcibios_iov_resource_alignment)(struct pci_dev *, int resno);
+ #endif /* CONFIG_PCI_IOV */
        /* Called to shutdown machine specific hardware not already controlled
         * by other drivers.
         */
Simple merge
Simple merge
index 5e917753c6728089f896de58466ea6c27988fc7c,5ac7c60a88016d667817c7735b216787e688cef5..920c252d1f49329616eddb2cf3ba4f2ec1f202b3
@@@ -2103,9 -2808,13 +2809,15 @@@ static void __init pnv_pci_init_ioda_ph
         * the child P2P bridges) can form individual PE.
         */
        ppc_md.pcibios_fixup = pnv_pci_ioda_fixup;
 -      ppc_md.pcibios_enable_device_hook = pnv_pci_enable_device_hook;
 -      ppc_md.pcibios_window_alignment = pnv_pci_window_alignment;
 -      ppc_md.pcibios_reset_secondary_bus = pnv_pci_reset_secondary_bus;
 +      pnv_pci_controller_ops.enable_device_hook = pnv_pci_enable_device_hook;
 +      pnv_pci_controller_ops.window_alignment = pnv_pci_window_alignment;
 +      pnv_pci_controller_ops.reset_secondary_bus = pnv_pci_reset_secondary_bus;
++
+ #ifdef CONFIG_PCI_IOV
+       ppc_md.pcibios_fixup_sriov = pnv_pci_ioda_fixup_iov_resources;
+       ppc_md.pcibios_iov_resource_alignment = pnv_pci_iov_resource_alignment;
 -#endif /* CONFIG_PCI_IOV */
++#endif
++
        pci_add_flags(PCI_REASSIGN_ALL_RSRC);
  
        /* Reset IODA tables to a clean state */
index fa96aa8aa1e2dc8ac5e20a2fcadca3d1a4f1e2fa,02badcef5ceac52ff6adcdc2b7eda40f068f3db9..bca2aeb6e4b6a4f179622c4786d79e7f65062069
@@@ -666,9 -714,32 +666,27 @@@ static void pnv_pci_dma_dev_setup(struc
  {
        struct pci_controller *hose = pci_bus_to_host(pdev->bus);
        struct pnv_phb *phb = hose->private_data;
+ #ifdef CONFIG_PCI_IOV
+       struct pnv_ioda_pe *pe;
+       struct pci_dn *pdn;
+       /* Fix the VF pdn PE number */
+       if (pdev->is_virtfn) {
+               pdn = pci_get_pdn(pdev);
+               WARN_ON(pdn->pe_number != IODA_INVALID_PE);
+               list_for_each_entry(pe, &phb->ioda.pe_list, list) {
+                       if (pe->rid == ((pdev->bus->number << 8) |
+                           (pdev->devfn & 0xff))) {
+                               pdn->pe_number = pe->pe_number;
+                               pe->pdev = pdev;
+                               break;
+                       }
+               }
+       }
+ #endif /* CONFIG_PCI_IOV */
  
 -      /* If we have no phb structure, try to setup a fallback based on
 -       * the device-tree (RTAS PCI for example)
 -       */
        if (phb && phb->dma_dev_setup)
                phb->dma_dev_setup(phb, pdev);
 -      else
 -              pnv_pci_dma_fallback_setup(hose, pdev);
  }
  
  int pnv_pci_dma_set_mask(struct pci_dev *pdev, u64 dma_mask)