From: Alexey Kardashevskiy Date: Wed, 19 Dec 2018 06:17:23 +0000 Subject: Re: [PATCH kernel v5 10/20] powerpc/iommu_api: Move IOMMU groups setup to a single place Message-Id: <163432c4-70f2-41f4-1726-e8ede99ef32e@ozlabs.ru> List-Id: References: <20181213061734.16651-1-aik@ozlabs.ru> <20181213061734.16651-11-aik@ozlabs.ru> <87sgyus91c.fsf@concordia.ellerman.id.au> In-Reply-To: <87sgyus91c.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Michael Ellerman , linuxppc-dev@lists.ozlabs.org Cc: Jose Ricardo Ziviani , Sam Bobroff , Alistair Popple , Daniel Henrique Barboza , Piotr Jaroszynski , kvm-ppc@vger.kernel.org, Alex Williamson , =?UTF-8?Q?Leonardo_Augusto_Guimar=c3=a3es_Garcia?= , Reza Arbab , David Gibson On 19/12/2018 10:35, Michael Ellerman wrote: > Alexey Kardashevskiy writes: > >> diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c >> index b86a6e0..1168b185 100644 >> --- a/arch/powerpc/platforms/powernv/pci-ioda.c >> +++ b/arch/powerpc/platforms/powernv/pci-ioda.c >> @@ -2735,12 +2733,68 @@ static struct iommu_table_group_ops pnv_pci_ioda2_npu_ops = { >> .release_ownership = pnv_ioda2_release_ownership, >> }; >> >> +static void pnv_ioda_setup_bus_iommu_group_add_devices(struct pnv_ioda_pe *pe, >> + struct pci_bus *bus) >> +{ >> + struct pci_dev *dev; >> + >> + list_for_each_entry(dev, &bus->devices, bus_list) { >> + iommu_add_device(&pe->table_group, &dev->dev); >> + >> + if ((pe->flags & PNV_IODA_PE_BUS_ALL) && dev->subordinate) >> + pnv_ioda_setup_bus_iommu_group_add_devices(pe, >> + dev->subordinate); >> + } >> +} >> + >> +static void pnv_ioda_setup_bus_iommu_group(struct pnv_ioda_pe *pe) >> +{ >> + if (!pnv_pci_ioda_pe_dma_weight(pe)) >> + return; >> + >> + iommu_register_group(&pe->table_group, pe->phb->hose->global_number, >> + pe->pe_number); >> + >> + /* >> + * set_iommu_table_base(&pe->pdev->dev, tbl) should have been called >> + * by now >> + */ >> + if (pe->flags & PNV_IODA_PE_DEV) >> + iommu_add_device(&pe->table_group, &pe->pdev->dev); >> + else if (pe->flags & (PNV_IODA_PE_BUS | PNV_IODA_PE_BUS_ALL)) >> + pnv_ioda_setup_bus_iommu_group_add_devices(pe, pe->pbus); >> +} >> + > > This breaks skiroot_defconfig with: > > arch/powerpc/platforms/powernv/pci-ioda.c:2731:13: error: 'pnv_ioda_setup_bus_iommu_group' defined but not used [-Werror=unused-function] > > http://kisskb.ellerman.id.au/kisskb/buildresult/13623033/ How do you enable these warnings? I do not get them no matter what I do. -- Alexey