Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'iommu-fixes-v5.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull iommu fixes from Joerg Roedel:

- Three AMD IOMMU patches to fix a boot crash on AMD Stoney systems and
every other AMD IOMMU system booted with 'amd_iommu=off'.

This is a v5.11 regression.

- A Fix for the Tegra IOMMU driver to make sure it detects all IOMMUs

* tag 'iommu-fixes-v5.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
iommu/tegra-smmu: Make tegra_smmu_probe_device() to handle all IOMMU phandles
iommu/amd: Keep track of amd_iommu_irq_remap state
iommu/amd: Don't call early_amd_iommu_init() when AMD IOMMU is disabled
iommu/amd: Move Stoney Ridge check to detect_ivrs()

+23 -20
+20 -16
drivers/iommu/amd/init.c
··· 2714 2714 struct acpi_table_header *ivrs_base; 2715 2715 int i, remap_cache_sz, ret; 2716 2716 acpi_status status; 2717 - u32 pci_id; 2718 2717 2719 2718 if (!amd_iommu_detected) 2720 2719 return -ENODEV; ··· 2803 2804 if (ret) 2804 2805 goto out; 2805 2806 2806 - /* Disable IOMMU if there's Stoney Ridge graphics */ 2807 - for (i = 0; i < 32; i++) { 2808 - pci_id = read_pci_config(0, i, 0, 0); 2809 - if ((pci_id & 0xffff) == 0x1002 && (pci_id >> 16) == 0x98e4) { 2810 - pr_info("Disable IOMMU on Stoney Ridge\n"); 2811 - amd_iommu_disabled = true; 2812 - break; 2813 - } 2814 - } 2815 - 2816 2807 /* Disable any previously enabled IOMMUs */ 2817 2808 if (!is_kdump_kernel() || amd_iommu_disabled) 2818 2809 disable_iommus(); ··· 2869 2880 { 2870 2881 struct acpi_table_header *ivrs_base; 2871 2882 acpi_status status; 2883 + int i; 2872 2884 2873 2885 status = acpi_get_table("IVRS", 0, &ivrs_base); 2874 2886 if (status == AE_NOT_FOUND) ··· 2881 2891 } 2882 2892 2883 2893 acpi_put_table(ivrs_base); 2894 + 2895 + /* Don't use IOMMU if there is Stoney Ridge graphics */ 2896 + for (i = 0; i < 32; i++) { 2897 + u32 pci_id; 2898 + 2899 + pci_id = read_pci_config(0, i, 0, 0); 2900 + if ((pci_id & 0xffff) == 0x1002 && (pci_id >> 16) == 0x98e4) { 2901 + pr_info("Disable IOMMU on Stoney Ridge\n"); 2902 + return false; 2903 + } 2904 + } 2884 2905 2885 2906 /* Make sure ACS will be enabled during PCI probe */ 2886 2907 pci_request_acs(); ··· 2919 2918 } 2920 2919 break; 2921 2920 case IOMMU_IVRS_DETECTED: 2922 - ret = early_amd_iommu_init(); 2923 - init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED; 2924 - if (init_state == IOMMU_ACPI_FINISHED && amd_iommu_disabled) { 2925 - pr_info("AMD IOMMU disabled\n"); 2921 + if (amd_iommu_disabled) { 2926 2922 init_state = IOMMU_CMDLINE_DISABLED; 2927 2923 ret = -EINVAL; 2924 + } else { 2925 + ret = early_amd_iommu_init(); 2926 + init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED; 2928 2927 } 2929 2928 break; 2930 2929 case IOMMU_ACPI_FINISHED: ··· 3002 3001 amd_iommu_irq_remap = true; 3003 3002 3004 3003 ret = iommu_go_to_state(IOMMU_ACPI_FINISHED); 3005 - if (ret) 3004 + if (ret) { 3005 + amd_iommu_irq_remap = false; 3006 3006 return ret; 3007 + } 3008 + 3007 3009 return amd_iommu_irq_remap ? 0 : -ENODEV; 3008 3010 } 3009 3011
+3 -4
drivers/iommu/tegra-smmu.c
··· 849 849 smmu = tegra_smmu_find(args.np); 850 850 if (smmu) { 851 851 err = tegra_smmu_configure(smmu, dev, &args); 852 - of_node_put(args.np); 853 852 854 - if (err < 0) 853 + if (err < 0) { 854 + of_node_put(args.np); 855 855 return ERR_PTR(err); 856 - 857 - break; 856 + } 858 857 } 859 858 860 859 of_node_put(args.np);