|
@@ -1718,6 +1718,31 @@ 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;
|
|
|
+}
|
|
|
+
|
|
|
static int pnv_pci_ioda_dma_set_mask(struct pci_dev *pdev, u64 dma_mask)
|
|
|
{
|
|
|
struct pci_controller *hose = pci_bus_to_host(pdev->bus);
|