mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
powerpc/iommu: Remove iommu_del_device()
Now that power calls iommu_device_register() and populates its groups
using iommu_ops->device_group it should not be calling
iommu_group_remove_device().
The core code owns the groups and all the other related iommu data, it
will clean it up automatically.
Remove the bus notifiers and explicit calls to
iommu_group_remove_device().
Fixes: a940904443
("powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains")
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/0-v1-1421774b874b+167-ppc_device_group_jgg@nvidia.com
This commit is contained in:
committed by
Michael Ellerman
parent
8133a3f0aa
commit
ad593827db
@@ -205,7 +205,6 @@ extern void iommu_register_group(struct iommu_table_group *table_group,
|
|||||||
int pci_domain_number, unsigned long pe_num);
|
int pci_domain_number, unsigned long pe_num);
|
||||||
extern int iommu_add_device(struct iommu_table_group *table_group,
|
extern int iommu_add_device(struct iommu_table_group *table_group,
|
||||||
struct device *dev);
|
struct device *dev);
|
||||||
extern void iommu_del_device(struct device *dev);
|
|
||||||
extern long iommu_tce_xchg(struct mm_struct *mm, struct iommu_table *tbl,
|
extern long iommu_tce_xchg(struct mm_struct *mm, struct iommu_table *tbl,
|
||||||
unsigned long entry, unsigned long *hpa,
|
unsigned long entry, unsigned long *hpa,
|
||||||
enum dma_data_direction *direction);
|
enum dma_data_direction *direction);
|
||||||
@@ -229,10 +228,6 @@ static inline int iommu_add_device(struct iommu_table_group *table_group,
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void iommu_del_device(struct device *dev)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif /* !CONFIG_IOMMU_API */
|
#endif /* !CONFIG_IOMMU_API */
|
||||||
|
|
||||||
u64 dma_iommu_get_required_mask(struct device *dev);
|
u64 dma_iommu_get_required_mask(struct device *dev);
|
||||||
|
@@ -1168,23 +1168,6 @@ int iommu_add_device(struct iommu_table_group *table_group, struct device *dev)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(iommu_add_device);
|
EXPORT_SYMBOL_GPL(iommu_add_device);
|
||||||
|
|
||||||
void iommu_del_device(struct device *dev)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Some devices might not have IOMMU table and group
|
|
||||||
* and we needn't detach them from the associated
|
|
||||||
* IOMMU groups
|
|
||||||
*/
|
|
||||||
if (!device_iommu_mapped(dev)) {
|
|
||||||
pr_debug("iommu_tce: skipping device %s with no tbl\n",
|
|
||||||
dev_name(dev));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
iommu_group_remove_device(dev);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(iommu_del_device);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A simple iommu_table_group_ops which only allows reusing the existing
|
* A simple iommu_table_group_ops which only allows reusing the existing
|
||||||
* iommu_table. This handles VFIO for POWER7 or the nested KVM.
|
* iommu_table. This handles VFIO for POWER7 or the nested KVM.
|
||||||
|
@@ -865,28 +865,3 @@ void __init pnv_pci_init(void)
|
|||||||
/* Configure IOMMU DMA hooks */
|
/* Configure IOMMU DMA hooks */
|
||||||
set_pci_dma_ops(&dma_iommu_ops);
|
set_pci_dma_ops(&dma_iommu_ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pnv_tce_iommu_bus_notifier(struct notifier_block *nb,
|
|
||||||
unsigned long action, void *data)
|
|
||||||
{
|
|
||||||
struct device *dev = data;
|
|
||||||
|
|
||||||
switch (action) {
|
|
||||||
case BUS_NOTIFY_DEL_DEVICE:
|
|
||||||
iommu_del_device(dev);
|
|
||||||
return 0;
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct notifier_block pnv_tce_iommu_bus_nb = {
|
|
||||||
.notifier_call = pnv_tce_iommu_bus_notifier,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int __init pnv_tce_iommu_bus_notifier_init(void)
|
|
||||||
{
|
|
||||||
bus_register_notifier(&pci_bus_type, &pnv_tce_iommu_bus_nb);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
machine_subsys_initcall_sync(powernv, pnv_tce_iommu_bus_notifier_init);
|
|
||||||
|
@@ -1695,31 +1695,6 @@ static int __init disable_multitce(char *str)
|
|||||||
|
|
||||||
__setup("multitce=", disable_multitce);
|
__setup("multitce=", disable_multitce);
|
||||||
|
|
||||||
static int tce_iommu_bus_notifier(struct notifier_block *nb,
|
|
||||||
unsigned long action, void *data)
|
|
||||||
{
|
|
||||||
struct device *dev = data;
|
|
||||||
|
|
||||||
switch (action) {
|
|
||||||
case BUS_NOTIFY_DEL_DEVICE:
|
|
||||||
iommu_del_device(dev);
|
|
||||||
return 0;
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct notifier_block tce_iommu_bus_nb = {
|
|
||||||
.notifier_call = tce_iommu_bus_notifier,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int __init tce_iommu_bus_notifier_init(void)
|
|
||||||
{
|
|
||||||
bus_register_notifier(&pci_bus_type, &tce_iommu_bus_nb);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
machine_subsys_initcall_sync(pseries, tce_iommu_bus_notifier_init);
|
|
||||||
|
|
||||||
#ifdef CONFIG_SPAPR_TCE_IOMMU
|
#ifdef CONFIG_SPAPR_TCE_IOMMU
|
||||||
struct iommu_group *pSeries_pci_device_group(struct pci_controller *hose,
|
struct iommu_group *pSeries_pci_device_group(struct pci_controller *hose,
|
||||||
struct pci_dev *pdev)
|
struct pci_dev *pdev)
|
||||||
|
Reference in New Issue
Block a user