powerpc/powernv: remove pnv_pci_ioda_pe_single_vendor
authorChristoph Hellwig <hch@lst.de>
Wed, 13 Feb 2019 07:01:12 +0000 (08:01 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 18 Feb 2019 11:41:02 +0000 (22:41 +1100)
This function is completely bogus - the fact that two PCIe devices come
from the same vendor has absolutely nothing to say about the DMA
capabilities and characteristics.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/pci-ioda.c

index 1d6406a051f1216782094ee5bfcf9a662de9e0f1..fce7c6fe2970dd3fa4186bdaddf7c897efe367ce 100644 (file)
@@ -1756,31 +1756,6 @@ static void pnv_pci_ioda_dma_dev_setup(struct pnv_phb *phb, struct pci_dev *pdev
         */
 }
 
-static bool pnv_pci_ioda_pe_single_vendor(struct pnv_ioda_pe *pe)
-{
-       unsigned short vendor = 0;
-       struct pci_dev *pdev;
-
-       if (pe->device_count == 1)
-               return true;
-
-       /* pe->pdev should be set if it's a single device, pe->pbus if not */
-       if (!pe->pbus)
-               return true;
-
-       list_for_each_entry(pdev, &pe->pbus->devices, bus_list) {
-               if (!vendor) {
-                       vendor = pdev->vendor;
-                       continue;
-               }
-
-               if (pdev->vendor != vendor)
-                       return false;
-       }
-
-       return true;
-}
-
 /*
  * Reconfigure TVE#0 to be usable as 64-bit DMA space.
  *
@@ -1881,7 +1856,8 @@ static int pnv_pci_ioda_dma_set_mask(struct pci_dev *pdev, u64 dma_mask)
                 */
                if (dma_mask >> 32 &&
                    dma_mask > (memory_hotplug_max() + (1ULL << 32)) &&
-                   pnv_pci_ioda_pe_single_vendor(pe) &&
+                   /* pe->pdev should be set if it's a single device, pe->pbus if not */
+                   (pe->device_count == 1 || !pe->pbus) &&
                    phb->model == PNV_PHB_MODEL_PHB3) {
                        /* Configure the bypass mode */
                        rc = pnv_pci_ioda_dma_64bit_bypass(pe);