amd IOMMU kernel panic while performing IRQ remapping

Discussion in 'UDOO BOLT' started by jpsollie, Aug 1, 2020.

  1. jpsollie

    jpsollie UDOOer

    Joined:
    Jul 27, 2020
    Messages:
    11
    Likes Received:
    2
    When disabling AMD SME in kernel, the PCI devices are mapped using the amd native IOMMU driver.

    When using software IOMMU, the followiing error appears:
    Code:
    snd_pci_acp3x 0000:04:00.5: Invalid ACP audio mode : 2
    When using the hardware IOMMU, the kernel panics, complaining about invalid IRQ remapping on IOMMU.
    ls-iommu.sh:
    Code:
    IOMMU Group 0 00:01.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]
    IOMMU Group 10 04:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] [1002:15dd] (rev 83)
    IOMMU Group 11 04:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio Controller [1002:15de]
    IOMMU Group 11 04:00.2 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor [1022:15df]
    IOMMU Group 11 04:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1 [1022:15e0]
    IOMMU Group 11 04:00.4 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1 [1022:15e1]
    IOMMU Group 11 04:00.5 Multimedia controller [0480]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor [1022:15e2]
    IOMMU Group 11 04:00.6 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller [1022:15e3]
    IOMMU Group 11 04:00.7 Non-VGA unclassified device [0000]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/Renoir Non-Sensor Fusion Hub KMDF driver [1022:15e6]
    IOMMU Group 1 00:01.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0] [1022:15d3]
    IOMMU Group 2 00:01.6 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0] [1022:15d3]
    IOMMU Group 3 00:01.7 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0] [1022:15d3]
    IOMMU Group 4 00:08.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]
    IOMMU Group 4 00:08.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus B [1022:15dc]
    IOMMU Group 4 05:00.0 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 61)
    IOMMU Group 5 00:08.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus A [1022:15db]
    IOMMU Group 6 00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 61)
    IOMMU Group 6 00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge [1022:790e] (rev 51)
    IOMMU Group 7 00:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 0 [1022:15e8]
    IOMMU Group 7 00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 1 [1022:15e9]
    IOMMU Group 7 00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 2 [1022:15ea]
    IOMMU Group 7 00:18.3 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 3 [1022:15eb]
    IOMMU Group 7 00:18.4 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 4 [1022:15ec]
    IOMMU Group 7 00:18.5 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 5 [1022:15ed]
    IOMMU Group 7 00:18.6 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 6 [1022:15ee]
    IOMMU Group 7 00:18.7 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 7 [1022:15ef]
    IOMMU Group 8 02:00.0 Network controller [0280]: Intel Corporation Wireless 8265 / 8275 [8086:24fd] (rev 78)
    IOMMU Group 9 03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 10)
    cat /proc/interrupts:
    Code:
               CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       CPU6       CPU7       
       0:         38          0          0          0          0          0          0          0  IR-IO-APIC    2-edge      timer
       7:          0          0          0          0          0          0          0          0  IR-IO-APIC    7-fasteoi   pinctrl_amd
       8:          0          1          0          0          0          0          0          0  IR-IO-APIC    8-edge      rtc0
       9:          0          0          0          0          0          0          0          0  IR-IO-APIC    9-fasteoi   acpi
      25:          0          0          0          0          0          0          0          0   PCI-MSI 4096-edge      AMD-Vi
      26:          0          0          0          0          0          0          0          0  IR-PCI-MSI 20480-edge      PCIe PME, aerdrv, PCIe BW notif
      27:          0          0          0          0          0          0          0          0  IR-PCI-MSI 28672-edge      PCIe PME, aerdrv, PCIe BW notif
      28:          0          0          0          0          0          0          0          0  IR-PCI-MSI 30720-edge      PCIe PME, aerdrv, PCIe BW notif
      29:          0          0          0          0          0          0          0          0  IR-PCI-MSI 133120-edge      PCIe PME, PCIe BW notif
      30:          0          0          0          0          0          0          0          0  IR-PCI-MSI 135168-edge      PCIe PME, PCIe BW notif
      32:      17079          0          0          0          0          0          0          0  IR-PCI-MSI 2621440-edge      ahci[0000:05:00.0]
      34:          0          0          0          0          0          0          0    1590367  IR-PCI-MSI 1572864-edge      eth0
      35:          0          0          0          0          0          0          0          0  IR-IO-APIC   31-fasteoi   0000:04:00.7
      36:          0    1507784          0          0          0          0          0          0  IR-PCI-MSI 2103296-edge      xhci_hcd
      37:          0          0          0          0          0          0          0          0  IR-PCI-MSI 2103297-edge      xhci_hcd
      38:          0          0          0          0          0          0          0          0  IR-PCI-MSI 2103298-edge      xhci_hcd
      39:          0          0          0          0          0          0          0          0  IR-PCI-MSI 2103299-edge      xhci_hcd
      40:          0          0          0          0          0          0          0          0  IR-PCI-MSI 2103300-edge      xhci_hcd
      41:          0          0          0          0          0          0          0          0  IR-PCI-MSI 2103301-edge      xhci_hcd
      42:          0          0          0          0          0          0          0          0  IR-PCI-MSI 2103302-edge      xhci_hcd
      43:          0          0          0          0          0          0          0          0  IR-PCI-MSI 2103303-edge      xhci_hcd
      45:          0       4921          0          0          0          0          0          0  IR-PCI-MSI 2105344-edge      xhci_hcd
      46:          0          0          0          0          0          0          0          0  IR-PCI-MSI 2105345-edge      xhci_hcd
      47:          0          0          0          0          0          0          0          0  IR-PCI-MSI 2105346-edge      xhci_hcd
      48:          0          0          0          0          0          0          0          0  IR-PCI-MSI 2105347-edge      xhci_hcd
      49:          0          0          0          0          0          0          0          0  IR-PCI-MSI 2105348-edge      xhci_hcd
      50:          0          0          0          0          0          0          0          0  IR-PCI-MSI 2105349-edge      xhci_hcd
      51:          0          0          0          0          0          0          0          0  IR-PCI-MSI 2105350-edge      xhci_hcd
      52:          0          0          0          0          0          0          0          0  IR-PCI-MSI 2105351-edge      xhci_hcd
      54:          0          0          0          0          0          0          0          0  IR-PCI-MSI 2101249-edge      ccp-1
      56:          0          0          0          0          0         47          0          0  IR-PCI-MSI 1048576-edge      iwlwifi
      57:          0          0          0          0          0          0       5474          0  IR-PCI-MSI 2097152-edge      amdgpu
    
    I saw also that some hardware IRQ remapping on IOMMU is possible, but I don't know what may be wrong with the current situation. Any suggestion?
     
  2. rdslw

    rdslw UDOOer

    Joined:
    Apr 5, 2014
    Messages:
    38
    Likes Received:
    17
    Do you have IOMMU enabled or disabled in Bolt BIOS?
    Default state (after bios reset) is DISABLED. I'm suspecting it is because ENABLED causes some problems.
     
  3. jpsollie

    jpsollie UDOOer

    Joined:
    Jul 27, 2020
    Messages:
    11
    Likes Received:
    2
    Yes, I enabled it: originally, I disabled it, but the intel_hda_audio driver didn't like it: if I do not use IOMMU, there's no HDMI sound card in alsamixer
     
  4. rdslw

    rdslw UDOOer

    Joined:
    Apr 5, 2014
    Messages:
    38
    Likes Received:
    17
    I can confirm, currently linux 5.8.5 works correctly with IOMMU enabled (which is NOT factory default, and you must change it in udoo bolt firmware).
     
    waltervl likes this.
  5. wind.gmbh

    wind.gmbh UDOOer

    Joined:
    Sep 4, 2020
    Messages:
    5
    Likes Received:
    3
    Can you give a little more information on the exact conditions you achieved that? I was trying it out with Fedora 32 Server Minimal Installation (Kernel 5.8.6-201.fc32.x86_64) where the kernel is repeatedly producing this severe error message:

    Code:
    [   89.532745] WARNING: CPU: 4 PID: 448 at drivers/mmc/host/sdhci.c:1143 sdhci_send_command+0x8dc/0xe30 [sdhci]
    [  89.532746] Modules linked in: nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip6_tables nft_compat ip_set rfkill nf_tables nfnetlink amd64_edac_mod edac_mce_amd snd_hda_codec_realtek kvm_amd kvm snd_hda_codec_generic irqbypass ledtrig_audio snd_hda_codec_hdmi rapl vfat snd_hda_intel fat snd_intel_dspcfg snd_soc_dmic snd_acp3x_rn snd_acp3x_pdm_dma snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_codec snd_rn_pci_acp3x cdc_acm snd_hda_core r8169 snd_pci_acp3x snd_hwdep i2c_amd_mp2_pci cm32181 snd_pcsp industrialio sp5100_tco snd_pcm k10temp snd_timer i2c_piix4 snd soundcore acpi_cpufreq ip_tables xfs amdgpu mmc_block iommu_v2 gpu_sched i2c_algo_bit ttm drm_kms_helper crct10dif_pclmul crc32_pclmul crc32c_intel cec ghash_clmulni_intel drm sdhci_acpi sdhci nvme ccp mmc_core nvme_core i2c_hid pinctrl_amd video
    [   89.532771] CPU: 4 PID: 448 Comm: kworker/4:2H Tainted: G        W         5.8.6-201.fc32.x86_64 #1
    [   89.532771] Hardware name: Seco C40/C40, BIOS 1.08 04/23/2020
    [   89.532775] Workqueue: kblockd blk_mq_run_work_fn
    [   89.532778] RIP: 0010:sdhci_send_command+0x8dc/0xe30 [sdhci]
    [  89.532779] Code: 48 8b 4a 20 48 85 c9 0f 85 e2 03 00 00 48 8b 55 18 66 89 42 0c e9 fe f8 ff ff 0f 0b e9 e0 f7 ff ff 0f 0b e9 24 fb ff ff 0f 0b <0f> 0b 83 a5 8c 02 00 00 fb e9 65 fe ff ff 45 85 ff 0f 84 17 fe ff
    [   89.532780] RSP: 0018:ffff99d980edfb90 EFLAGS: 00010086
    [   89.532781] RAX: 00000000ffffffe4 RBX: ffff8d68b1726a60 RCX: 00000000fffcc7c8
    [   89.532781] RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000006
    [   89.532782] RBP: ffff8d68bc863580 R08: ffffffffffffffff R09: 0000000000000002
    [   89.532782] R10: 0000000000000002 R11: 0000000000000000 R12: ffff8d68b1726ad0
    [   89.532783] R13: 0000000000000003 R14: 0000000000000001 R15: 0000000000000003
    [   89.532784] FS:  0000000000000000(0000) GS:ffff8d68bff00000(0000) knlGS:0000000000000000
    [   89.532784] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [   89.532785] CR2: 000055b74a42d130 CR3: 00000007ee112000 CR4: 00000000003406e0
    [   89.532785] Call Trace:
    [   89.532791]  sdhci_send_command_retry+0x40/0xf0 [sdhci]
    [   89.532794]  sdhci_request+0x6e/0xc0 [sdhci]
    [   89.532799]  mmc_start_request+0xa8/0xe0 [mmc_core]
    [   89.532801]  mmc_blk_mq_issue_rq+0x32b/0x940 [mmc_block]
    [   89.532804]  ? wake_up_q+0xa0/0xa0
    [   89.532806]  ? ktime_get+0x38/0xa0
    [   89.532808]  mmc_mq_queue_rq+0x12f/0x260 [mmc_block]
    [   89.532810]  blk_mq_dispatch_rq_list+0xd5/0x790
    [   89.532812]  ? bfq_dispatch_request+0xb9a/0x1070
    [   89.532814]  blk_mq_do_dispatch_sched+0xf6/0x140
    [   89.532816]  __blk_mq_sched_dispatch_requests+0x159/0x160
    [   89.532817]  blk_mq_sched_dispatch_requests+0x30/0x60
    [   89.532818]  __blk_mq_run_hw_queue+0x95/0x110
    [   89.532820]  process_one_work+0x1b4/0x370
    [   89.532821]  worker_thread+0x53/0x3e0
    [   89.532822]  ? process_one_work+0x370/0x370
    [   89.532824]  kthread+0x119/0x140
    [   89.532825]  ? __kthread_bind_mask+0x60/0x60
    [   89.532827]  ret_from_fork+0x22/0x30
    [   89.532828] ---[ end trace fef5451378d34fcf ]---
    [   89.539685] ------------[ cut here ]------------
    
    Steps to reproduce:
    1. Using the BIOS 1.08 in default configuration,
    2. install Fedora 32 Server (Minimal) onto the eMMC,
    3. use automatic upgrades in the installer to upgrade to 5.8.6-201.fc32.x86_64,
    4. reboot into BIOS,
    5. enable IOMMU in BIOS and reboot into the Operating System,
    6. boom!
    I suspect that you were not using the eMMC for the Installation of the Operating System?
     

Share This Page