Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/powernv: Move pnv_ioda_setup_bus_dma under CONFIG_IOMMU_API

pnv_ioda_setup_bus_dma() is only used when a passed through PE is
returned to the host. If the kernel is built without IOMMU support
this is dead code. Move it under the #ifdef with the rest of the
IOMMU API support.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200705133557.443607-2-oohall@gmail.com

authored by

Oliver O'Halloran and committed by
Michael Ellerman
e3417fae 93eacd94

+13 -13
+13 -13
arch/powerpc/platforms/powernv/pci-ioda.c
··· 1885 1885 return false; 1886 1886 } 1887 1887 1888 - static void pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe, struct pci_bus *bus) 1889 - { 1890 - struct pci_dev *dev; 1891 - 1892 - list_for_each_entry(dev, &bus->devices, bus_list) { 1893 - set_iommu_table_base(&dev->dev, pe->table_group.tables[0]); 1894 - dev->dev.archdata.dma_offset = pe->tce_bypass_base; 1895 - 1896 - if ((pe->flags & PNV_IODA_PE_BUS_ALL) && dev->subordinate) 1897 - pnv_ioda_setup_bus_dma(pe, dev->subordinate); 1898 - } 1899 - } 1900 - 1901 1888 static inline __be64 __iomem *pnv_ioda_get_inval_reg(struct pnv_phb *phb, 1902 1889 bool real_mode) 1903 1890 { ··· 2532 2545 (*ptbl)->it_allocated_size = pnv_pci_ioda2_get_table_size( 2533 2546 page_shift, window_size, levels); 2534 2547 return ret; 2548 + } 2549 + 2550 + static void pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe, struct pci_bus *bus) 2551 + { 2552 + struct pci_dev *dev; 2553 + 2554 + list_for_each_entry(dev, &bus->devices, bus_list) { 2555 + set_iommu_table_base(&dev->dev, pe->table_group.tables[0]); 2556 + dev->dev.archdata.dma_offset = pe->tce_bypass_base; 2557 + 2558 + if ((pe->flags & PNV_IODA_PE_BUS_ALL) && dev->subordinate) 2559 + pnv_ioda_setup_bus_dma(pe, dev->subordinate); 2560 + } 2535 2561 } 2536 2562 2537 2563 static void pnv_ioda2_take_ownership(struct iommu_table_group *table_group)