ASM1166 on board Topton N21 can't passthough to VM

Tander

New Member
Nov 26, 2024
1
0
1
My setup
  • Topton N21
  • Proxmox 9.1.9
  • nvme for OS, 3 HDD connected to onboard ASM1166
Problem
ASM1166 working just fine in bios (I see drives) and Proxmox (it sees drives), also in dmesg:
[0.343620] pci 0000:04:00.0: [1b21:1166] type 00 class 0x010601 PCIe Endpoint
[0.343661] pci 0000:04:00.0: BAR 0 [mem 0xfce82000-0xfce83fff]
[0.343669] pci 0000:04:00.0: BAR 5 [mem 0xfce80000-0xfce81fff]
[0.343672] pci 0000:04:00.0: ROM [mem 0xfce00000-0xfce7ffff pref]
[0.343723] pci 0000:04:00.0: PME# supported from D0 D3hot D3cold

But it unable to initialize in VM when I passthough it. In dmesg I always see this:
[0.509960] pci 0000:01:00.0: [1b21:1166] type 7f class exffffff conventional PCI [
[0.510064] pci 0000:01:00.0: unknown header type 7f, ignoring device [

Attempted solutions that did NOT resolve the issue (with reboot after each try, as ASM1166 doesn't recover from that dead state)
  • IOMMU and virtualization
    enabled both in bios and Proxmox
  • IOMMU group
    ASM1166 in separate IOMMU group
  • Kernel command line parameters in GRUB
    amd_iommu=on iommu=pt libata.force=nolpm pcie_aspm=off pcie_port_pm=off
    (followed by update-grub)
  • vfio-pci module configuration
    Created /etc/modprobe.d/vfio.conf with:
    options vfio-pci ids=1b21:1166
    Updated initramfs.
  • Blacklisting the ahci driver
    File /etc/modprobe.d/ahci-blacklist.conf:
    Code:
    options vfio-pci ids=1b21:1166
    options vfio-pci disable_idle_d3=1
    softdep ahci pre: vfio-pci
  • Disabling ASPM and power management
    Parameters: pcie_aspm=off, pcie_port_pm=off, libata.force=nolpm
  • Firmware update of ASM1166
    240625-0000-05 (factory), 241224-0000-00, 211108-0000-00, 240625-0000-05 (sent by manufacturer as factory)
  • Changing Proxmox kernels
    Installed and booted: proxmox-kernel-6.17.13-7-pve-signed, proxmox-kernel-6.14.11-4-pve-signed.
  • Manual driver binding/unbinding
    echo 0000:04:00.0 > /sys/bus/pci/drivers/vfio-pci/bind
    echo 0000:05:00.0 > /sys/bus/pci/devices/0000:05:00.0/driver/unbind
    to check if unbinding doesn't cause this, and adapter kept working after that
  • Hardware reset of the device and parent device
    echo 1 > /sys/bus/pci/devices/0000:04:00.0/reset
    echo 1 > /sys/bus/pci/devices/0000:00:02.4/reset
  • PCIe power management control
    echo on > /sys/bus/pci/devices/0000:04:00.0/power/control
    Checked power_state – device remained in D3hot before starting VM and D0 after that.
  • Disabling reset methogs
    echo "" > /sys/bus/pci/devices/0000:05:00.0/reset_method
  • disable_idle_d3 parameter
    options vfio-pci disable_idle_d3=1
  • Editing VM configuration (/etc/pve/qemu-server/101.conf)
    Various combinations of hostpci (with rombar=0 and 1, pcie=0 and 1)
    Tested all combinations of bios (seabios and ovmf) and machine(q35 and i440fx)
  • Different guest OSs
    TrueNAS Scale 25 (latest), TrueNAS Scale 26 (beta) and Ubuntu 24.04 LTS as guest OS


At this point I almost lost all hope to make it work and thinking about buying proper HBA (like LSI 9207-8i) and mostly posting this to make sense from a week of fruitless debugging, but if you have any input - i'd be glad to hear it!
 
Last edited:
Probably a firmware and or hardware issue with the ASM1166. Someone else also recently complained, here:

Maybe you are better at reading, than the other guy.
 
  • Like
Reactions: Tander