From: Joerg Roedel Date: Fri, 13 Sep 2024 10:53:05 +0000 (+0200) Subject: Merge branches 'fixes', 'arm/smmu', 'intel/vt-d', 'amd/amd-vi' and 'core' into next X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=97162f6093d263aa1c2c7e883912f922ea633512;p=users%2Fjedix%2Flinux-maple.git Merge branches 'fixes', 'arm/smmu', 'intel/vt-d', 'amd/amd-vi' and 'core' into next --- 97162f6093d263aa1c2c7e883912f922ea633512 diff --cc drivers/iommu/amd/iommu.c index 6bc4030a6ba8e,b19e8c0f48fa2,b19e8c0f48fa2,f4dfabb3e14d3,98054497d343b..8364cd6fa47d0 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@@@@@ -1549,29 -1549,29 -1549,29 -1565,13 -1549,29 +1565,13 @@@@@@ void amd_iommu_dev_flush_pasid_pages(st iommu_completion_wait(iommu); } --- -void amd_iommu_dev_flush_pasid_all(struct iommu_dev_data *dev_data, --- - ioasid_t pasid) +++ +static void dev_flush_pasid_all(struct iommu_dev_data *dev_data, +++ + ioasid_t pasid) { ---- amd_iommu_dev_flush_pasid_pages(dev_data, 0, ---- CMD_INV_IOMMU_ALL_PAGES_ADDRESS, pasid); -- -} -- - -- -void amd_iommu_domain_flush_complete(struct protection_domain *domain) -- -{ -- - int i; -- - -- - for (i = 0; i < amd_iommu_get_num_iommus(); ++i) { -- - if (domain && !domain->dev_iommu[i]) -- - continue; -- - -- - /* -- - * Devices of this domain are behind this IOMMU -- - * We need to wait for completion of all commands. -- - */ -- - iommu_completion_wait(amd_iommus[i]); -- - } ++++ amd_iommu_dev_flush_pasid_pages(dev_data, pasid, 0, ++++ CMD_INV_IOMMU_ALL_PAGES_ADDRESS); } - void amd_iommu_domain_flush_complete(struct protection_domain *domain) - { - int i; - - for (i = 0; i < amd_iommu_get_num_iommus(); ++i) { - if (domain && !domain->dev_iommu[i]) - continue; - - /* - * Devices of this domain are behind this IOMMU - * We need to wait for completion of all commands. - */ - iommu_completion_wait(amd_iommus[i]); - } - } - /* Flush the not present cache if it exists */ static void domain_flush_np_cache(struct protection_domain *domain, dma_addr_t iova, size_t size) @@@@@@ -2201,8 -2201,8 -2201,8 -2194,9 -2201,11 +2194,12 @@@@@@ static struct iommu_device *amd_iommu_p pci_max_pasids(to_pci_dev(dev))); } +++ +out_err: iommu_completion_wait(iommu); ++++ if (dev_is_pci(dev)) ++++ pci_prepare_ats(to_pci_dev(dev), PAGE_SHIFT); ++++ return iommu_dev; } diff --cc drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index ed2b106e02dd1,edc625ec261dd,a31460f9f3d42,a31460f9f3d42,9bc50bded5af7..737c5b8823551 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@@@@@ -4315,9 -4337,38 -4315,9 -4315,9 -4321,9 +4343,38 @@@@@@ static int arm_smmu_device_hw_probe(str } #ifdef CONFIG_ACPI - ---static void acpi_smmu_get_options(u32 model, struct arm_smmu_device *smmu) + +++#ifdef CONFIG_TEGRA241_CMDQV + +++static void acpi_smmu_dsdt_probe_tegra241_cmdqv(struct acpi_iort_node *node, + +++ struct arm_smmu_device *smmu) + +++{ + +++ const char *uid = kasprintf(GFP_KERNEL, "%u", node->identifier); + +++ struct acpi_device *adev; + +++ + +++ /* Look for an NVDA200C node whose _UID matches the SMMU node ID */ + +++ adev = acpi_dev_get_first_match_dev("NVDA200C", uid, -1); + +++ if (adev) { + +++ /* Tegra241 CMDQV driver is responsible for put_device() */ + +++ smmu->impl_dev = &adev->dev; + +++ smmu->options |= ARM_SMMU_OPT_TEGRA241_CMDQV; + +++ dev_info(smmu->dev, "found companion CMDQV device: %s\n", + +++ dev_name(smmu->impl_dev)); + +++ } + +++ kfree(uid); + +++} + +++#else + +++static void acpi_smmu_dsdt_probe_tegra241_cmdqv(struct acpi_iort_node *node, + +++ struct arm_smmu_device *smmu) + ++ { - switch (model) { + +++} + +++#endif + +++ + +++static int acpi_smmu_iort_probe_model(struct acpi_iort_node *node, + +++ struct arm_smmu_device *smmu) +{ - -- switch (model) { + +++ struct acpi_iort_smmu_v3 *iort_smmu = + +++ (struct acpi_iort_smmu_v3 *)node->node_data; + +++ + +++ switch (iort_smmu->model) { case ACPI_IORT_SMMU_V3_CAVIUM_CN99XX: smmu->options |= ARM_SMMU_OPT_PAGE0_REGS_ONLY; break;