ANDROID: vendor hooks: Enable Vendor hook to register smmu driver to dedicated iommu bus defined by vendor.
Current implementation of iommu busses driver has temporarily enforce global restriction to a single driver. This was already the de-facto behaviour, since any possible combination of existing drivers would compete for at least the PCI or platform bus. Due to this restriction we are not able to probe SMMU v3 driver for PCI bus. There is an ongoing work in upstream(https://lore.kernel.org/linux-iommu/cover.1696253096.git.robin.murphy@arm.com/#t) to fix this but we can't backport now as still review in progress. However, Some of our targets have both SMMU v2 (used by all peripherals except PCIe) and SMMU v3 (PCie) and they are expected to co-exit in current kernel version. To cater this requirement, we have implemented a vendor hook, which will skip the pci bus probe for smmuv2 and in smmuv3 skips all iommu buses execept pcie bus. Bug: 305648820 Signed-off-by: Venkata Rao Kakani <vkakani@qti.qualcomm.com> Change-Id: I9304962a7fc7afad93295cc08b3c68f8e340ffe8
This commit is contained in:
parent
fadd504206
commit
2fff9f7cd4
@ -343,3 +343,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_alloc_pages_may_oom_exit);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_vmscan_kswapd_done);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_compaction_begin);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_compaction_end);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_bus_iommu_probe);
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <linux/cc_platform.h>
|
||||
#include <trace/events/iommu.h>
|
||||
#include <linux/sched/mm.h>
|
||||
#include <trace/hooks/iommu.h>
|
||||
|
||||
#include "dma-iommu.h"
|
||||
|
||||
@ -223,7 +224,8 @@ int iommu_device_register(struct iommu_device *iommu,
|
||||
* already the de-facto behaviour, since any possible combination of
|
||||
* existing drivers would compete for at least the PCI or platform bus.
|
||||
*/
|
||||
if (iommu_buses[0]->iommu_ops && iommu_buses[0]->iommu_ops != ops)
|
||||
if (iommu_buses[0]->iommu_ops && iommu_buses[0]->iommu_ops != ops
|
||||
&& !trace_android_vh_bus_iommu_probe_enabled())
|
||||
return -EBUSY;
|
||||
|
||||
iommu->ops = ops;
|
||||
@ -235,6 +237,11 @@ int iommu_device_register(struct iommu_device *iommu,
|
||||
spin_unlock(&iommu_device_lock);
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(iommu_buses) && !err; i++) {
|
||||
bool skip = false;
|
||||
|
||||
trace_android_vh_bus_iommu_probe(iommu, iommu_buses[i], &skip);
|
||||
if (skip)
|
||||
continue;
|
||||
iommu_buses[i]->iommu_ops = ops;
|
||||
err = bus_iommu_probe(iommu_buses[i]);
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ DECLARE_RESTRICTED_HOOK(android_rvh_iommu_setup_dma_ops,
|
||||
|
||||
struct iova_domain;
|
||||
struct iova;
|
||||
struct iommu_device;
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_iommu_alloc_insert_iova,
|
||||
TP_PROTO(struct iova_domain *iovad, unsigned long size,
|
||||
@ -40,6 +41,10 @@ DECLARE_RESTRICTED_HOOK(android_rvh_iommu_limit_align_shift,
|
||||
unsigned long *shift),
|
||||
TP_ARGS(iovad, size, shift), 1);
|
||||
|
||||
DECLARE_HOOK(android_vh_bus_iommu_probe,
|
||||
TP_PROTO(struct iommu_device *iommu, struct bus_type *bus, bool *skip),
|
||||
TP_ARGS(iommu, bus, skip));
|
||||
|
||||
#endif /* _TRACE_HOOK_IOMMU_H */
|
||||
|
||||
/* This part must be outside protection */
|
||||
|
Loading…
Reference in New Issue
Block a user