lkml.org 
[lkml]   [2020]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/5] iommu/tegra-smmu: Add PCI support
On Mon, Sep 28, 2020 at 09:55:45AM +0200, Thierry Reding wrote:
> On Sat, Sep 26, 2020 at 01:07:18AM -0700, Nicolin Chen wrote:
> > +#ifdef CONFIG_PCI
> > + if (!iommu_present(&pci_bus_type)) {
> > + pci_request_acs();
> > + err = bus_set_iommu(&pci_bus_type, &tegra_smmu_ops);
> > + if (err < 0) {
> > + bus_set_iommu(&platform_bus_type, NULL);
> > + iommu_device_unregister(&smmu->iommu);
> > + iommu_device_sysfs_remove(&smmu->iommu);
> > + return ERR_PTR(err);
>
> It might be worth factoring out the cleanup code now that there are
> multiple failures from which we may need to clean up.

Will do.

> Also, it'd be great if somehow we could do this without the #ifdef,
> but I guess since we're using the pci_bus_type global variable directly,
> there isn't much we can do here?

Probably no -- both pci_bus_type and pci_request_acs seem to depend
on it.

\
 
 \ /
  Last update: 2020-09-29 01:15    [W:0.114 / U:0.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site