[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 12 Dec 2013 17:35:27 -0600
From: Scott Wood <scottwood@...escale.com>
To: Alexey Kardashevskiy <aik@...abs.ru>
CC: <linuxppc-dev@...ts.ozlabs.org>, <kvm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
Alex Williamson <alex.williamson@...hat.com>,
Paul Mackerras <paulus@...ba.org>,
David Gibson <david@...son.dropbear.id.au>,
Varun Sethi <Varun.Sethi@...escale.com>
Subject: Re: [1/3] powerpc/vfio: Enable on POWERNV platform
On Tue, May 21, 2013 at 01:33:09PM +1000, Alexey Kardashevskiy wrote:
> +static int iommu_add_device(struct device *dev)
> +{
> + struct iommu_table *tbl;
> + int ret = 0;
> +
> + if (WARN_ON(dev->iommu_group)) {
> + pr_warn("iommu_tce: device %s is already in iommu group %d, skipping\n",
> + dev_name(dev),
> + iommu_group_id(dev->iommu_group));
> + return -EBUSY;
> + }
[snip]
> +static int __init tce_iommu_init(void)
> +{
> + struct pci_dev *pdev = NULL;
> +
> + BUILD_BUG_ON(PAGE_SIZE < IOMMU_PAGE_SIZE);
> +
> + for_each_pci_dev(pdev)
> + iommu_add_device(&pdev->dev);
> +
> + bus_register_notifier(&pci_bus_type, &tce_iommu_bus_nb);
> + return 0;
> +}
> +
> +subsys_initcall_sync(tce_iommu_init);
This is missing a check to see whether the appropriate hardware is
present. This file should also be renamed to something less generic, and
depend on a kconfig symbol more specific than CONFIG_PPC64.
When this is combined with CONFIG_FSL_PAMU on hardware with a PAMU, I get
a bunch of those "WARN_ON(dev->iommu_group)" dumps because PAMU already
got to them. Presumably without PAMU it silently (or with just pr_debug)
bails out at some other point.
-Scott
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists